-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (59 loc) · 1.92 KB
/
test-pr.yaml
File metadata and controls
62 lines (59 loc) · 1.92 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
58
59
60
61
62
name: "CI - Test Templates"
on:
pull_request:
jobs:
detect-changes:
runs-on: ubuntu-latest
outputs:
templates: ${{ steps.filter.outputs.changes }}
typo3: ${{ steps.filter.outputs.typo3 }}
steps:
- uses: dorny/paths-filter@v4
id: filter
with:
filters: |
typo3: ./**/typo3/**
discover-variances:
needs: [detect-changes]
runs-on: ubuntu-latest
outputs:
template-matrix: ${{ steps.set-matrix.outputs.MATRIX }}
strategy:
matrix:
templates: ${{ fromJSON(needs.detect-changes.outputs.templates) }}
env:
TEMPLATE_MATRIX_FILE: ${{ github.workspace }}/.github/workflow-variances/${{ matrix.templates }}.yaml
steps:
- uses: actions/checkout@v6
- name: Check file existence
id: file_check
run: |
if [ -f "${{ env.TEMPLATE_MATRIX_FILE }}" ]; then
echo "check_result=true" >> $GITHUB_OUTPUT
else
echo "check_result=false" >> $GITHUB_OUTPUT
fi
- name: Enhance matrix for testing ${{ matrix.templates }}
id: set-matrix
run: |
if [ "${{ steps.file_check.outputs.check_result }}" = "true" ]; then
mtmp=$(yq -o=json ${{ env.TEMPLATE_MATRIX_FILE }} | jq -c '.[] += {"template" : "${{matrix.templates}}" }')
echo "MATRIX=$mtmp" | tee -a >> $GITHUB_OUTPUT
else
echo "MATRIX=${{ matrix.templates }}" >> $GITHUB_OUTPUT
fi
test:
needs: [discover-variances]
runs-on: ubuntu-latest
continue-on-error: true
strategy:
matrix:
include: ${{ fromJSON(needs.discover-variances.outputs.template-matrix) }}
steps:
- uses: actions/checkout@v6
- name: Smoke test for '${{ matrix.template }}'
id: smoke_test
uses: ./.github/actions/smoke-test
with:
template: "${{ matrix.template }}"
config: "${{ toJSON(matrix) }}"