Skip to content

Commit ea704b8

Browse files
committed
Add coverage workflow
1 parent 58727a4 commit ea704b8

File tree

4 files changed

+71
-0
lines changed

4 files changed

+71
-0
lines changed

.Rbuildignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@
1212
^vignettes/*_files$
1313
^revdep$
1414
^cran-comments\.md$
15+
^codecov\.yml$
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
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: [main, master]
6+
pull_request:
7+
branches: [main, master]
8+
9+
name: test-coverage
10+
11+
jobs:
12+
test-coverage:
13+
runs-on: ubuntu-latest
14+
env:
15+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- uses: quarto-dev/quarto-actions/setup@v2
21+
with:
22+
version: ${{ matrix.config.quarto || 'release' }}
23+
tinytex: true
24+
25+
- uses: r-lib/actions/setup-r@v2
26+
with:
27+
use-public-rspm: true
28+
29+
- uses: r-lib/actions/setup-r-dependencies@v2
30+
with:
31+
extra-packages: any::covr
32+
needs: coverage
33+
34+
- name: Test coverage
35+
run: |
36+
covr::codecov(
37+
quiet = FALSE,
38+
clean = FALSE,
39+
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
40+
)
41+
shell: Rscript {0}
42+
43+
- name: Show testthat output
44+
if: always()
45+
run: |
46+
## --------------------------------------------------------------------
47+
find ${{ runner.temp }}/package -name 'testthat.Rout*' -exec cat '{}' \; || true
48+
shell: bash
49+
50+
- name: Upload test results
51+
if: failure()
52+
uses: actions/upload-artifact@v4
53+
with:
54+
name: coverage-test-failures
55+
path: ${{ runner.temp }}/package

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<!-- badges: start -->
44
[![CRAN status](https://www.r-pkg.org/badges/version/quarto)](https://CRAN.R-project.org/package=quarto)
55
[![R-CMD-check](https://github.com/quarto-dev/quarto-r/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/quarto-dev/quarto-r/actions/workflows/R-CMD-check.yaml)
6+
[![Codecov test coverage](https://codecov.io/gh/quarto-dev/quarto-r/branch/main/graph/badge.svg)](https://app.codecov.io/gh/quarto-dev/quarto-r?branch=main)
67
<!-- badges: end -->
78

89
[Quarto](https://quarto.org) is an open-source scientific and technical publishing system built on [Pandoc](https://pandoc.org).

codecov.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
comment: false
2+
3+
coverage:
4+
status:
5+
project:
6+
default:
7+
target: auto
8+
threshold: 1%
9+
informational: true
10+
patch:
11+
default:
12+
target: auto
13+
threshold: 1%
14+
informational: true

0 commit comments

Comments
 (0)