-
Notifications
You must be signed in to change notification settings - Fork 282
115 lines (103 loc) · 3.03 KB
/
build-test-cplusplus.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
name: Build and Test C++
on:
push:
branches:
- main
release:
types: [published]
pull_request:
branches:
- "**"
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}--${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }}
cancel-in-progress: true
jobs:
coverage:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Collect coverage data
run: |
sudo apt-get update
sudo apt-get install lcov -y
cmake -B ../build -DCMAKE_BUILD_TYPE=Debug -DWITH_COVERAGE=1
cmake --build ../build -- -j 6
../build/RunTests
lcov --directory ../build --capture --output-file lcov.info
lcov --remove lcov.info '*_deps/*' '/usr/*' --output-file lcov.info
- name: Upload to Coveralls
uses: coverallsapp/github-action@v2
if: always()
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
with:
path-to-lcov: "./lcov.info"
valgrind:
name: valgrind ubuntu
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: cmake, RunTests, and valgrind on ubuntu-20.04
run: |
sudo apt update
sudo apt-get install valgrind -y
mkdir build
cd build
cmake ../
cmake --build . -- -j 6
ctest -j 6 --output-on-failure
valgrind --leak-check=full --show-leak-kinds=all --errors-for-leak-kinds=all ctest -j 6 --output-on-failure
asan:
name: ASAN ubuntu
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: cmake, RunTests with address- and undefined sanitizer on Ubuntu
run: |
mkdir build-asan
cd build-asan
cmake -DCMAKE_BUILD_TYPE=ASAN ../
cmake --build . -- -j 6
./RunTests
tsan:
name: TSAN ubuntu
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: cmake, RunTests with thread sanitizer on Ubuntu
run: |
mkdir build-tsan
cd build-tsan
cmake -DCMAKE_BUILD_TYPE=TSAN ../
cmake --build . -- -j 6
./RunTests
mac:
name: MacOS
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: cmake, RunTests on Mac
run: |
mkdir build
cd build
cmake ..
cmake --build . --config Release -j 6
./RunTests
windows:
name: Windows Latest
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: cmake, RunTests with Windows
run: |
mkdir build-win
cd build-win
cmake ..
cmake --build . --config Release -j 6
ctest -C Release -j 6