Skip to content

Commit

Permalink
Automated file update from pkg-skeleton
Browse files Browse the repository at this point in the history
  • Loading branch information
pkg-skeleton Deploy Bot committed Apr 23, 2023
1 parent 2f1d77e commit 819d31a
Showing 1 changed file with 28 additions and 26 deletions.
54 changes: 28 additions & 26 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,48 +28,50 @@ name: Test coverage

jobs:
test-coverage:
runs-on: macOS-latest

runs-on: ubuntu-latest
env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v3

- uses: r-lib/actions/setup-r@v2

- uses: r-lib/actions/setup-pandoc@v2

- name: Query dependencies
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
shell: Rscript {0}

- name: Cache R packages
uses: actions/cache@v1
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
use-public-rspm: true
extra-repositories: "https://r-hyperspec.github.io/pkg-repo/"

- name: Install dependencies
run: |
install.packages(c("remotes", "devtools"))
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("covr")
shell: Rscript {0}
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::covr, any::devtools, any::roxygen2
needs: coverage

- name: Roxygenize
shell: Rscript {0}
run: |
# Vignettes are not needed for coverage tests
roclets <- roxygen2::load_options()$roclets
roclets <- roclets[!roclets %in% "vignette"]
devtools::document(roclets = roclets)
shell: Rscript {0}
- name: Test coverage
run: covr::codecov()
shell: Rscript {0}
run: |
covr::codecov(
quiet = FALSE,
clean = FALSE,
install_path = file.path(Sys.getenv("RUNNER_TEMP"), "package")
)
- name: Show testthat output
shell: bash
if: always()
run: |
## --------------------------------------------------------------------
find ${{ runner.temp }}/package -name 'testthat.Rout*' -exec cat '{}' \; || true
- name: Upload test results
if: failure()
uses: actions/upload-artifact@v3
with:
name: coverage-test-failures
path: ${{ runner.temp }}/package

0 comments on commit 819d31a

Please sign in to comment.