Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
GitHub workflow to render all Rmd files in a GitHub repo, e.g. for testing student assignments
# from https://github.com/cboettig/compendium/blob/master/.github/workflows/main.yml
on: [push]
name: render all R Markdown documents
jobs:
render:
name: render all R Markdown documents
runs-on: macOS-latest
steps:
- uses: actions/checkout@v1
- uses: r-lib/actions/setup-r@v1
- uses: r-lib/actions/setup-pandoc@v1
- uses: r-lib/actions/setup-tinytex@master
- name: Install known depedencies
run: |
Rscript -e "install.packages(c('bookdown', 'tidyverse', 'rmarkdown', 'knitr', 'devtools', 'here'))"
Rscript -e "devtools::install_github('ThinkR-open/attachment')"
- name: Install unknown depedencies
run: |
Rscript -e "attachment::install_if_missing(attachment::att_from_rmds(path = '.'))"
- name: render all R Markdown documents
run: |
Rscript -e "lapply(list.files(pattern = 'Rmd|rmd', recursive = TRUE), rmarkdown::render)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment