Skip to content

test coverage

test coverage #4

Workflow file for this run

name: test coverage
on:
workflow_dispatch:
jobs:
test-coverage:
runs-on: ubuntu-latest
# env:
# RENV_CONFIG_PAK_ENABLED: true
# with above uncommented, the workflow fails with the following error:
# Error in remote(function(...) get("pkg_install_make_plan", asNamespace("pak"))(...),
defaults:
run:
working-directory: phenoRankeR
steps:
- uses: actions/checkout@v4
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y libgit2-dev libsqliteodbc
- name: Create custom odbcinst.ini in a user-accessible directory
run: |
echo "[SQLite]" >> $HOME/odbcinst.ini
echo "Driver=/usr/lib/x86_64-linux-gnu/odbc/libsqlite3odbc.so" >> $HOME/odbcinst.ini
- name: Install R
uses: r-lib/actions/setup-r@v2
with:
r-version: "4.3.3"
use-public-rspm: true
- name: Install R packages
uses: r-lib/actions/setup-renv@v2
with:
cache-version: 1
working-directory: phenoRankeR
env:
RENV_CONFIG_REPOS_OVERRIDE: ${{ env.RSPM }}
- name: Test coverage and upload reports to Codecov
shell: Rscript {0}
run: |
covr::codecov(
quiet = FALSE,
clean = FALSE,
install_path = file.path(Sys.getenv("RUNNER_TEMP"), "package")
token = Sys.getenv("CODECOV_TOKEN")
)
env:
ODBCSYSINI: /home/runner
DB_DRIVER: SQLite
DB_NAME: ":memory:"
CODECOV_TOKEN: ${{ secrets.CODECOV }}
- 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@v4
with:
name: coverage-test-failures
path: ${{ runner.temp }}/package