-
Notifications
You must be signed in to change notification settings - Fork 1
56 lines (47 loc) · 1.21 KB
/
tests.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
name: Tests
on:
push:
branches:
- main
pull_request:
jobs:
setup:
name: "Setup environment and determine templates"
runs-on: ubuntu-latest
outputs:
template_dirs: ${{ steps.get-dirs.outputs.dirs }}
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Get list of test directories
id: get-dirs
run: echo "dirs=$(ls -d test/*/ | jq -R -s -c 'split("\n")[:-1] | map(split("/")[1])')" >> $GITHUB_OUTPUT
lint:
name: "Run linting"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Run linting
run: test/lint.sh
test-templates:
name: "Run template tests"
needs: setup
runs-on: ubuntu-latest
strategy:
matrix:
template: ${{ fromJson(needs.setup.outputs.template_dirs) }}
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Run test for ${{ matrix.template }}
run: test/${{ matrix.template }}/test.sh