-
Notifications
You must be signed in to change notification settings - Fork 2
57 lines (51 loc) · 1.61 KB
/
test-templates.yml
File metadata and controls
57 lines (51 loc) · 1.61 KB
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
# these tests do not check the outputted markdown
# they just test the jinja process does not generate any errors
name: Test jinja templates
on:
push:
pull_request:
branches:
- ["main"]
jobs:
create-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Checkout repo
uses: actions/checkout@v2
- id: set-matrix
run: echo "::set-output name=matrix::$(ls templates/*.md.j2 | jq -R -s -c 'split("\n")[:-1]')"
test-templates:
needs: create-matrix
runs-on: ubuntu-latest
strategy:
matrix:
templates: ${{ fromJson(needs.create-matrix.outputs.matrix) }}
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Test generating templates for online, morning
uses: cuchi/jinja2-action@v1.2.0
with:
template: ${{ matrix.templates }}
output_file: test-online-morn.out
variables: |
type=online
morning=true
date="test"
- name: Test generating templates for online, afternoon
uses: cuchi/jinja2-action@v1.2.0
with:
template: ${{ matrix.templates }}
output_file: test-online-aft.out
variables: |
type=online
date="test"
- name: Test generating templates for in person
uses: cuchi/jinja2-action@v1.2.0
with:
template: ${{ matrix.templates }}
output_file: test-in-person.out
variables: |
date="test"