-
-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (56 loc) · 1.61 KB
/
ci.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: CI Pipeline
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build-and-test:
runs-on: ubuntu-latest
strategy:
matrix:
compiler: [gcc, clang]
build_type: [Debug, Release]
fail-fast: false
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y cmake ninja-build valgrind ${matrix.compiler} ${matrix.compiler}++
- name: Configure with CMake
run: |
mkdir -p build
cd build
cmake .. \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DCMAKE_C_COMPILER=${{ matrix.compiler }} \
-DCMAKE_CXX_COMPILER=${{ matrix.compiler }}++
- name: Build the project
run: |
cd build
cmake --build . --config ${{ matrix.build_type }}
- name: Run tests
run: |
cd build
ctest --output-on-failure
- name: Run Valgrind tests
if: ${{ matrix.build_type == 'Debug' }}
run: |
cd build
ctest -R ValgrindTests --output-on-failure
- name: Upload build artifacts
if: always()
uses: actions/upload-artifact@v3
with:
name: build-${{ matrix.compiler }}-${{ matrix.build_type }}
path: build
- name: Upload Valgrind logs
if: always()
uses: actions/upload-artifact@v3
with:
name: valgrind-logs-${{ matrix.compiler }}-${{ matrix.build_type }}
path: build/valgrind.log