Skip to content

Commit 87dd173

Browse files
committed
Adds coverage CI
1 parent 867917b commit 87dd173

File tree

4 files changed

+64
-9
lines changed

4 files changed

+64
-9
lines changed

.github/workflows/test-coverage.yaml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
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@v3
19+
20+
- uses: r-lib/actions/setup-r@v2
21+
with:
22+
use-public-rspm: true
23+
24+
- uses: r-lib/actions/setup-r-dependencies@v2
25+
with:
26+
extra-packages: any::covr
27+
needs: coverage
28+
29+
- name: Test coverage
30+
run: |
31+
covr::codecov(
32+
quiet = FALSE,
33+
clean = FALSE,
34+
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
35+
)
36+
shell: Rscript {0}
37+
38+
- name: Show testthat output
39+
if: always()
40+
run: |
41+
## --------------------------------------------------------------------
42+
find ${{ runner.temp }}/package -name 'testthat.Rout*' -exec cat '{}' \; || true
43+
shell: bash
44+
45+
- name: Upload test results
46+
if: failure()
47+
uses: actions/upload-artifact@v3
48+
with:
49+
name: coverage-test-failures
50+
path: ${{ runner.temp }}/package

README.Rmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ toc <- function() {
4646

4747
<!-- badges: start -->
4848
[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://www.tidyverse.org/lifecycle/#experimental)
49-
[![Codecov test coverage](https://codecov.io/gh/edgararuiz/connections/branch/master/graph/badge.svg)](https://codecov.io/gh/edgararuiz/connections?branch=master)
5049
[![R-CMD-check](https://github.com/rstudio/connections/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/rstudio/connections/actions/workflows/R-CMD-check.yaml)
50+
[![Codecov test coverage](https://codecov.io/gh/rstudio/connections/branch/main/graph/badge.svg)](https://app.codecov.io/gh/rstudio/connections?branch=main)
5151
<!-- badges: end -->
5252

5353
- [Installation](#installation)

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77

88
[![Lifecycle:
99
experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://www.tidyverse.org/lifecycle/#experimental)
10-
[![Codecov test
11-
coverage](https://codecov.io/gh/edgararuiz/connections/branch/master/graph/badge.svg)](https://codecov.io/gh/edgararuiz/connections?branch=master)
1210
[![R-CMD-check](https://github.com/rstudio/connections/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/rstudio/connections/actions/workflows/R-CMD-check.yaml)
11+
[![Codecov test
12+
coverage](https://codecov.io/gh/rstudio/connections/branch/main/graph/badge.svg)](https://app.codecov.io/gh/rstudio/connections?branch=main)
1313
<!-- badges: end -->
1414

1515
- [Installation](#installation)
@@ -156,7 +156,7 @@ library(pins)
156156
board <- board_folder("~/pins")
157157

158158
connection_pin_write(board, con, name = "my_conn")
159-
#> Creating new version '20231213T212903Z-8d9ce'
159+
#> Creating new version '20231213T213608Z-8d9ce'
160160
#> Writing to pin 'my_conn'
161161
```
162162

@@ -211,7 +211,7 @@ the top results to the R Console. The `pin` records two things:
211211

212212
``` r
213213
connection_pin_write(board, db_mtcars, name = "avg_mpg")
214-
#> Creating new version '20231213T212903Z-5420a'
214+
#> Creating new version '20231213T213608Z-956aa'
215215
#> Writing to pin 'avg_mpg'
216216
```
217217

@@ -251,7 +251,7 @@ tbl_summary <- con %>%
251251

252252

253253
connection_pin_write(board, tbl_summary, name = "cyl_mpg")
254-
#> Creating new version '20231213T212903Z-491d6'
254+
#> Creating new version '20231213T213609Z-30482'
255255
#> Writing to pin 'cyl_mpg'
256256

257257
connection_close(con)

codecov.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ coverage:
44
status:
55
project:
66
default:
7-
target: 80%
8-
threshold: null
9-
patch: off
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)