-
Notifications
You must be signed in to change notification settings - Fork 5
54 lines (47 loc) · 1.49 KB
/
build.yaml
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
name: "Build"
on:
pull_request:
paths:
- ".github/workflows/build.yaml"
- "CMakeLists.txt"
- "examples/**/*"
- "src/**/*"
- "tests/**/*"
- "tools/deps-install/ubuntu/**/*"
push:
paths:
- ".github/workflows/build.yaml"
- "CMakeLists.txt"
- "examples/**/*"
- "src/**/*"
- "tests/**/*"
- "tools/deps-install/ubuntu/**/*"
workflow_call:
concurrency:
group: "${{github.workflow}}-${{github.ref}}"
# Cancel in-progress jobs for efficiency
cancel-in-progress: true
jobs:
build:
strategy:
matrix:
os: ["macos-latest", "ubuntu-latest"]
build_type: ["Debug", "Release"]
runs-on: "${{matrix.os}}"
steps:
- uses: "actions/checkout@v4"
- name: "Install Catch2 on macOS"
if: "matrix.os == 'macos-latest'"
run: "brew install catch2"
- name: "Install Catch2 on Ubuntu"
if: "matrix.os == 'ubuntu-latest'"
run: "./tools/deps-install/ubuntu/install-catch2.sh 3.6.0"
- name: "Build Executables"
run: |-
cmake -B ./build -DBUILD_TESTING=ON -DCMAKE_BUILD_TYPE=${{matrix.build_type}}
cmake --build ./build --config ${{matrix.build_type}}
cmake --install ./build --prefix ./install
cmake -S examples -B ./examples/build -DCMAKE_BUILD_TYPE=${{matrix.build_type}}
cmake --build ./examples/build --config ${{matrix.build_type}}
- name: "Run Unit Tests"
run: "ctest --test-dir ./build"