-
-
Notifications
You must be signed in to change notification settings - Fork 8
61 lines (58 loc) · 2.57 KB
/
deploy_test_coverage_coveralls.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
name: 'Deploy Code Coverage: Coveralls'
on:
push:
branches: [ master ]
pull_request:
branches: [ master]
schedule:
- cron: '0 0 * * */5'
permissions:
contents: read
jobs:
build:
permissions:
checks: write
contents: read
runs-on: ubuntu-24.04
steps:
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: 'Install'
run: sudo apt install lcov
- name: 'Configure'
env:
CXX: 'g++-14'
CXXFLAGS: '-O0 -g --coverage -fno-inline -fno-exceptions'
CC: 'gcc-14'
CCFLAGS: '-O0 -g --coverage -fno-inline -fno-exceptions'
run: cmake -S . -B 'build'
- name: 'Build'
run: cmake --build 'build' --verbose --parallel 4
- name: 'Coverage: Base'
run: |
lcov --rc branch_coverage=1 --gcov-tool gcov-14 --capture --initial --directory . --output-file base.info
lcov --rc branch_coverage=1 --gcov-tool gcov-14 --remove base.info '*/build/*' --output-file base.info
lcov --rc branch_coverage=1 --gcov-tool gcov-14 --remove base.info '*/sample/*' --output-file base.info
lcov --rc branch_coverage=1 --gcov-tool gcov-14 --remove base.info '*/test/*' --output-file base.info
lcov --rc branch_coverage=1 --gcov-tool gcov-14 --remove base.info '/usr/*' --output-file base.info
- name: 'Test'
run: ctest --test-dir 'build' --tests-regex 'kalman' --verbose --parallel 4
- name: 'Coverage: Test'
run: |
lcov --rc branch_coverage=1 --gcov-tool gcov-14 --capture --directory . --output-file test.info
lcov --rc branch_coverage=1 --gcov-tool gcov-14 --remove test.info '*/build/*' --output-file test.info
lcov --rc branch_coverage=1 --gcov-tool gcov-14 --remove test.info '*/sample/*' --output-file test.info
lcov --rc branch_coverage=1 --gcov-tool gcov-14 --remove test.info '*/test/*' --output-file test.info
lcov --rc branch_coverage=1 --gcov-tool gcov-14 --remove test.info '/usr/*' --output-file test.info
- name: 'Coverage: Results'
run: lcov --rc branch_coverage=1 --gcov-tool gcov-14 --rc branch_coverage=1 --add-tracefile base.info --add-tracefile test.info --output-file coverage.info
- name: Coveralls
uses: coverallsapp/github-action@cfd0633edbd2411b532b808ba7a8b5e04f76d2c8 # v2.3.4
with:
file: coverage.info
format: lcov
github-token: ${{ secrets.GITHUB_TOKEN }}