Skip to content

ci: change test env build triggering method #259

ci: change test env build triggering method

ci: change test env build triggering method #259

Workflow file for this run

name: code coverage
on:
push:
branches: [ "dev" ]
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@v4
with:
ref: dev
- 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
install-pandoc: false
extra-packages: |
any::rcmdcheck
any::testthat
any::covr
any::RColorBrewer
any::reticulate
any::Matrix
any::future
any::BiocParallel
any::remotes
needs: coverage
- uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: setup r-reticulate venv
shell: Rscript {0}
run: |
path_to_python <- reticulate::virtualenv_create(
envname = "r-reticulate",
python = Sys.which("python"), # placed on PATH by the setup-python action
packages = c(
"scipy"
)
)
writeLines(sprintf("RETICULATE_PYTHON=%s", path_to_python),
Sys.getenv("GITHUB_ENV"))
- 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@v4
with:
token: d7b84f7b-f2a9-46ed-9ef8-6165425e259f
fail_ci_if_error: false
flags: unittests
verbose: true