-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (79 loc) · 2.25 KB
/
test.yaml
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
name: Template tests
on:
pull_request:
branches:
- main
paths:
- '{{ cookiecutter.slug }}/**'
- 'hooks/**'
jobs:
test-rendered:
runs-on: ubuntu-latest
strategy:
matrix:
add_lib:
- "n"
- "y"
add_pp:
- "n"
- "y"
add_golden:
- "n"
- "y"
add_matrix:
- "n"
- "y"
add_go_unit:
- "n"
- "y"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.9
- uses: Gr1N/setup-poetry@v9
- uses: actions/cache@v4
with:
path: ~/.cache/pypoetry/virtualenvs
key: ${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }}
- run: poetry install
- name: Run lint
run: make test -e cruft_extra_content='{"slug":"test-component","name":"test-component","add_lib":"${{matrix.add_lib}}","add_pp":"${{matrix.add_pp}}","add_golden":"${{matrix.add_golden}}","add_matrix":"${{matrix.add_matrix}}","add_go_unit":"${{matrix.add_go_unit}}"}'
- name: Run golden-diff
if: ${{ matrix.add_golden == 'y' }}
run: |
cd test-component
make golden-diff -e git_volume=
test-rendered-test-cases:
runs-on: ubuntu-latest
strategy:
matrix:
add_golden:
- "n"
- "y"
test_cases:
- "defaults"
- "defaults foo"
- "foo bar"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.9
- uses: Gr1N/setup-poetry@v9
- uses: actions/cache@v4
with:
path: ~/.cache/pypoetry/virtualenvs
key: ${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }}
- run: poetry install
- name: Run lints
run: |
make render -e cruft_extra_content='{"slug":"test-component","name":"test-component","add_golden":"${{matrix.add_golden}}","test_cases":"${{matrix.test_cases}}"}'
for t in ${{matrix.test_cases}}; do
test -f test-component/tests/${t}.yml
done
- name: Run golden-diff-all
if: ${{ matrix.add_golden == 'y' }}
run: |
cd test-component
make -j1 golden-diff-all -e git_volume=