-
-
Notifications
You must be signed in to change notification settings - Fork 0
133 lines (125 loc) · 4.48 KB
/
main.yml
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
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}