-
Notifications
You must be signed in to change notification settings - Fork 2
49 lines (40 loc) · 1.04 KB
/
coverage.yml
File metadata and controls
49 lines (40 loc) · 1.04 KB
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
name: Coverage
on:
push:
branches: [ main ]
pull_request:
jobs:
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install tools
run: sudo apt-get update && sudo apt-get install -y lcov gcovr
# ---- BUILD ----
- name: Configure
run: cmake -DCOVERAGE=ON -DCMAKE_BUILD_TYPE=Debug -DPSLP_BUILD_TESTING=ON .
- name: Build
run: make -j
# ---- RUN TESTS ----
- name: Run tests
run: |
if [ -f "CTestTestfile.cmake" ]; then
ctest --output-on-failure
else
bin/all_tests
fi
# ---- GENERATE COVERAGE ----
- name: Generate coverage
run: |
gcovr \
--root . \
--xml-pretty \
--output coverage.xml \
--exclude 'test/*' \
--exclude 'build/*'
# ---- SEND TO COVERALLS ----
- name: Upload to Coveralls
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: coverage.xml