-
-
Notifications
You must be signed in to change notification settings - Fork 70
95 lines (86 loc) · 2.93 KB
/
coverage.yml
File metadata and controls
95 lines (86 loc) · 2.93 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
name: Code Coverage
on:
push:
branches: [ main ]
paths-ignore:
- '**.md'
- 'docs/**'
- 'docs-site/**'
- '.github/FUNDING.yml'
- 'CITATION.cff'
- 'LICENSE'
- '.clang-format'
- '.clang-tidy'
- '.gitignore'
pull_request:
branches: [ main ]
types: [ opened, synchronize, reopened, ready_for_review ]
paths-ignore:
- '**.md'
- 'docs/**'
- 'docs-site/**'
- '.github/FUNDING.yml'
- 'CITATION.cff'
- 'LICENSE'
- '.clang-format'
- '.clang-tidy'
- '.gitignore'
workflow_dispatch: # Manual trigger
jobs:
coverage:
if: |
github.event_name != 'pull_request' ||
github.event.pull_request.draft == false
name: Coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install lcov
run: sudo apt-get update && sudo apt-get install -y lcov
- name: Configure with coverage flags
run: |
cmake -B build \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_C_COMPILER=gcc \
-DCMAKE_CXX_COMPILER=g++ \
-DCMAKE_C_FLAGS="--coverage -fprofile-arcs -ftest-coverage" \
-DCMAKE_CXX_FLAGS="--coverage -fprofile-arcs -ftest-coverage" \
-DCMAKE_EXE_LINKER_FLAGS="--coverage" \
-DUNIVERSAL_BUILD_CI=ON \
-DUNIVERSAL_BUILD_LINEAR_ALGEBRA_BLAS=ON \
-DUNIVERSAL_BUILD_LINEAR_ALGEBRA_DATA=ON \
-DUNIVERSAL_BUILD_MIXEDPRECISION_POP=ON
- name: Build
run: cmake --build build -j $(nproc)
- name: Run tests
run: ctest --test-dir build --output-on-failure
continue-on-error: true # Don't fail on test failures, still report coverage
- name: Generate coverage info
run: |
# Capture coverage, ignoring errors from modern GCC coverage format
lcov --capture --directory build --output-file coverage.info \
--ignore-errors gcov,gcov \
--ignore-errors negative,negative
# Remove system headers, test files, and applications from coverage
# Focus on include/sw/* which is the library code third parties rely on
lcov --remove coverage.info \
'/usr/*' \
'*/test/*' \
'*/static/*' \
'*/elastic/*' \
'*/applications/*' \
'*/tools/*' \
'*/education/*' \
'*/playground/*' \
'*/benchmark/*' \
'*/blas/serialization/datafile.hpp' \
--output-file coverage.info \
--ignore-errors unused,unused
lcov --list coverage.info --ignore-errors unused,unused || true
- name: Upload to Coveralls
uses: coverallsapp/github-action@v2
continue-on-error: true # Don't fail the workflow if coveralls.io is unreachable
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
file: coverage.info
format: lcov