-
Notifications
You must be signed in to change notification settings - Fork 0
32 lines (28 loc) · 1.02 KB
/
testthat.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
on:
# push:
# branches: main
# paths: 'data/**'
# pull_request:
# branches: main
# paths: 'data/**'
workflow_dispatch
name: 03-Run validation tests
#' This starts off identically to validate.yaml but instead of running an R
#' script with tests in it directly, it runs testthat::test_dir() to run tests.
#' There is a much more complex example of testing data like this here:
#' https://github.com/weecology/PortalData/tree/main/testthat
jobs:
validate:
runs-on: ubuntu-latest
env:
RENV_CONFIG_PAK_ENABLED: TRUE #use the `pak` package for installing R packages—it automatically detects and install system dependencies on ubuntu
steps:
- uses: actions/checkout@v4
- name: Setup R
uses: r-lib/actions/setup-r@v2
with:
r-version: "renv" #use the same version of R recorded in renv.lock
- name: Install R packages
uses: r-lib/actions/setup-renv@v2 #uses `renv::restore()`
- name: Run tests
run: Rscript testthat.R