-
Notifications
You must be signed in to change notification settings - Fork 2
56 lines (47 loc) · 1.58 KB
/
Copy pathcpp-ci.yml
File metadata and controls
56 lines (47 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: C++ CI
on:
push:
branches: [ main, master ]
paths:
- 'cpp/**'
- 'CMakeLists.txt'
- '.github/workflows/cpp-ci.yml'
pull_request:
branches: [ main, master ]
paths:
- 'cpp/**'
- 'CMakeLists.txt'
- '.github/workflows/cpp-ci.yml'
workflow_dispatch:
concurrency:
group: cpp-ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-and-test:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Ninja
if: runner.os != 'Windows'
run: pip install ninja
- name: Setup ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
key: ${{ matrix.os }}-ccache-${{ github.ref_name }}-${{ github.sha }}
restore-keys: ${{ matrix.os }}-ccache-${{ github.ref_name }}-
- name: Configure CMake (Windows)
if: runner.os == 'Windows'
run: cmake -B build -S cpp -DFORCE_AVX2=ON -DENABLE_BENCHMARKS=OFF -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
- name: Configure CMake (Non-Windows)
if: runner.os != 'Windows'
run: cmake -B build -S cpp -G Ninja -DCMAKE_BUILD_TYPE=Release -DFORCE_AVX2=ON -DENABLE_BENCHMARKS=OFF -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
- name: Build
run: cmake --build build --config Release --parallel 2
- name: Run Tests
run: ctest --test-dir build --output-on-failure -C Release