Skip to content

Commit cb87398

Browse files
committed
Workflows: Use new depot runners for x86 Linux release builds
1 parent 3291372 commit cb87398

File tree

1 file changed

+73
-16
lines changed

1 file changed

+73
-16
lines changed

.github/workflows/release-binaries.yml

Lines changed: 73 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ jobs:
6060
enable-pgo: ${{ steps.vars.outputs.enable-pgo }}
6161
release-binary-basename: ${{ steps.vars.outputs.release-binary-basename }}
6262
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 }}
6365

6466
steps:
6567
# It's good practice to use setup-python, but this is also required on macos-14
@@ -144,12 +146,26 @@ jobs:
144146
145147
echo "target-cmake-flags=$target_cmake_flags" >> $GITHUB_OUTPUT
146148
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
147161
148162
build-stage1:
149163
name: "Build Stage 1"
150164
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 }}
153169
steps:
154170

155171
- name: Checkout Actions
@@ -195,7 +211,7 @@ jobs:
195211
key: sccache-${{ runner.os }}-${{ runner.arch }}-release
196212
variant: sccache
197213

198-
- name: Build Stage 1 Clang
214+
- name: Configure Stage 1 Clang
199215
id: build
200216
shell: bash
201217
run: |
@@ -208,12 +224,44 @@ jobs:
208224
-DBOOTSTRAP_CPACK_PACKAGE_FILE_NAME="${{ needs.prepare.outputs.release-binary-basename }}" \
209225
-DCMAKE_C_COMPILER_LAUNCHER=sccache \
210226
-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
215256
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+
216263
- name: Save Stage
264+
if: needs.prepare.outputs.multi-stage == "true"
217265
uses: ./workflows-main/.github/workflows/release-binaries-save-stage
218266
with:
219267
build-prefix: ${{ steps.setup-stage.outputs.build-prefix }}
@@ -223,8 +271,10 @@ jobs:
223271
needs:
224272
- prepare
225273
- 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 }}
228278
steps:
229279
- name: Checkout Actions
230280
uses: actions/checkout@v4
@@ -242,7 +292,9 @@ jobs:
242292

243293
- name: Build Stage 2
244294
# 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'
246298
shell: bash
247299
run: |
248300
ninja -C ${{ steps.setup-stage.outputs.build-prefix}}/build stage2-instrumented
@@ -257,8 +309,10 @@ jobs:
257309
needs:
258310
- prepare
259311
- 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 }}
262316
steps:
263317
- name: Checkout Actions
264318
uses: actions/checkout@v4
@@ -307,7 +361,9 @@ jobs:
307361
needs:
308362
- prepare
309363
- 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 }}
311367
steps:
312368
- name: Checkout Actions
313369
uses: actions/checkout@v4
@@ -357,7 +413,7 @@ jobs:
357413
needs:
358414
- prepare
359415
- build-stage3-flang
360-
runs-on: ${{ inputs.runs-on }}
416+
runs-on: ${{ needs.prepare.outputs.runs-on }}
361417
steps:
362418
- name: Checkout Actions
363419
uses: actions/checkout@v4
@@ -409,6 +465,7 @@ jobs:
409465
needs:
410466
- prepare
411467
- build-stage3-all
468+
- build-stage1
412469
if: >-
413470
always() &&
414471
github.event_name != 'pull_request' &&
@@ -469,8 +526,8 @@ jobs:
469526
- prepare
470527
- build-stage3-all
471528
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 }}
474531
steps:
475532
- name: Checkout Actions
476533
uses: actions/checkout@v4

0 commit comments

Comments
 (0)