-
Notifications
You must be signed in to change notification settings - Fork 1.8k
40 lines (40 loc) · 1.31 KB
/
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
name: Coverage report
on:
push:
branches:
- master
pull_request:
jobs:
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup
run: |
sudo apt update
sudo apt install -y lcov libboost-dev
- name: Compile
run: |
./autogen.sh
./configure --disable-shared CXXFLAGS='-O1 -fprofile-arcs -ftest-coverage' LDFLAGS='-lgcov'
make -j 2
- name: Capture baseline
run: |
mkdir -p coverage tmp
lcov --no-external --capture --initial --directory . --output-file ./tmp/lcov_base.info
- name: Run tests
run: |
./test-suite/quantlib-test-suite --log_level=message
- name: Run examples
run: |
make -C Examples check-examples
- name: Capture coverage
run: |
lcov --no-external --capture --directory . --output-file ./tmp/lcov_run.info
lcov --add-tracefile ./tmp/lcov_base.info --add-tracefile ./tmp/lcov_run.info --output-file ./tmp/lcov_total.info
lcov --remove ./tmp/lcov_total.info "$PWD/Examples/*" "$PWD/test-suite/*" --output-file ./coverage/lcov.info
- name: Upload coverage to Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./coverage/lcov.info