Skip to content
This repository was archived by the owner on Feb 11, 2024. It is now read-only.

Commit adb3f88

Browse files
authored
Add covr (#51)
1 parent b12f4d2 commit adb3f88

File tree

4 files changed

+73
-0
lines changed

4 files changed

+73
-0
lines changed

.Rbuildignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@
66
^docs$
77
^pkgdown$
88
^\.github$
9+
^.editorconfig$
10+
^.codecov.yml$

.codecov.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
coverage:
2+
status:
3+
patch: off

.editorconfig

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
root = true
2+
3+
4+
[*]
5+
charset = utf8
6+
end_of_line = lf
7+
insert_final_newline = true
8+
indent_style = space
9+
10+
11+
[*.{r,R, rmd, Rmd}]
12+
indent_size = 4
13+
trim_trailing_whitespace = true
14+
15+
[Makefile]
16+
indent_style = tab

.github/workflows/test-coverage.yaml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
2+
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
3+
on:
4+
push:
5+
branches:
6+
- v*
7+
pull_request:
8+
branches:
9+
- v*
10+
11+
name: test-coverage
12+
13+
jobs:
14+
test-coverage:
15+
runs-on: ubuntu-latest
16+
env:
17+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
18+
19+
steps:
20+
- uses: actions/checkout@v3
21+
22+
- uses: r-lib/actions/setup-r@v2
23+
with:
24+
use-public-rspm: true
25+
26+
- uses: r-lib/actions/setup-r-dependencies@v2
27+
with:
28+
extra-packages: any::covr
29+
needs: coverage
30+
31+
- name: Test coverage
32+
run: |
33+
covr::codecov(
34+
quiet = FALSE,
35+
clean = FALSE,
36+
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
37+
)
38+
shell: Rscript {0}
39+
40+
- name: Show testthat output
41+
if: always()
42+
run: |
43+
## --------------------------------------------------------------------
44+
find ${{ runner.temp }}/package -name 'testthat.Rout*' -exec cat '{}' \; || true
45+
shell: bash
46+
47+
- name: Upload test results
48+
if: failure()
49+
uses: actions/upload-artifact@v3
50+
with:
51+
name: coverage-test-failures
52+
path: ${{ runner.temp }}/package

0 commit comments

Comments
 (0)