-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d14da0c
commit 51a69f0
Showing
1 changed file
with
38 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,61 @@ | ||
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples | ||
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help | ||
on: | ||
push: | ||
branches: [main, master] | ||
branches: | ||
- main | ||
- master | ||
pull_request: | ||
branches: [main, master] | ||
branches: | ||
- main | ||
- master | ||
|
||
name: test-coverage | ||
|
||
jobs: | ||
test-coverage: | ||
runs-on: ubuntu-latest | ||
runs-on: ubuntu-22.04 | ||
env: | ||
RSPM: https://packagemanager.rstudio.com/cran/__linux__/jammy/latest | ||
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: r-lib/actions/setup-r@v2 | ||
id: install-r | ||
|
||
- name: Java setup | ||
uses: actions/setup-java@v1 | ||
with: | ||
use-public-rspm: true | ||
java-version: '11' | ||
java-package: jdk | ||
|
||
- uses: r-lib/actions/setup-r-dependencies@v2 | ||
- name: Install pak and query dependencies | ||
run: | | ||
install.packages("pak", repos = "https://r-lib.github.io/p/pak/dev/") | ||
saveRDS(pak::pkg_deps("local::.", dependencies = TRUE), ".github/r-depends.rds") | ||
shell: Rscript {0} | ||
|
||
- name: Restore R package cache | ||
uses: actions/cache@v2 | ||
with: | ||
extra-packages: any::covr | ||
needs: coverage | ||
path: | | ||
${{ env.R_LIBS_USER }}/* | ||
!${{ env.R_LIBS_USER }}/pak | ||
key: ubuntu-22.04-${{ steps.install-r.outputs.installed-r-version }}-1-${{ hashFiles('.github/r-depends.rds') }} | ||
restore-keys: ubuntu-22.04-${{ steps.install-r.outputs.installed-r-version }}-1- | ||
|
||
- name: Test coverage | ||
- name: Install system dependencies | ||
run: | | ||
covr::codecov( | ||
quiet = FALSE, | ||
clean = FALSE, | ||
install_path = file.path(Sys.getenv("RUNNER_TEMP"), "package") | ||
) | ||
pak::local_system_requirements(execute = TRUE) | ||
pak::pkg_system_requirements("covr", execute = TRUE) | ||
shell: Rscript {0} | ||
|
||
- name: Show testthat output | ||
if: always() | ||
- name: Install dependencies | ||
run: | | ||
## -------------------------------------------------------------------- | ||
find ${{ runner.temp }}/package -name 'testthat.Rout*' -exec cat '{}' \; || true | ||
shell: bash | ||
pak::local_install_dev_deps(upgrade = TRUE) | ||
pak::pkg_install("covr") | ||
shell: Rscript {0} | ||
|
||
- name: Upload test results | ||
if: failure() | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: coverage-test-failures | ||
path: ${{ runner.temp }}/package | ||
- name: Test coverage | ||
run: covr::codecov(quiet = FALSE) | ||
shell: Rscript {0} |