Skip to content

Commit ac9e745

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

File tree

1 file changed

+150
-0
lines changed

1 file changed

+150
-0
lines changed

.github/workflows/build.yml

Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
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
47+
run: cmake --preset multi-san
48+
- name: Build
49+
run: cmake --build --preset debug-san
50+
- name: Test
51+
run: ctest --preset debug-san
52+
53+
macOS-13:
54+
runs-on: macos-13
55+
env:
56+
CMAKE_GENERATOR: Ninja
57+
steps:
58+
- uses: maxim-lobanov/setup-xcode@v1
59+
with:
60+
xcode-version: '14.3.1'
61+
- name: Setup Runner Environment
62+
run: |
63+
uname -a
64+
xcrun --show-sdk-version
65+
CORES=$(sysctl -n hw.ncpu)
66+
echo "CMAKE_BUILD_PARALLEL_LEVEL=$CORES" >> $GITHUB_ENV
67+
echo "CTEST_TEST_PARALLEL_LEVEL=$CORES" >> $GITHUB_ENV
68+
echo "CTEST_TEST_LOAD=$CORES" >> $GITHUB_ENV
69+
- uses: actions/checkout@v4
70+
71+
- name: Install Build Tools
72+
run: |
73+
brew update
74+
brew install cmake ninja libboost-dev
75+
- name: Configure
76+
run: cmake --preset multi-san
77+
- name: Build Debug
78+
run: cmake --build --preset debug-san
79+
- name: Test Debug
80+
run: ctest --preset debug-san
81+
- name: Build Release
82+
run: cmake --build --preset release-san
83+
- name: Test Release
84+
run: ctest --preset release-san
85+
86+
macOS-14:
87+
runs-on: macos-14
88+
env:
89+
CMAKE_GENERATOR: Ninja
90+
steps:
91+
- uses: maxim-lobanov/setup-xcode@v1
92+
with:
93+
xcode-version: '15.4.0'
94+
- name: Setup Runner Environment
95+
run: |
96+
uname -a
97+
xcrun --show-sdk-version
98+
CORES=$(sysctl -n hw.ncpu)
99+
echo "CMAKE_BUILD_PARALLEL_LEVEL=$CORES" >> $GITHUB_ENV
100+
echo "CTEST_TEST_PARALLEL_LEVEL=$CORES" >> $GITHUB_ENV
101+
echo "CTEST_TEST_LOAD=$CORES" >> $GITHUB_ENV
102+
- uses: actions/checkout@v4
103+
104+
- name: Install Build Tools
105+
run: |
106+
brew update
107+
brew install cmake ninja libboost-dev
108+
- name: Configure
109+
run: cmake --preset multi-san
110+
- name: Build Debug
111+
run: cmake --build --preset debug-san
112+
- name: Test Debug
113+
run: ctest --preset debug-san
114+
- name: Build Release
115+
run: cmake --build --preset release-san
116+
- name: Test Release
117+
run: ctest --preset release-san
118+
119+
macOS-15:
120+
runs-on: macos-15
121+
env:
122+
CMAKE_GENERATOR: Ninja
123+
steps:
124+
- uses: maxim-lobanov/setup-xcode@v1
125+
with:
126+
xcode-version: '16.4.0'
127+
- name: Setup Runner Environment
128+
run: |
129+
uname -a
130+
xcrun --show-sdk-version
131+
CORES=$(sysctl -n hw.ncpu)
132+
echo "CMAKE_BUILD_PARALLEL_LEVEL=$CORES" >> $GITHUB_ENV
133+
echo "CTEST_TEST_PARALLEL_LEVEL=$CORES" >> $GITHUB_ENV
134+
echo "CTEST_TEST_LOAD=$CORES" >> $GITHUB_ENV
135+
- uses: actions/checkout@v4
136+
137+
- name: Install Build Tools
138+
run: |
139+
brew update
140+
brew install cmake ninja libboost-dev
141+
- name: Configure
142+
run: cmake --preset multi-san
143+
- name: Build Debug
144+
run: cmake --build --preset debug-san
145+
- name: Test Debug
146+
run: ctest --preset debug-san
147+
- name: Build Release
148+
run: cmake --build --preset release-san
149+
- name: Test Release
150+
run: ctest --preset release-san

0 commit comments

Comments
 (0)