-
Notifications
You must be signed in to change notification settings - Fork 428
341 lines (316 loc) · 12 KB
/
ci.yml
File metadata and controls
341 lines (316 loc) · 12 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
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
name: CI
on:
workflow_dispatch:
merge_group:
types: [checks_requested]
pull_request:
branches: [master]
types: [opened, synchronize, reopened, ready_for_review]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name != 'push' }}
jobs:
filter:
if: github.event_name != 'pull_request' || github.event.pull_request.draft != true
runs-on: ubuntu-latest
outputs:
should-run: ${{ steps.filter.outputs.should-run }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: "2"
- id: filter
run: |
# This step prevents subsequent steps from running if only documentation was changed
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
git fetch origin ${{ github.base_ref }}
BASE=origin/${{ github.base_ref }}
else
BASE=HEAD^1
fi
shouldRun=true
if files="$(git diff --name-only $BASE...HEAD)"; then
# Git diff succeeded, check if non-documentation files were changed
if echo "$files" | grep -qvE '^(docs/|LICENSES/|LICENSE$|CONTRIBUTING\.md$|README\.md$)'; then
shouldRun=true
else
echo "Only documentation files changed, skipping remaining steps"
shouldRun=false
fi
else
echo "Git diff failed, conservatively running tests"
shouldRun=true
fi
echo "should-run=$shouldRun" >> $GITHUB_OUTPUT
# Linux builds (containerized builds on GitHub-hosted runners)
build-linux-debug-gcc-x86_64:
needs: [filter]
if: needs.filter.outputs.should-run == 'true'
uses: ./.github/workflows/ci-slang-build-container.yml
with:
config: debug
runs-on: '["ubuntu-22.04"]'
build-linux-release-gcc-x86_64:
needs: [filter]
if: needs.filter.outputs.should-run == 'true'
uses: ./.github/workflows/ci-slang-build-container.yml
with:
config: release
runs-on: '["ubuntu-22.04"]'
build-linux-release-gcc-wasm:
needs: [filter]
if: needs.filter.outputs.should-run == 'true'
uses: ./.github/workflows/ci-slang-build.yml
with:
os: linux
compiler: gcc
platform: wasm
config: release
runs-on: '["ubuntu-22.04"]'
# macOS builds
build-macos-debug-clang-aarch64:
needs: [filter]
if: needs.filter.outputs.should-run == 'true'
uses: ./.github/workflows/ci-slang-build.yml
with:
os: macos
compiler: clang
platform: aarch64
config: debug
runs-on: '["macos-latest"]'
build-macos-release-clang-aarch64:
needs: [filter]
if: needs.filter.outputs.should-run == 'true'
uses: ./.github/workflows/ci-slang-build.yml
with:
os: macos
compiler: clang
platform: aarch64
config: release
runs-on: '["macos-latest"]'
# Linux ARM64 builds (GitHub-hosted)
build-linux-debug-gcc-aarch64:
needs: [filter]
if: needs.filter.outputs.should-run == 'true'
uses: ./.github/workflows/ci-slang-build.yml
with:
os: linux
compiler: gcc
platform: aarch64
config: debug
runs-on: '["ubuntu-24.04-arm"]'
warnings-as-errors: false
build-linux-release-gcc-aarch64:
needs: [filter]
if: needs.filter.outputs.should-run == 'true'
uses: ./.github/workflows/ci-slang-build.yml
with:
os: linux
compiler: gcc
platform: aarch64
config: release
runs-on: '["ubuntu-24.04-arm"]'
warnings-as-errors: false
# Windows builds (self-hosted)
build-windows-debug-cl-x86_64-gpu:
needs: [filter]
if: needs.filter.outputs.should-run == 'true'
uses: ./.github/workflows/ci-slang-build.yml
with:
os: windows
compiler: cl
platform: x86_64
config: debug
runs-on: '["Windows", "self-hosted", "build"]'
build-windows-release-cl-x86_64-gpu:
needs: [filter]
if: needs.filter.outputs.should-run == 'true'
uses: ./.github/workflows/ci-slang-build.yml
with:
os: windows
compiler: cl
platform: x86_64
config: release
runs-on: '["Windows", "self-hosted", "build"]'
# Linux tests (self-hosted GPU runner, containerized)
test-linux-debug-gcc-x86_64:
needs: [filter, build-linux-debug-gcc-x86_64]
if: needs.filter.outputs.should-run == 'true'
uses: ./.github/workflows/ci-slang-test-container.yml
with:
config: debug
server-count: 4
test-linux-release-gcc-x86_64:
needs: [filter, build-linux-release-gcc-x86_64]
if: needs.filter.outputs.should-run == 'true'
uses: ./.github/workflows/ci-slang-test-container.yml
with:
config: release
server-count: 4
# macOS tests
test-macos-debug-clang-aarch64:
needs: [filter, build-macos-debug-clang-aarch64]
if: needs.filter.outputs.should-run == 'true'
uses: ./.github/workflows/ci-slang-test.yml
with:
os: macos
compiler: clang
platform: aarch64
config: debug
runs-on: '["macos-latest"]'
test-category: smoke
full-gpu-tests: true
server-count: 3
test-macos-release-clang-aarch64:
needs: [filter, build-macos-release-clang-aarch64]
if: needs.filter.outputs.should-run == 'true'
uses: ./.github/workflows/ci-slang-test.yml
with:
os: macos
compiler: clang
platform: aarch64
config: release
runs-on: '["macos-latest"]'
test-category: full
full-gpu-tests: true
server-count: 3
# Linux ARM64 tests (GitHub-hosted, CPU only)
test-linux-debug-gcc-aarch64:
needs: [filter, build-linux-debug-gcc-aarch64]
if: needs.filter.outputs.should-run == 'true'
uses: ./.github/workflows/ci-slang-test.yml
with:
os: linux
compiler: gcc
platform: aarch64
config: debug
runs-on: '["ubuntu-24.04-arm"]'
test-category: smoke
full-gpu-tests: false
test-linux-release-gcc-aarch64:
needs: [filter, build-linux-release-gcc-aarch64]
if: needs.filter.outputs.should-run == 'true'
uses: ./.github/workflows/ci-slang-test.yml
with:
os: linux
compiler: gcc
platform: aarch64
config: release
runs-on: '["ubuntu-24.04-arm"]'
test-category: smoke
full-gpu-tests: false
# Windows GPU tests (self-hosted)
test-windows-debug-cl-x86_64-gpu:
needs: [filter, build-windows-debug-cl-x86_64-gpu]
if: needs.filter.outputs.should-run == 'true'
uses: ./.github/workflows/ci-slang-test.yml
with:
os: windows
compiler: cl
platform: x86_64
config: debug
runs-on: '["Windows", "self-hosted", "GCP-T4"]'
test-category: full
full-gpu-tests: true
test-windows-release-cl-x86_64-gpu:
needs: [filter, build-windows-release-cl-x86_64-gpu]
if: needs.filter.outputs.should-run == 'true'
uses: ./.github/workflows/ci-slang-test.yml
with:
os: windows
compiler: cl
platform: x86_64
config: release
runs-on: '["Windows", "self-hosted", "GCP-T4"]'
test-category: full
full-gpu-tests: true
# MaterialX Integration Tests (Windows only for initial validation)
test-materialx-windows-release:
needs: [filter, build-windows-release-cl-x86_64-gpu]
if: needs.filter.outputs.should-run == 'true' && github.event_name == 'pull_request'
uses: ./.github/workflows/materialx-test.yml
with:
os: windows
compiler: cl
platform: x86_64
config: release
runs-on: '["windows-latest"]'
check-ci:
needs:
[
test-windows-release-cl-x86_64-gpu,
test-windows-debug-cl-x86_64-gpu,
test-macos-release-clang-aarch64,
test-macos-debug-clang-aarch64,
test-linux-release-gcc-x86_64,
test-linux-debug-gcc-x86_64,
test-linux-release-gcc-aarch64,
test-linux-debug-gcc-aarch64,
test-materialx-windows-release,
]
runs-on: ubuntu-latest
if: always() && (github.event_name != 'pull_request' || github.event.pull_request.draft != true)
steps:
- name: Check CI Results
run: |
echo "=== CI Results Summary ==="
echo "Windows Release GPU: ${{ needs.test-windows-release-cl-x86_64-gpu.result }}"
echo "Windows Debug GPU: ${{ needs.test-windows-debug-cl-x86_64-gpu.result }}"
echo "macOS Release ARM64: ${{ needs.test-macos-release-clang-aarch64.result }}"
echo "macOS Debug ARM64: ${{ needs.test-macos-debug-clang-aarch64.result }}"
echo "Linux Release x64: ${{ needs.test-linux-release-gcc-x86_64.result }}"
echo "Linux Debug x64: ${{ needs.test-linux-debug-gcc-x86_64.result }}"
echo "Linux Release ARM64: ${{ needs.test-linux-release-gcc-aarch64.result }}"
echo "Linux Debug ARM64: ${{ needs.test-linux-debug-gcc-aarch64.result }}"
echo "MaterialX Windows: ${{ needs.test-materialx-windows-release.result }}"
# Check if any required jobs failed (allow success or skipped)
if [[ "${{ needs.test-windows-release-cl-x86_64-gpu.result }}" == "failure" ]] || \
[[ "${{ needs.test-windows-debug-cl-x86_64-gpu.result }}" == "failure" ]] || \
[[ "${{ needs.test-macos-release-clang-aarch64.result }}" == "failure" ]] || \
[[ "${{ needs.test-macos-debug-clang-aarch64.result }}" == "failure" ]] || \
[[ "${{ needs.test-linux-release-gcc-x86_64.result }}" == "failure" ]] || \
[[ "${{ needs.test-linux-debug-gcc-x86_64.result }}" == "failure" ]] || \
[[ "${{ needs.test-linux-release-gcc-aarch64.result }}" == "failure" ]] || \
[[ "${{ needs.test-linux-debug-gcc-aarch64.result }}" == "failure" ]] || \
[[ "${{ needs.test-materialx-windows-release.result }}" == "failure" ]] || \
[[ "${{ needs.test-windows-release-cl-x86_64-gpu.result }}" == "cancelled" ]] || \
[[ "${{ needs.test-windows-debug-cl-x86_64-gpu.result }}" == "cancelled" ]] || \
[[ "${{ needs.test-macos-release-clang-aarch64.result }}" == "cancelled" ]] || \
[[ "${{ needs.test-macos-debug-clang-aarch64.result }}" == "cancelled" ]] || \
[[ "${{ needs.test-linux-release-gcc-x86_64.result }}" == "cancelled" ]] || \
[[ "${{ needs.test-linux-debug-gcc-x86_64.result }}" == "cancelled" ]] || \
[[ "${{ needs.test-linux-release-gcc-aarch64.result }}" == "cancelled" ]] || \
[[ "${{ needs.test-linux-debug-gcc-aarch64.result }}" == "cancelled" ]] || \
[[ "${{ needs.test-materialx-windows-release.result }}" == "cancelled" ]]; then
echo "One or more CI jobs failed or were cancelled"
exit 1
fi
echo "All CI jobs completed successfully (passed or skipped)!"
# Automatically retry GPU health check failures by dispatching ci-retry.yml,
# which watches this run until it completes, then reruns only failed jobs.
# Capped at 2 automatic retries via run_attempt check.
retry-on-gpu-failure:
needs: [check-ci]
if: failure() && fromJSON(github.run_attempt) < 3
runs-on: ubuntu-latest
permissions:
actions: write
steps:
- name: Check for GPU health check failures and dispatch retry
env:
GH_REPO: ${{ github.repository }}
GH_TOKEN: ${{ github.token }}
run: |
gpu_failures=$(gh api "repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/jobs?per_page=100" \
--jq '[.jobs[] | select(.conclusion == "failure") | select(.steps[]? | select(.name == "GPU health check" and .conclusion == "failure"))] | length' \
|| echo "0")
gpu_failures=${gpu_failures:-0}
if ! [[ "$gpu_failures" =~ ^[0-9]+$ ]]; then
gpu_failures=0
fi
if [ "$gpu_failures" -gt 0 ]; then
echo "Found $gpu_failures GPU health check failure(s) — dispatching retry workflow..."
gh workflow run ci-retry.yml -F run_id=${{ github.run_id }}
else
echo "No GPU health check failures — not retrying."
fi