60
60
enable-pgo : ${{ steps.vars.outputs.enable-pgo }}
61
61
release-binary-basename : ${{ steps.vars.outputs.release-binary-basename }}
62
62
release-binary-filename : ${{ steps.vars.outputs.release-binary-filename }}
63
+ runs-on : ${{ steps.vars.outputs.runs-on }}
64
+ multi-stage : ${{ steps.vars.outputs.multi-stage }}
63
65
64
66
steps :
65
67
# It's good practice to use setup-python, but this is also required on macos-14
@@ -144,12 +146,26 @@ jobs:
144
146
145
147
echo "target-cmake-flags=$target_cmake_flags" >> $GITHUB_OUTPUT
146
148
echo "build-flang=$build_flang" >> $GITHUB_OUTPUT
149
+ case "${{ inputs.runs-on }}" in
150
+ ubuntu-22.04)
151
+ runs_on="depot-${{ inputs.runs-on }}-16"
152
+ multi_stage="false"
153
+ ;;
154
+ *)
155
+ runs_on="${{ inputs.runs-on }}"
156
+ multi_stage="true"
157
+ ;;
158
+ esac
159
+ echo "runs-on=$runs_on" >> $GITHUB_OUTPUT
160
+ echo "multi-stage=$multi_stage" >> $GITHUB_OUTPUT
147
161
148
162
build-stage1 :
149
163
name : " Build Stage 1"
150
164
needs : prepare
151
- if : github.repository == 'llvm/llvm-project'
152
- runs-on : ${{ inputs.runs-on }}
165
+ if : >-
166
+ github.repository == 'llvm/llvm-project' &&
167
+ needs.prepare.outputs.multi-stage == 'true'
168
+ runs-on : ${{ needs.prepare.outputs.runs-on }}
153
169
steps :
154
170
155
171
- name : Checkout Actions
@@ -195,7 +211,7 @@ jobs:
195
211
key : sccache-${{ runner.os }}-${{ runner.arch }}-release
196
212
variant : sccache
197
213
198
- - name : Build Stage 1 Clang
214
+ - name : Configure Stage 1 Clang
199
215
id : build
200
216
shell : bash
201
217
run : |
@@ -208,12 +224,44 @@ jobs:
208
224
-DBOOTSTRAP_CPACK_PACKAGE_FILE_NAME="${{ needs.prepare.outputs.release-binary-basename }}" \
209
225
-DCMAKE_C_COMPILER_LAUNCHER=sccache \
210
226
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache
211
- ninja -v -C ${{ steps.setup-stage.outputs.build-prefix }}/build
212
- # There is a race condition on the MacOS builders and this command is here
213
- # to help debug that when it happens.
214
- ls -ltr ${{ steps.setup-stage.outputs.build-prefix }}/build
227
+ - name : Build Stage 1 Clang
228
+ shell : bash
229
+ run : |
230
+ if "${{ steps.needs.prepare.outputs.multi-stage}}" = "true"; then
231
+ ninja -v -C ${{ steps.setup-stage.outputs.build-prefix }}/build stage2-package
232
+ mv ${{ steps.setup-stage.outputs.build-prefix }}/build/tools/clang/stage2-bins/${{ needs.prepare.outputs.release-binary-filename }} .
233
+ else
234
+ ninja -v -C ${{ steps.setup-stage.outputs.build-prefix }}/build
235
+ # There is a race condition on the MacOS builders and this command is here
236
+ # to help debug that when it happens.
237
+ ls -ltr ${{ steps.setup-stage.outputs.build-prefix }}/build
238
+ fi
239
+
240
+ - uses : actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
241
+ if : needs.prepare.outputs.multi-stage == "false"
242
+ with :
243
+ name : ${{ runner.os }}-${{ runner.arch }}-release-binary
244
+ # Due to path differences on Windows when running in bash vs running on node,
245
+ # we need to search for files in the current workspace.
246
+ path : |
247
+ ${{ needs.prepare.outputs.release-binary-filename }}
248
+
249
+ # Clean up some build files to reduce size of artifact.
250
+ - name : Clean Up Build Directory
251
+ if : needs.prepare.outputs.multi-stage == "false"
252
+ shell : bash
253
+ run : |
254
+ find ${{ steps.setup-stage.outputs.build-prefix }}/build -iname ${{ needs.prepare.outputs.release-binary-filename }} -delete
255
+ rm -Rf ${{ steps.setup-stage.outputs.build-prefix }}/build/tools/clang/stage2-bins/_CPack_Packages
215
256
257
+ - name : Run Tests
258
+ shell : bash
259
+ if : needs.prepare.outputs.multi-stage == "false"
260
+ run : |
261
+ ninja -C ${{ steps.setup-stage.outputs.build-prefix }}/build stage2-check-all
262
+
216
263
- name : Save Stage
264
+ if : needs.prepare.outputs.multi-stage == "true"
217
265
uses : ./workflows-main/.github/workflows/release-binaries-save-stage
218
266
with :
219
267
build-prefix : ${{ steps.setup-stage.outputs.build-prefix }}
@@ -223,8 +271,10 @@ jobs:
223
271
needs :
224
272
- prepare
225
273
- build-stage1
226
- if : github.repository == 'llvm/llvm-project'
227
- runs-on : ${{ inputs.runs-on }}
274
+ if : >-
275
+ github.repository == 'llvm/llvm-project' &&
276
+ needs.prepare.outputs.multi-stage == 'true'
277
+ runs-on : ${{ needs.prepare.outputs.runs-on }}
228
278
steps :
229
279
- name : Checkout Actions
230
280
uses : actions/checkout@v4
@@ -242,7 +292,9 @@ jobs:
242
292
243
293
- name : Build Stage 2
244
294
# Re-enable once PGO builds are supported.
245
- if : needs.prepare.outputs.enable-pgo == 'true'
295
+ if : >-
296
+ needs.prepare.outputs.enable-pgo == 'true' &&
297
+ needs.prepare.outputs.multi-stage == 'true'
246
298
shell : bash
247
299
run : |
248
300
ninja -C ${{ steps.setup-stage.outputs.build-prefix}}/build stage2-instrumented
@@ -257,8 +309,10 @@ jobs:
257
309
needs :
258
310
- prepare
259
311
- build-stage2
260
- if : github.repository == 'llvm/llvm-project'
261
- runs-on : ${{ inputs.runs-on }}
312
+ if : >-
313
+ github.repository == 'llvm/llvm-project' &&
314
+ needs.prepare.outputs.multi-stage == 'true'
315
+ runs-on : ${{ needs.prepare.outputs.runs-on }}
262
316
steps :
263
317
- name : Checkout Actions
264
318
uses : actions/checkout@v4
@@ -307,7 +361,9 @@ jobs:
307
361
needs :
308
362
- prepare
309
363
- build-stage3-clang
310
- runs-on : ${{ inputs.runs-on }}
364
+ if : >-
365
+ needs.prepare.outputs.multi-stage == 'true'
366
+ runs-on : ${{ needs.prepare.outputs.runs-on }}
311
367
steps :
312
368
- name : Checkout Actions
313
369
uses : actions/checkout@v4
@@ -357,7 +413,7 @@ jobs:
357
413
needs :
358
414
- prepare
359
415
- build-stage3-flang
360
- runs-on : ${{ inputs .runs-on }}
416
+ runs-on : ${{ needs.prepare.outputs .runs-on }}
361
417
steps :
362
418
- name : Checkout Actions
363
419
uses : actions/checkout@v4
@@ -409,6 +465,7 @@ jobs:
409
465
needs :
410
466
- prepare
411
467
- build-stage3-all
468
+ - build-stage1
412
469
if : >-
413
470
always() &&
414
471
github.event_name != 'pull_request' &&
@@ -469,8 +526,8 @@ jobs:
469
526
- prepare
470
527
- build-stage3-all
471
528
if : >-
472
- github.repository == 'llvm/llvm-project'
473
- runs-on : ${{ inputs .runs-on }}
529
+ github.repository == 'llvm/llvm-project' &&
530
+ runs-on : ${{ needs.prepare.outputs .runs-on }}
474
531
steps :
475
532
- name : Checkout Actions
476
533
uses : actions/checkout@v4
0 commit comments