Skip to content

Commit f2d3403

Browse files
authored
Merge pull request #2 from miyamot0/testing
Add in testing/automated coverage checks
2 parents b48c575 + 90f2cf0 commit f2d3403

2 files changed

Lines changed: 9 additions & 24 deletions

File tree

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
1+
# Workflow derived from https://github.com/r-lib/actions/tree/master/examples
22
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
33
on:
44
push:
55
branches: [main, master]
66
pull_request:
7+
branches: [main, master]
78

8-
name: test-coverage.yaml
9-
10-
permissions: read-all
9+
name: test-coverage
1110

1211
jobs:
1312
test-coverage:
@@ -16,47 +15,36 @@ jobs:
1615
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
1716

1817
steps:
19-
- uses: actions/checkout@v4
18+
- uses: actions/checkout@v3
2019

2120
- uses: r-lib/actions/setup-r@v2
2221
with:
2322
use-public-rspm: true
2423

2524
- uses: r-lib/actions/setup-r-dependencies@v2
2625
with:
27-
extra-packages: any::covr, any::xml2
26+
extra-packages: any::covr
2827
needs: coverage
2928

3029
- name: Test coverage
3130
run: |
32-
cov <- covr::package_coverage(
31+
covr::codecov(
3332
quiet = FALSE,
3433
clean = FALSE,
35-
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
34+
install_path = file.path(Sys.getenv("RUNNER_TEMP"), "package")
3635
)
37-
print(cov)
38-
covr::to_cobertura(cov)
3936
shell: Rscript {0}
4037

41-
- uses: codecov/codecov-action@v5
42-
with:
43-
# Fail if error if not on PR, or if on PR and token is given
44-
fail_ci_if_error: ${{ github.event_name != 'pull_request' || secrets.CODECOV_TOKEN }}
45-
files: ./cobertura.xml
46-
plugins: noop
47-
disable_search: true
48-
token: ${{ secrets.CODECOV_TOKEN }}
49-
5038
- name: Show testthat output
5139
if: always()
5240
run: |
5341
## --------------------------------------------------------------------
54-
find '${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; || true
42+
find ${{ runner.temp }}/package -name 'testthat.Rout*' -exec cat '{}' \; || true
5543
shell: bash
5644

5745
- name: Upload test results
5846
if: failure()
59-
uses: actions/upload-artifact@v4
47+
uses: actions/upload-artifact@v3
6048
with:
6149
name: coverage-test-failures
6250
path: ${{ runner.temp }}/package

README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@
22

33
[![License: MIT](https://img.shields.io/badge/License-GPL2-blue.svg)](https://opensource.org/licenses/gpl-2-0)
44
[![R package](https://img.shields.io/badge/R-package-blue.svg)](https://www.r-project.org/)
5-
<!-- badges: start -->
65
[![Codecov test coverage](https://codecov.io/gh/miyamot0/ggsced/graph/badge.svg)](https://app.codecov.io/gh/miyamot0/ggsced)
7-
<!-- badges: end -->
8-
96

107
**Utilities and helpers for Single-Case Experimental Design (SCED) using ggplot2**
118

0 commit comments

Comments
 (0)