Skip to content

Commit

Permalink
add test-coverage.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
LiNk-NY committed Jan 24, 2024
1 parent 3278ae3 commit cfb52b9
Showing 1 changed file with 69 additions and 0 deletions.
69 changes: 69 additions & 0 deletions .github/workflows/test-coverage.yaml
@@ -0,0 +1,69 @@
# 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: devel

name: test-coverage

jobs:
test-coverage:
runs-on: ubuntu-22.04
container: bioconductor/bioconductor_docker:devel
env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
CRAN: https://packagemanager.posit.co/cran/__linux__/jammy/latest
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- name: Checkout Repository
- uses: actions/checkout@v3

- name: Query dependencies
run: |
BiocManager::install(c("remotes", "covr"))
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
shell: Rscript {0}

- name: Cache R packages
if: runner.os != 'Windows'
uses: actions/cache@v1
with:
path: /usr/local/lib/R/site-library
key: ${{ runner.os }}-r-1-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ runner.os }}-r-1-

- name: Install Dependencies
run: |
remotes::install_deps(dependencies = TRUE, repos = BiocManager::repositories())
BiocManager::install("rcmdcheck", ask = FALSE, update = TRUE)
shell: Rscript {0}

- name: Check Package
env:
_R_CHECK_CRAN_INCOMING_REMOTE_: false
run: rcmdcheck::rcmdcheck(args = c("--no-manual"), error_on = "error", check_dir = "check")
shell: Rscript {0}

- name: Test coverage
run: |
covr::codecov(
quiet = FALSE,
clean = FALSE,
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
)
shell: Rscript {0}

- name: Show testthat output
if: always()
run: |
## --------------------------------------------------------------------
find ${{ runner.temp }}/package -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash

- name: Upload test results
if: failure()
uses: actions/upload-artifact@v3
with:
name: coverage-test-failures
path: ${{ runner.temp }}/package

0 comments on commit cfb52b9

Please sign in to comment.