Skip to content

Commit 9ce4190

Browse files
authored
Merge pull request #3 from 0xeb/feature/add-ci
Add GitHub Actions CI workflow
2 parents 78c58f5 + 74f743b commit 9ce4190

1 file changed

Lines changed: 56 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
build:
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
os: [ubuntu-latest, windows-latest, macos-latest]
19+
build_type: [Debug, Release]
20+
21+
runs-on: ${{ matrix.os }}
22+
name: ${{ matrix.os }} (${{ matrix.build_type }})
23+
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v4
27+
28+
- name: Cache FetchContent dependencies
29+
uses: actions/cache@v4
30+
with:
31+
path: build/_deps
32+
key: deps-${{ runner.os }}-${{ hashFiles('CMakeLists.txt') }}
33+
restore-keys: |
34+
deps-${{ runner.os }}-
35+
36+
- name: Configure (Unix)
37+
if: runner.os != 'Windows'
38+
run: >
39+
cmake -B build -S .
40+
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
41+
-DFASTMCPP_BUILD_TESTS=ON
42+
-DFASTMCPP_BUILD_EXAMPLES=ON
43+
44+
- name: Configure (Windows)
45+
if: runner.os == 'Windows'
46+
run: >
47+
cmake -B build -S .
48+
-G "Visual Studio 17 2022"
49+
-DFASTMCPP_BUILD_TESTS=ON
50+
-DFASTMCPP_BUILD_EXAMPLES=ON
51+
52+
- name: Build
53+
run: cmake --build build --config ${{ matrix.build_type }} --parallel
54+
55+
- name: Test
56+
run: ctest --test-dir build -C ${{ matrix.build_type }} --output-on-failure

0 commit comments

Comments
 (0)