Repository navigation
96 lines (80 loc) · 2.2 KB
/
Copy pathcoverage.yml
File metadata and controls
96 lines (80 loc) · 2.2 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
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
name: Coverage Report
on:
push:
branches:
- main
- master
pull_request:
branches:
- main
- master
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
coverage:
name: GCC coverage
runs-on: ubuntu-latest
timeout-minutes: 30
env:
CC: gcc
CXX: g++
steps:
- name: Check out source
uses: actions/checkout@v7
- name: Set up Python
uses: actions/setup-python@v7
with:
python-version: "3.x"
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
gcc \
g++ \
libboost-all-dev \
libeigen3-dev \
nlohmann-json3-dev
- name: Install Meson, Ninja, and gcovr
run: |
python -m pip install --upgrade pip
python -m pip install meson ninja gcovr
- name: Show tool versions
run: |
"$CC" --version
"$CXX" --version
meson --version
ninja --version
gcovr --version
- name: Configure
run: |
meson setup build/debug \
--buildtype=debug \
-Dtest=true \
-Db_coverage=true \
-Dbenchmark=false
- name: Build
run: meson compile -C build/debug --verbose
- name: Run tests
run: meson test -C build/debug --verbose --print-errorlogs
- name: Generate coverage report
run: ninja -C build/debug coverage-xml --verbose
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v7
with:
files: build/debug/meson-logs/coverage.xml
disable_search: true
fail_ci_if_error: true
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Preserve Meson logs on failure
if: ${{ failure() }}
uses: actions/upload-artifact@v7
with:
name: meson-coverage-logs
path: build/debug/meson-logs/
if-no-files-found: warn
retention-days: 14