-
Notifications
You must be signed in to change notification settings - Fork 9
77 lines (66 loc) · 1.9 KB
/
get-gtest-codecov.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# Get GoogleTest code coverage
name: get-gtest-codecov
# on specifies the build triggers. See more info at https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows
on:
workflow_dispatch:
push:
branches:
- main
paths-ignore:
- .devcontainer
- .github
- 'LICENSE'
- 'README.md'
- 'CONTRIBUTING.md'
- 'Rbuildignore'
- '.gitignore'
- 'man'
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v3
- name: Install Ninja
run: sudo apt-get install ninja-build
- uses: r-lib/actions/setup-r@v2
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::remotes
- name: install local version of FIMS
run: remotes::install_local(upgrade= "always", force = TRUE)
shell: Rscript {0}
- name: setup for gtest
run: FIMS:::setup_gtest()
shell: Rscript {0}
#note: the following configure, build and test steps could instead
# be run from r using FIMS::setup_and_run_gtest()
- name: Configure
# Do not run -DBUILD_DOC=OFF locally. Only run cmake -S . -B build -G Ninja locally.
run: |
cmake -S . -B build -DBUILD_DOC=OFF -G Ninja
- name: Build
run: |
cmake --build build --parallel 16
- name: Test
run: |
ctest --test-dir build --parallel 16
- name: Install gcovr
run: |
pip install gcovr
- name: Run gcovr
run: |
gcovr --exclude tests/ --cobertura coverage.xml
- name: save coverage report
uses: actions/upload-artifact@v3
with:
name: coverage.xml
path: coverage.xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
files: coverage.xml