-
Notifications
You must be signed in to change notification settings - Fork 33
58 lines (48 loc) · 1.36 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
on: ["push", "pull_request"]
name: Test Coverage
jobs:
run-coverage:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install lcov
run: |
sudo apt-get update
sudo apt-get install -y lcov
- name: Install Boost
shell: bash
run: |
sudo apt-get install libboost-all-dev
- name: Configure and build ADOL-C
run: |
mkdir build
cd build
cmake \
-DCMAKE_CXX_COMPILER=g++ \
-DCMAKE_C_COMPILER=gcc \
-DCMAKE_BUILD_TYPE=Debug \
-DBUILD_TESTS_WITH_COV=ON \
-S .. \
-B .
cmake --build .
- name: Run Tests
run: |
set +e # otherwise the coverage report fails if ctest finds errors
ctest --test-dir build/
exit 0
# Capture coverage data
- name: Generate coverage report
run: |
cd build
lcov --capture --directory . --output-file coverage.info
lcov --remove coverage.info '/usr/*' 'boost/*' 'c++11/*' --output-file coverage.info
lcov --list coverage.info
# Upload coverage report to Codecov
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
files: build/coverage.info
token: ${{ secrets.CODECOV_TOKEN }}
flags: unittests
name: code-coverage-report