Skip to content

Check if parallel testing reduces check time in CI #4256

Check if parallel testing reduces check time in CI

Check if parallel testing reduces check time in CI #4256

# based on test-coverage, running testthat with options(warn = 2) to fail on test warnings
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
name: test-package
jobs:
test-package:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: |
local::.
any::purrr
- name: Run Tests
run: |
options(crayon.enabled = TRUE)
pkgload::load_all()
test_script_paths <- testthat::find_test_scripts("tests/testthat")
test_with_warning_as_error <- function(...) {
withr::local_options(list(warn = 2L))
testthat::test_file(...)
}
purrr::walk(test_script_paths, test_with_warning_as_error)
shell: Rscript {0}