-
Notifications
You must be signed in to change notification settings - Fork 26
68 lines (54 loc) · 1.65 KB
/
coverage.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
name: Coverage
on:
push:
branches:
- main
- v*
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
coverage:
name: Coverage
runs-on: ubuntu-latest
strategy:
matrix:
std: ["11", "14", "17", "20"]
unitBase: ["uint64_t", "uint32_t"]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get LCov
run: |
sudo apt-get install ca-certificates lcov
#wget https://github.com/linux-test-project/lcov/releases/download/v2.2/lcov-2.2.tar.gz
#tar -xzf lcov-2.2.tar.gz
#cd lcov-2.2
#sudo make install
- name: Configure
run: |
cmake -S . -B build \
-DCMAKE_CXX_STANDARD=${{matrix.std}} \
-DUNITS_ENABLE_TESTS=ON \
-DUNITS_BASE_TYPE=${{matrix.unitBase}} \
-DCMAKE_BUILD_TYPE=Coverage
- name: Build
run: cmake --build build -j4
- name: Test
run: |
cd build
ctest --output-on-failure
- name: Prepare coverage
run: |
lcov --directory . --capture --output-file coverage.info
lcov --remove coverage.info '*/test/*' '*/examples/*' '*gtest*' '*gmock*' '/usr/*' '*/converter/*' '*/FuzzTargets/*' '*/webserver/*' --output-file coverage.info
lcov --list coverage.info
working-directory: build
- uses: codecov/codecov-action@v5
with:
files: build/coverage.info
fail_ci_if_error: true
functionalities: fixes
token: ${{ secrets.CODECOV_TOKEN }} # required