-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (48 loc) · 1.39 KB
/
check-exercise.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: check exercise
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
workflow_dispatch:
jobs:
check-exercise:
runs-on: ubuntu-latest
container: rocker/tidyverse:4.4.1
steps:
- uses: actions/checkout@v4
- name: Install R packages
run: |
install.packages(c("rmarkdown", "openxlsx2"))
shell: Rscript {0}
- name: Check that R file/s exist/s
run: |
testthat::test_that("R file exists",
testthat::expect_true(
length(list.files(pattern = "\\.R$|\\.r$")) > 0
)
)
shell: Rscript {0}
- name: Check that required dataset is available
run: |
testthat::test_that(".xlsx file exists",
testthat::expect_true(
length(list.files(path = "data", pattern = "\\.xlsx$")) > 0
)
)
shell: Rscript {0}
- name: Check that R file runs without errors
run: |
lapply(
X = list.files(pattern = "\\.R$|\\.r$"),
FUN = source
)
shell: Rscript {0}
# - name: Check that Rmd file runs without errors
# run: |
# rmarkdown::render(
# "reports/cyclones.Rmd",
# output_dir = "outputs",
# knit_root_dir = here::here()
# )
# shell: Rscript {0}