Skip to content

Commit 2a3c95f

Browse files
committed
Added GH CI build script
1 parent 279655a commit 2a3c95f

File tree

1 file changed

+154
-0
lines changed

1 file changed

+154
-0
lines changed

.github/workflows/build.yml

Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
---
2+
name: Build and Test
3+
on:
4+
push:
5+
branches: [master]
6+
paths:
7+
- src/**
8+
- test/**
9+
- cmake/**
10+
- CMakeLists.txt
11+
- CMakePresets.json
12+
pull_request:
13+
branches: [master]
14+
types: [synchronize, opened, reopened, ready_for_review]
15+
paths:
16+
- src/**
17+
- test/**
18+
- cmake/**
19+
- CMakeLists.txt
20+
- CMakePresets.json
21+
workflow_dispatch:
22+
23+
concurrency:
24+
group: Server-${{ github.head_ref }}
25+
cancel-in-progress: true
26+
27+
jobs:
28+
ubuntu-2404:
29+
runs-on: ubuntu-24.04
30+
env:
31+
CMAKE_GENERATOR: Ninja
32+
steps:
33+
- name: Setup Runner Environment
34+
run: |
35+
uname -a
36+
lsb_release -a
37+
CORES=$(nproc)
38+
echo "CMAKE_BUILD_PARALLEL_LEVEL=$CORES" >> $GITHUB_ENV
39+
echo "CTEST_TEST_PARALLEL_LEVEL=$CORES" >> $GITHUB_ENV
40+
echo "CTEST_TEST_LOAD=$CORES" >> $GITHUB_ENV
41+
- uses: actions/checkout@v4
42+
- name: Install Build Tools
43+
run: |
44+
sudo apt-get -qq update
45+
sudo apt-get -qq install cmake ninja-build g++ libboost-program-options-dev libboost-test-dev
46+
- name: Configure Multi-Config
47+
run: cmake --preset multi-san
48+
- name: Build Debug
49+
run: cmake --build --preset debug-san
50+
- name: Test Debug
51+
run: ctest --preset debug-san
52+
- name: Build Release
53+
run: cmake --build --preset release-san
54+
- name: Test Release
55+
run: ctest --preset release-san
56+
57+
macOS-13:
58+
runs-on: macos-13
59+
env:
60+
CMAKE_GENERATOR: Ninja
61+
steps:
62+
- uses: maxim-lobanov/setup-xcode@v1
63+
with:
64+
xcode-version: '14.3.1'
65+
- name: Setup Runner Environment
66+
run: |
67+
uname -a
68+
xcrun --show-sdk-version
69+
CORES=$(sysctl -n hw.ncpu)
70+
echo "CMAKE_BUILD_PARALLEL_LEVEL=$CORES" >> $GITHUB_ENV
71+
echo "CTEST_TEST_PARALLEL_LEVEL=$CORES" >> $GITHUB_ENV
72+
echo "CTEST_TEST_LOAD=$CORES" >> $GITHUB_ENV
73+
- uses: actions/checkout@v4
74+
75+
- name: Install Build Tools
76+
run: |
77+
brew update
78+
brew install cmake ninja boost
79+
- name: Configure Multi-Config
80+
run: cmake --preset multi-san
81+
- name: Build Debug
82+
run: cmake --build --preset debug-san
83+
- name: Test Debug
84+
run: ctest --preset debug-san
85+
- name: Build Release
86+
run: cmake --build --preset release-san
87+
- name: Test Release
88+
run: ctest --preset release-san
89+
90+
macOS-14:
91+
runs-on: macos-14
92+
env:
93+
CMAKE_GENERATOR: Ninja
94+
steps:
95+
- uses: maxim-lobanov/setup-xcode@v1
96+
with:
97+
xcode-version: '15.4.0'
98+
- name: Setup Runner Environment
99+
run: |
100+
uname -a
101+
xcrun --show-sdk-version
102+
CORES=$(sysctl -n hw.ncpu)
103+
echo "CMAKE_BUILD_PARALLEL_LEVEL=$CORES" >> $GITHUB_ENV
104+
echo "CTEST_TEST_PARALLEL_LEVEL=$CORES" >> $GITHUB_ENV
105+
echo "CTEST_TEST_LOAD=$CORES" >> $GITHUB_ENV
106+
- uses: actions/checkout@v4
107+
108+
- name: Install Build Tools
109+
run: |
110+
brew update
111+
brew install cmake ninja boost
112+
- name: Configure Multi-Config
113+
run: cmake --preset multi-san
114+
- name: Build Debug
115+
run: cmake --build --preset debug-san
116+
- name: Test Debug
117+
run: ctest --preset debug-san
118+
- name: Build Release
119+
run: cmake --build --preset release-san
120+
- name: Test Release
121+
run: ctest --preset release-san
122+
123+
macOS-15:
124+
runs-on: macos-15
125+
env:
126+
CMAKE_GENERATOR: Ninja
127+
steps:
128+
- uses: maxim-lobanov/setup-xcode@v1
129+
with:
130+
xcode-version: '16.4.0'
131+
- name: Setup Runner Environment
132+
run: |
133+
uname -a
134+
xcrun --show-sdk-version
135+
CORES=$(sysctl -n hw.ncpu)
136+
echo "CMAKE_BUILD_PARALLEL_LEVEL=$CORES" >> $GITHUB_ENV
137+
echo "CTEST_TEST_PARALLEL_LEVEL=$CORES" >> $GITHUB_ENV
138+
echo "CTEST_TEST_LOAD=$CORES" >> $GITHUB_ENV
139+
- uses: actions/checkout@v4
140+
141+
- name: Install Build Tools
142+
run: |
143+
brew update
144+
brew install cmake ninja boost
145+
- name: Configure Multi-Config
146+
run: cmake --preset multi-san
147+
- name: Build Debug
148+
run: cmake --build --preset debug-san
149+
- name: Test Debug
150+
run: ctest --preset debug-san
151+
- name: Build Release
152+
run: cmake --build --preset release-san
153+
- name: Test Release
154+
run: ctest --preset release-san

0 commit comments

Comments
 (0)