Skip to content

Commit

Permalink
added test-coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
IvoLeist committed Mar 22, 2024
1 parent 775fff1 commit 7b18f09
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/R-CMD-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
r-version: "4.3.3"
use-public-rspm: true

- name: Install dependencies
- name: Install R packages
uses: r-lib/actions/setup-renv@v2
with:
cache-version: 1
Expand Down
68 changes: 68 additions & 0 deletions .github/workflows/test-coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
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"))(...),

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
run: |
covr::codecov(
quiet = FALSE,
clean = FALSE,
install_path = file.path(Sys.getenv("RUNNER_TEMP"), "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 7b18f09

Please sign in to comment.