-
Notifications
You must be signed in to change notification settings - Fork 111
309 lines (282 loc) · 10.3 KB
/
ci.yml
File metadata and controls
309 lines (282 loc) · 10.3 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
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
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
name: Merge Queue Tasks
on:
merge_group:
workflow_dispatch:
jobs:
# HOW JOBS ARE STRUCTURED IN THIS FILE
#
# Each substantive job (build, test, etc.) must have a matching
# cancel-if-<name>-failed sentinel job in the cancel-if-* section below.
# GitHub Actions does not cancel sibling jobs when one job fails — they keep
# running and waste runner time. The sentinels work around this: each one
# watches a single upstream job and immediately cancels the entire run on
# failure.
#
# IMPORTANT: The sentinel cancel is asynchronous. Any job that must not run
# when a prior job fails MUST also list that job in its `needs:` field and
# check its result in its `if:` condition — do not rely on the cancel alone.
# Example: invoke-tests-web-console-unit runs in parallel with the build
# jobs, so invoke-build-docker lists it in `needs:` and checks its result in
# `if:`. Without that explicit gate, the Docker build can start before the
# cancel propagates and waste expensive runner time.
invoke-build-rust:
name: Build Rust
uses: ./.github/workflows/build-rust.yml
secrets: inherit
invoke-build-java:
name: Build Java
uses: ./.github/workflows/build-java.yml
secrets: inherit
invoke-build-docs:
name: Build Docs
uses: ./.github/workflows/build-docs.yml
secrets: inherit
invoke-tests-web-console-unit:
name: Web Console Unit Tests
uses: ./.github/workflows/test-web-console-unit.yml
secrets: inherit
invoke-tests-unit:
name: Unit Tests
needs: [invoke-build-rust, invoke-build-java]
uses: ./.github/workflows/test-unit.yml
secrets: inherit
invoke-tests-adapter:
name: Adapter Tests
needs: [invoke-build-rust]
uses: ./.github/workflows/test-adapters.yml
secrets: inherit
invoke-build-docker:
name: Build Docker
needs: [invoke-build-rust, invoke-build-java, invoke-tests-web-console-unit]
if: |
always() &&
(needs.invoke-build-rust.result == 'success' || needs.invoke-build-rust.result == 'skipped') &&
(needs.invoke-build-java.result == 'success' || needs.invoke-build-java.result == 'skipped') &&
(needs.invoke-tests-web-console-unit.result == 'success' || needs.invoke-tests-web-console-unit.result == 'skipped')
uses: ./.github/workflows/build-docker.yml
secrets: inherit
invoke-generate-sbom:
name: Generate SBOMs
needs: [invoke-build-docker]
uses: ./.github/workflows/generate-sbom.yml
secrets: inherit
invoke-tests-web-console-e2e:
name: Web Console End-to-End Tests
needs: [invoke-build-docker]
uses: ./.github/workflows/test-web-console-e2e.yml
secrets: inherit
invoke-tests-integration-platform:
name: Integration Tests
needs: [invoke-build-docker]
uses: ./.github/workflows/test-integration-platform.yml
secrets: inherit
invoke-tests-integration-runtime:
name: Integration Tests
needs: [invoke-build-java]
uses: ./.github/workflows/test-integration-runtime.yml
secrets: inherit
invoke-tests-java:
name: Java Tests
needs: [invoke-build-java]
uses: ./.github/workflows/test-java.yml
secrets: inherit
invoke-publish-crates-dry-run:
name: Publish Crates (Dry Run)
needs: [invoke-build-rust]
uses: ./.github/workflows/publish-crates.yml
with:
environment: ci
secrets: inherit
cancel-if-tests-web-console-unit-failed:
name: Cancel if Web Console Unit Tests Failed
needs: [invoke-tests-web-console-unit]
if: failure()
runs-on: ubuntu-latest-amd64
permissions:
actions: write
steps:
- name: Cancel workflow
run: |
curl -fsSL -X POST \
-H "Authorization: Bearer ${{ github.token }}" \
-H "Accept: application/vnd.github+json" \
"https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/cancel"
cancel-if-build-rust-failed:
name: Cancel if Rust Build Failed
needs: [invoke-build-rust]
if: failure()
runs-on: ubuntu-latest-amd64
permissions:
actions: write
steps:
- name: Cancel workflow
run: |
curl -fsSL -X POST \
-H "Authorization: Bearer ${{ github.token }}" \
-H "Accept: application/vnd.github+json" \
"https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/cancel"
cancel-if-build-java-failed:
name: Cancel if Java Build Failed
needs: [invoke-build-java]
if: failure()
runs-on: ubuntu-latest-amd64
permissions:
actions: write
steps:
- name: Cancel workflow
run: |
curl -fsSL -X POST \
-H "Authorization: Bearer ${{ github.token }}" \
-H "Accept: application/vnd.github+json" \
"https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/cancel"
cancel-if-build-docs-failed:
name: Cancel if Docs Build Failed
needs: [invoke-build-docs]
if: failure()
runs-on: ubuntu-latest-amd64
permissions:
actions: write
steps:
- name: Cancel workflow
run: |
curl -fsSL -X POST \
-H "Authorization: Bearer ${{ github.token }}" \
-H "Accept: application/vnd.github+json" \
"https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/cancel"
cancel-if-tests-unit-failed:
name: Cancel if Unit Tests Failed
needs: [invoke-tests-unit]
if: failure()
runs-on: ubuntu-latest-amd64
permissions:
actions: write
steps:
- name: Cancel workflow
run: |
curl -fsSL -X POST \
-H "Authorization: Bearer ${{ github.token }}" \
-H "Accept: application/vnd.github+json" \
"https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/cancel"
cancel-if-tests-adapter-failed:
name: Cancel if Adapter Tests Failed
needs: [invoke-tests-adapter]
if: failure()
runs-on: ubuntu-latest-amd64
permissions:
actions: write
steps:
- name: Cancel workflow
run: |
curl -fsSL -X POST \
-H "Authorization: Bearer ${{ github.token }}" \
-H "Accept: application/vnd.github+json" \
"https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/cancel"
cancel-if-build-docker-failed:
name: Cancel if Docker Build Failed
needs: [invoke-build-docker]
if: failure()
runs-on: ubuntu-latest-amd64
permissions:
actions: write
steps:
- name: Cancel workflow
run: |
curl -fsSL -X POST \
-H "Authorization: Bearer ${{ github.token }}" \
-H "Accept: application/vnd.github+json" \
"https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/cancel"
cancel-if-tests-web-console-integration-failed:
name: Cancel if Web Console Integration Tests Failed
needs: [invoke-tests-web-console-e2e]
if: failure()
runs-on: ubuntu-latest-amd64
permissions:
actions: write
steps:
- name: Cancel workflow
run: |
curl -fsSL -X POST \
-H "Authorization: Bearer ${{ github.token }}" \
-H "Accept: application/vnd.github+json" \
"https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/cancel"
cancel-if-tests-integration-platform-failed:
name: Cancel if Platform Integration Tests Failed
needs: [invoke-tests-integration-platform]
if: failure()
runs-on: ubuntu-latest-amd64
permissions:
actions: write
steps:
- name: Cancel workflow
run: |
curl -fsSL -X POST \
-H "Authorization: Bearer ${{ github.token }}" \
-H "Accept: application/vnd.github+json" \
"https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/cancel"
cancel-if-tests-integration-runtime-failed:
name: Cancel if Runtime Integration Tests Failed
needs: [invoke-tests-integration-runtime]
if: failure()
runs-on: ubuntu-latest-amd64
permissions:
actions: write
steps:
- name: Cancel workflow
run: |
curl -fsSL -X POST \
-H "Authorization: Bearer ${{ github.token }}" \
-H "Accept: application/vnd.github+json" \
"https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/cancel"
cancel-if-tests-java-failed:
name: Cancel if Java Tests Failed
needs: [invoke-tests-java]
if: failure()
runs-on: ubuntu-latest-amd64
permissions:
actions: write
steps:
- name: Cancel workflow
run: |
curl -fsSL -X POST \
-H "Authorization: Bearer ${{ github.token }}" \
-H "Accept: application/vnd.github+json" \
"https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/cancel"
cancel-if-publish-crates-dry-run-failed:
name: Cancel if Publish Crates Dry Run Failed
needs: [invoke-publish-crates-dry-run]
if: failure()
runs-on: ubuntu-latest-amd64
permissions:
actions: write
steps:
- name: Cancel workflow
run: |
curl -fsSL -X POST \
-H "Authorization: Bearer ${{ github.token }}" \
-H "Accept: application/vnd.github+json" \
"https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/cancel"
# This job needs to be called main (the same as the ci-pre-mergequeue.yml workflow)
# because of how merge queues work: https://stackoverflow.com/a/78030618
# and https://github.com/orgs/community/discussions/103114
main:
if: always()
runs-on: ubuntu-latest-amd64
needs:
- invoke-build-rust
- invoke-build-java
- invoke-build-docs
- invoke-tests-web-console-unit
- invoke-tests-web-console-e2e
- invoke-tests-unit
- invoke-tests-adapter
- invoke-build-docker
- invoke-generate-sbom
- invoke-tests-integration-platform
- invoke-tests-integration-runtime
- invoke-tests-java
- invoke-publish-crates-dry-run
steps:
- name: Finalize Workflow
run: echo "All tasks completed!"
- if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}
run: exit 1