-
Notifications
You must be signed in to change notification settings - Fork 32
55 lines (46 loc) · 1.56 KB
/
code-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
name: Compute code coverage for XCFun
on:
push:
branches:
- master
pull_request:
branches:
- master
env:
BUILD_TYPE: Debug
jobs:
build:
if: "!contains(github.event.head_commit.message, '[ci skip]')"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up environment
uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
auto-activate-base: false
activate-environment: xcfun-codecov
environment-file: .github/xcfun-codecov.yml
channel-priority: true
python-version: 3.6
- name: Configure
shell: bash -l {0}
run: |
cmake -H. -Bbuild -GNinja -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/Software/xcfun -DXCFUN_PYTHON_INTERFACE=OFF -DENABLE_CODE_COVERAGE=ON
- name: Build
shell: bash -l {0}
run: |
cmake --build build --config $BUILD_TYPE --target install -- -v -d stats
- name: Test XCFun and generate coverage report
shell: bash -l {0}
run: |
cd build
ctest -C $BUILD_TYPE --output-on-failure --verbose
lcov --version
lcov --directory . --capture --output-file coverage.info
lcov --remove coverage.info '/usr/*' --output-file coverage.info
lcov --remove coverage.info 'external/*' --output-file coverage.info
lcov --remove coverage.info 'test/*' --output-file coverage.info
lcov --list coverage.info
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1