forked from Azure/aks-app-routing-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (75 loc) · 2.49 KB
/
e2e.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
81
82
83
84
name: E2E Test Matrix
on:
workflow_call:
inputs:
checkout_ref:
type: string
required: true
status_ref:
type: string
required: true
env:
status-name: e2e-tests
jobs:
start_status:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
ref: ${{ inputs.checkout_ref }}
- uses: ./.github/actions/start-status
with:
name: ${{ env.status-name }}
ref: ${{ inputs.status_ref }}
plan_infra:
needs: [start_status]
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.matrix.outputs.matrix }}
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
ref: ${{ inputs.checkout_ref }}
- uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
with:
go-version: '~1.22'
cache-dependency-path: "**/*.sum"
- run: |
cd testing/e2e
go run ./main.go matrix
id: matrix
test:
needs: [plan_infra]
strategy:
fail-fast: false # this is false because we usually want to retry at individual infra level if there is a failure and it helps to see if only one infra is failing
matrix: ${{ fromJson(needs.plan_infra.outputs.matrix) }}
uses: ./.github/workflows/provision-test.yaml
with:
name: ${{ matrix.name }}
ref: ${{ inputs.checkout_ref }}
secrets: inherit
end_status:
if: always()
needs: [test]
strategy:
fail-fast: false # we want to always report the status
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
ref: ${{ inputs.checkout_ref }}
# https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/accessing-contextual-information-about-workflow-runs#steps-context
# it would be preferable to check the inverse of the if below by comparing solely to 'success' but there's no way to do that with a wildcard and the current
# set of GitHub workflow functions
- if: >-
${{
contains(needs.*.result, 'failure') ||
contains(needs.*.result, 'cancelled') ||
contains(needs.*.result, 'skipped')
}}
run: exit 1 # will make status show as failure
- if: always()
uses: ./.github/actions/end-status
with:
name: ${{ env.status-name }}
ref: ${{ inputs.status_ref }}