Skip to content

Test template

Test template #128

Workflow file for this run

name: Test template
on:
schedule:
- cron: '0 0 * * 1'
workflow_dispatch:
inputs:
reset:
description: 'Reset cached markdown files'
required: false
default: false
type: boolean
varnish:
description: 'Varnish version to test'
required: true
default: 'carpentries/varnish'
sandpaper:
description: 'Sandpaper version to test'
required: true
default: 'carpentries/sandpaper'
pegboard:
description: 'Pegboard version to test'
required: true
default: 'carpentries/pegboard'
test-lesson:
description: 'An additional lesson to test'
required: false
default: 'carpentries-incubator/managing-computational-projects'
jobs:
check-template:
permissions:
checks: write
contents: write
pages: write
strategy:
fail-fast: false
matrix:
lesson: [carpentries-incubator/bioc-rnaseq, carpentries/instructor-training, datacarpentry/r-socialsci, carpentries/sandpaper-docs, datacarpentry/r-raster-vector-geospatial, datacarpentry/ecology-workshop, "${{ github.event.inputs.test-lesson }}"]
experimental: [false]
include:
- lesson: carpentries-incubator/bioc-rnaseq
lesson-name: BioConductor RNAseq
- lesson: carpentries/instructor-training
lesson-name: Instructor Training
- lesson: datacarpentry/r-socialsci
lesson-name: R for Social Scientists
- lesson: carpentries/sandpaper-docs
lesson-name: Workbench Documentation
- lesson: datacarpentry/r-raster-vector-geospatial
lesson-name: Raster and Vector Geospatial Data with R
experimental: true
- lesson: datacarpentry/ecology-workshop
lesson-name: Ecology Workshop
experimental: true
- lesson: "${{ github.event.inputs.test-lesson }}"
lesson-name: "USER TEST ${{ github.event.inputs.test-lesson }}"
experimental: true
name: ${{ matrix.lesson-name }}
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.experimental }}
defaults:
run:
shell: bash # forces 'Git for Windows' on Windows
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
RENV_PATHS_ROOT: ~/.local/share/renv/
steps:
- name: "Checkout this repo"
if: "${{ matrix.lesson != '' }}"
uses: actions/checkout@v3
- name: "Checkout Lesson"
if: "${{ matrix.lesson != '' }}"
uses: actions/checkout@v3
with:
repository: ${{ matrix.lesson }}
path: lesson
- name: "Copy and setup lesson"
if: "${{ matrix.lesson != '' }}"
run: |
cp -r lesson/* .
rm -rf lesson/
SANDY="${{ github.event.inputs.sandpaper }}"
VARNY="${{ github.event.inputs.varnish }}"
PEGGY="${{ github.event.inputs.pegboard }}"
if [[ -z ${SANDY} ]]; then
SANDY="carpentries/sandpaper"
fi
if [[ -z ${VARNY} ]]; then
VARNY="carpentries/varnish"
fi
if [[ -z ${PEGGY} ]]; then
PEGGY="carpentries/pegboard"
fi
sed -i "/sandpaper\:/d" config.yaml
sed -i "/varnish\:/d" config.yaml
sed -i "/pegboard\:/d" config.yaml
printf "sandpaper: ${SANDY}\nvarnish: ${VARNY}\npegboard: ${PEGGY}\n" >> config.yaml
- name: "Set up R"
if: "${{ matrix.lesson != '' }}"
uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true
install-r: false
- name: "Set up Pandoc"
if: "${{ matrix.lesson != '' }}"
uses: r-lib/actions/setup-pandoc@v2
- name: "Setup Lesson Engine"
if: "${{ matrix.lesson != '' }}"
uses: carpentries/actions/setup-sandpaper@main
with:
cache-version: ${{ matrix.lesson }}
- name: "Setup Package Cache"
if: "${{ matrix.lesson != '' }}"
uses: carpentries/actions/setup-lesson-deps@zkamvar-patch-1
with:
cache-version: ${{ matrix.lesson }}
- name: "Deploy Site"
if: "${{ matrix.lesson != '' }}"
run: |
reset <- "${{ github.event.inputs.reset }}" == "true"
sandpaper::package_cache_trigger(TRUE)
sandpaper:::ci_deploy(reset = reset,
md_branch = "${{ matrix.lesson }}/markdown",
site_branch = "${{ matrix.lesson }}/site"
)
shell: Rscript {0}