Skip to content

Update r-cmd-check.yml #7

Update r-cmd-check.yml

Update r-cmd-check.yml #7

Workflow file for this run

name: R-testthat
on:
push:
branches: [main]
pull_request:
branches: [main] # Added to also run tests on PRs
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up R
uses: r-lib/actions/setup-r@v2
with:
r-version: 'release'
- name: Install additional dependencies
run: |
if [ -f "install_dependencies.R" ]; then
Rscript install_dependencies.R
else
echo "No install_dependencies.R found, skipping..."
fi
- name: Run tests with testthat
run: |
Rscript -e '
if (!require("testthat")) install.packages("testthat")
library(testthat)
results <- test_dir("tests/testthat", reporter = "summary")
if (!all(results)) stop("Some tests failed.")'