-
Notifications
You must be signed in to change notification settings - Fork 45
186 lines (147 loc) · 4.85 KB
/
e2e-tests-scheduled.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
# Runs the E2E tests against a set of branches every day.
#
# Note that the workflow file is always used from main, even when running against a different branch.
#
# DEVNOTE:
#
# Keep `jobs` in sync with e2e-tests-manual.yaml. Differences are:
#
# - manual has `on: workflow_dispatch` while scheduled has `on: schedule`
# - manual uses `github.event.inputs` for the branch while scheduled uses `strategy.matrix`
name: 'e2e-tests-scheduled'
on:
schedule:
- cron: '0 1 * * *'
jobs:
suite-setup:
if: "github.repository == 'Azure/iot-identity-service'"
runs-on:
- self-hosted
- 1ES.Pool=iot-identity-1es-hosted-linux-amd64
- 1ES.ImageOverride=agent-aziotedge-ubuntu-22.04-msmoby
strategy:
fail-fast: false
# The end-to-end tests run against all shipping/supported versions of the service. Usually
# only one version is supported at any given time, but when a new major/minor version is
# released there's a six-month transition period where both the new and previous versions
# are supported. The main branch is the latest version (e.g., 1.n), and the release/1.x branch
# is the previous version (where x == n-1).
matrix:
branch:
- 'main'
# - 'release/1.4'
max-parallel: 10
steps:
- uses: 'actions/checkout@v3'
with:
ref: "${{ matrix.branch }}"
- name: 'Run'
run: |
timeout 20m ./ci/e2e-tests/suite-setup.sh
env:
BRANCH: "${{ matrix.branch }}"
AZURE_RESOURCE_GROUP_NAME: "${{ secrets.AZURE_RESOURCE_GROUP_NAME }}"
AZURE_LOCATION: "${{ secrets.AZURE_LOCATION }}"
test-run:
if: "github.repository == 'Azure/iot-identity-service'"
needs: 'suite-setup'
runs-on:
- self-hosted
- 1ES.Pool=iot-identity-1es-hosted-linux-amd64
- 1ES.ImageOverride=agent-aziotedge-ubuntu-22.04-msmoby
strategy:
fail-fast: false
matrix:
branch:
- 'main'
# - 'release/1.4'
os:
- 'debian:11'
- 'debian:12'
# EL8 VMs spontaneously lose ssh after installing updates. Disable it for now.
# - 'platform:el8'
- 'platform:el9'
- 'ubuntu:20.04'
- 'ubuntu:22.04'
- 'ubuntu:24.04'
test_name:
- 'manual-symmetric-key'
- 'manual-x509'
- 'dps-symmetric-key'
- 'dps-x509'
max-parallel: 10
steps:
- uses: 'actions/checkout@v3'
with:
ref: "${{ matrix.branch }}"
- name: 'Run'
run: |
timeout 30m ./ci/e2e-tests/test-run.sh '${{ matrix.test_name }}' &&
timeout 5m ./ci/e2e-tests/test-cleanup.sh '${{ matrix.test_name }}'
env:
BRANCH: "${{ matrix.branch }}"
OS: "${{ matrix.os }}"
AZURE_RESOURCE_GROUP_NAME: "${{ secrets.AZURE_RESOURCE_GROUP_NAME }}"
AZURE_LOCATION: "${{ secrets.AZURE_LOCATION }}"
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
- name: 'Clean up on failure'
run: |
timeout 5m ./ci/e2e-tests/test-cleanup.sh ${{ matrix.test_name }}
exit 1 # Force the workflow to fail even if this step succeeds
if: "${{ failure() }}"
env:
BRANCH: "${{ matrix.branch }}"
OS: "${{ matrix.os }}"
AZURE_RESOURCE_GROUP_NAME: "${{ secrets.AZURE_RESOURCE_GROUP_NAME }}"
AZURE_LOCATION: "${{ secrets.AZURE_LOCATION }}"
suite-cleanup:
if: "${{ github.repository == 'Azure/iot-identity-service' && success() }}"
needs: 'test-run'
runs-on:
- self-hosted
- 1ES.Pool=iot-identity-1es-hosted-linux-amd64
- 1ES.ImageOverride=agent-aziotedge-ubuntu-22.04-msmoby
strategy:
fail-fast: false
matrix:
branch:
- 'main'
# - 'release/1.4'
max-parallel: 10
steps:
- uses: 'actions/checkout@v3'
with:
ref: "${{ matrix.branch }}"
- name: 'Clean up'
run: |
timeout 5m ./ci/e2e-tests/suite-cleanup.sh
env:
BRANCH: "${{ matrix.branch }}"
AZURE_RESOURCE_GROUP_NAME: "${{ secrets.AZURE_RESOURCE_GROUP_NAME }}"
AZURE_LOCATION: "${{ secrets.AZURE_LOCATION }}"
suite-cleanup-fail:
needs: 'test-run'
if: "${{ failure() }}"
runs-on:
- self-hosted
- 1ES.Pool=iot-identity-1es-hosted-linux-amd64
- 1ES.ImageOverride=agent-aziotedge-ubuntu-22.04-msmoby
strategy:
fail-fast: false
matrix:
branch:
- 'main'
# - 'release/1.4'
max-parallel: 10
steps:
- uses: 'actions/checkout@v3'
with:
ref: "${{ matrix.branch }}"
- name: 'Clean up on failure'
run: |
timeout 5m ./ci/e2e-tests/suite-cleanup.sh
exit 1 # Force the workflow to fail even if this step succeeds
env:
BRANCH: "${{ matrix.branch }}"
AZURE_RESOURCE_GROUP_NAME: "${{ secrets.AZURE_RESOURCE_GROUP_NAME }}"
AZURE_LOCATION: "${{ secrets.AZURE_LOCATION }}"