code coverage #64
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
name: code coverage | |
on: | |
push: | |
branches: [ "dev" ] | |
pull_request: | |
types: closed | |
branches: [ "main" ] | |
schedule: | |
- cron: '16 20 * * 2' | |
jobs: | |
test-coverage: | |
name: Code coverage | |
runs-on: ubuntu-latest | |
env: | |
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- name: Checkout repo for workflow access | |
uses: actions/checkout@v3 | |
- name: Set up R environment | |
uses: r-lib/actions/setup-r@v2 | |
with: | |
use-public-rspm: true | |
- name: Set up dependencies (general) | |
uses: r-lib/actions/setup-r-dependencies@v2 | |
env: | |
_R_CHECK_FORCE_SUGGESTS: false | |
_R_CHECK_RD_XREFS: false | |
with: | |
dependencies: '"hard"' # do not use suggested dependencies | |
extra-packages: any::rcmdcheck, any::testthat, any::rlang, any::R.utils, any::remotes, any::covr | |
needs: coverage | |
- name: Set up dependencies (GiottoData) | |
run: | | |
suppressWarnings({ | |
remotes::install_github('drieslab/GiottoData', build = FALSE) | |
}) | |
shell: Rscript {0} | |
- name: Generate coverage report | |
run: | | |
covr::codecov( | |
quiet = FALSE, | |
clean = FALSE, | |
install_path = file.path(Sys.getenv("RUNNER_TEMP"), "package") | |
) | |
shell: Rscript {0} | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
token: 41bc58b5-18c1-447a-9176-0e35a9dec15a | |
fail_ci_if_error: false | |
flags: unittests | |
verbose: true |