remove Revisiting.R file; fix #7 #17
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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} |