52 lines (42 loc) · 1.3 KB
/
ci-linux.yml
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
name: Building and Testing on Linux 🐧
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, ubuntu-20.04]
compiler: [gcc, clang]
build-type: [Release, Debug]
name: "Build: ${{matrix.os}} • ${{matrix.build-type}} • ${{matrix.compiler}}"
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v4
- name: Setup CMake
uses: jwlawson/actions-setup-cmake@v1.14.1
with:
github-api-token: ${{ secrets.GITHUB_TOKEN }}
- if: ${{ matrix.compiler == 'gcc' }}
name: Configure GNU/GCC as C/C++ compiler
run: |
echo "Choosing GNU/GCC as compiler"
echo "CC=gcc" >> $GITHUB_ENV
echo "CXX=g++" >> $GITHUB_ENV
- if: ${{ matrix.compiler == 'clang' }}
name: Configure LLVM/Clang as C/C++ compiler
run: |
echo "Choosing LLVM/Clang as compiler"
echo "CC=clang" >> $GITHUB_ENV
echo "CXX=clang++" >> $GITHUB_ENV
- name: Configure CMake
run: cmake -S . -B build -DCMAKE_BUILD_TYPE=${{matrix.build-type}}
- name: Build C++ Project
run: cmake --build build --config ${{matrix.build-type}}
- name: Running C++ Tests
run: ctest --test-dir build/tests/cpp