Replication of code chunks in vignette #30
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
# Workflow based on https://blog--simonpcouch.netlify.app/blog/r-github-actions-commit/ | |
name: Replication of code chunks in vignette | |
on: | |
schedule: | |
- cron: "0 9 1 * *" | |
workflow_dispatch: | |
jobs: | |
replicate-codechunks: | |
runs-on: ${{ matrix.config.os }} | |
name: ${{ matrix.config.os }} (R ${{ matrix.config.r }}; mlr3 ${{ matrix.config.mlr3 }}; DoubleML ${{ matrix.config.DoubleML }}) | |
strategy: | |
fail-fast: false | |
matrix: | |
config: | |
- {os: macos-11, r: 'release', mlr3: 'release', DoubleML: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"} | |
env: | |
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true | |
RSPM: ${{ matrix.config.rspm }} | |
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 2 | |
- uses: r-lib/actions/setup-r@v2 | |
with: | |
r-version: ${{ matrix.config.r }} | |
- uses: r-lib/actions/setup-pandoc@v2 | |
- name: Query dependencies | |
run: | | |
install.packages('remotes') | |
install.packages('sessioninfo') | |
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) | |
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version") | |
shell: Rscript {0} | |
- name: Cache R packages | |
if: runner.os != 'Windows' | |
uses: actions/cache@v4 | |
with: | |
path: ${{ env.R_LIBS_USER }} | |
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-${{ matrix.config.mlr3 }}-1-${{ hashFiles('.github/depends.Rds') }} | |
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-${{ matrix.config.mlr3 }}-1- | |
- name: Install dependencies | |
run: | | |
remotes::install_deps(dependencies = TRUE) | |
remotes::install_cran("rcmdcheck") | |
shell: Rscript {0} | |
- name: Run codechunks in vignette | |
run: | | |
source("Code/doubleml_codechunks.R") | |
shell: Rscript {0} | |
- name: Session info | |
run: | | |
options(width = 100) | |
pkgs <- installed.packages()[, "Package"] | |
sessioninfo::session_info(pkgs, include_base = TRUE) | |
shell: Rscript {0} |