Skip to content

Commit 8e43f05

Browse files
[CI] Refactor toolchain-artifact related inputs/outputs (#19643)
* Group all artifact-related inputs in `sycl-linux-build.yml`. I plan on refactoring artifacts for E2E tests/release toolchain in a subsequent PR. * Unify inputs/outputs names between `sycl-*-build.yml` and `sycl-*-run-tests.yml`. Windows still has less flexibility, but for the inputs that exist there the names still match Linux and the inputs are ordered similarly to Linux. * Add `${{ needs.build.outputs.toolchain_artifact }}` instead of duplicating the artifact name. Aligns usage with actual filename/decompress command.
1 parent b62432d commit 8e43f05

12 files changed

+135
-116
lines changed

.github/workflows/sycl-linux-build.yml

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -33,25 +33,30 @@ on:
3333
type: string
3434
required: false
3535
default: "--hip --cuda --native_cpu"
36-
build_artifact_suffix:
37-
type: string
38-
required: true
3936
build_target:
4037
type: string
4138
required: false
4239
default: sycl-toolchain
43-
artifact_archive_name:
44-
type: string
45-
default: llvm_sycl.tar.zst
40+
4641
changes:
4742
type: string
4843
description: 'Filter matches for the changed files in the PR'
4944
default: '[llvm, clang, sycl, llvm_spirv, xptifw, libclc]'
5045
required: false
46+
47+
# Artifacts:
48+
5149
retention-days:
5250
description: 'Artifacts retention period'
5351
type: string
5452
default: 3
53+
54+
toolchain_artifact:
55+
type: string
56+
required: true
57+
toolchain_artifact_filename:
58+
type: string
59+
default: llvm_sycl.tar.zst
5560
e2e_binaries_artifact:
5661
type: string
5762
required: false
@@ -62,10 +67,12 @@ on:
6267
outputs:
6368
build_conclusion:
6469
value: ${{ jobs.build.outputs.build_conclusion }}
65-
artifact_archive_name:
66-
value: ${{ jobs.build.outputs.artifact_archive_name }}
67-
artifact_decompress_command:
68-
value: ${{ jobs.build.outputs.artifact_decompress_command }}
70+
toolchain_artifact:
71+
value: ${{ inputs.toolchain_artifact }}
72+
toolchain_artifact_filename:
73+
value: ${{ jobs.build.outputs.toolchain_artifact_filename }}
74+
toolchain_decompress_command:
75+
value: ${{ jobs.build.outputs.toolchain_decompress_command }}
6976

7077
workflow_dispatch:
7178
inputs:
@@ -102,10 +109,10 @@ on:
102109
options:
103110
- "default"
104111

105-
build_artifact_suffix:
112+
toolchain_artifact:
106113
type: choice
107114
options:
108-
- "default"
115+
- "sycl_linux_default"
109116
retention-days:
110117
type: choice
111118
options:
@@ -126,8 +133,8 @@ jobs:
126133
options: -u 1001:1001
127134
outputs:
128135
build_conclusion: ${{ steps.build.conclusion }}
129-
artifact_archive_name: ${{ steps.artifact_info.outputs.ARCHIVE_NAME }}
130-
artifact_decompress_command: ${{ steps.artifact_info.outputs.DECOMPRESS }}
136+
toolchain_artifact_filename: ${{ steps.artifact_info.outputs.ARCHIVE_NAME }}
137+
toolchain_decompress_command: ${{ steps.artifact_info.outputs.DECOMPRESS }}
131138
env:
132139
CCACHE_DIR: ${{ inputs.build_cache_root }}/build_cache_${{ inputs.build_cache_suffix }}
133140
CCACHE_MAXSIZE: 8G
@@ -136,7 +143,7 @@ jobs:
136143
# To reduce number of inputs parameters that is limited for manual triggers.
137144
id: artifact_info
138145
run: |
139-
NAME="${{inputs.artifact_archive_name}}"
146+
NAME="${{inputs.toolchain_artifact_filename}}"
140147
if [ -z "$NAME" ]; then
141148
NAME=llvm_sycl.tar.zst
142149
fi
@@ -287,7 +294,7 @@ jobs:
287294
if: ${{ always() && !cancelled() && steps.build.conclusion == 'success' }}
288295
uses: actions/upload-artifact@v4
289296
with:
290-
name: sycl_linux_${{ inputs.build_artifact_suffix }}
297+
name: ${{ inputs.toolchain_artifact }}
291298
path: ${{ steps.artifact_info.outputs.ARCHIVE_NAME }}
292299
retention-days: ${{ inputs.retention-days }}
293300

.github/workflows/sycl-linux-precommit-aws.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,9 @@ jobs:
7373
# pre-commit workflow.
7474
repo_ref: ${{ github.event.workflow_run.referenced_workflows[0].sha }}
7575

76-
sycl_toolchain_artifact: sycl_linux_default
77-
sycl_toolchain_archive: llvm_sycl.tar.zst
78-
sycl_toolchain_decompress_command: zstd
76+
toolchain_artifact: sycl_linux_default
77+
toolchain_artifact_filename: llvm_sycl.tar.zst
78+
toolchain_decompress_command: zstd
7979

8080
update-check:
8181
needs: [create-check, e2e-cuda]

.github/workflows/sycl-linux-precommit.yml

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,14 @@ jobs:
5050
with:
5151
build_ref: ${{ github.sha }}
5252
build_cache_root: "/__w/"
53-
build_artifact_suffix: "default"
5453
build_cache_suffix: "default"
5554
# Docker image has last nightly pre-installed and added to the PATH
5655
build_image: "ghcr.io/intel/llvm/sycl_ubuntu2404_nightly:latest"
5756
cc: clang
5857
cxx: clang++
5958
changes: ${{ needs.detect_changes.outputs.filters }}
59+
60+
toolchain_artifact: sycl_linux_default
6061
e2e_binaries_artifact: sycl_e2e_bin_default
6162

6263
# If a PR changes CUDA adapter, run the build on Ubuntu 22.04 as well.
@@ -70,11 +71,12 @@ jobs:
7071
with:
7172
build_ref: ${{ github.sha }}
7273
build_cache_root: "/__w/"
73-
build_artifact_suffix: "ubuntu22"
7474
build_cache_suffix: "ubuntu22"
7575
build_image: "ghcr.io/intel/llvm/ubuntu2204_build:latest"
7676
changes: ${{ needs.detect_changes.outputs.filters }}
7777

78+
toolchain_artifact: sycl_linux_ubuntu22
79+
7880
run_prebuilt_e2e_tests:
7981
needs: [build, detect_changes]
8082
if: ${{ always() && !cancelled() && needs.build.outputs.build_conclusion == 'success' }}
@@ -146,9 +148,9 @@ jobs:
146148
target_devices: ${{ matrix.target_devices }}
147149
extra_lit_opts: ${{ matrix.extra_lit_opts }}
148150
repo_ref: ${{ github.sha }}
149-
sycl_toolchain_artifact: sycl_linux_default
150-
sycl_toolchain_archive: ${{ needs.build.outputs.artifact_archive_name }}
151-
sycl_toolchain_decompress_command: ${{ needs.build.outputs.artifact_decompress_command }}
151+
toolchain_artifact: ${{ needs.build.outputs.toolchain_artifact }}
152+
toolchain_artifact_filename: ${{ needs.build.outputs.toolchain_artifact_filename }}
153+
toolchain_decompress_command: ${{ needs.build.outputs.toolchain_decompress_command }}
152154
e2e_binaries_artifact: ${{ matrix.e2e_binaries_artifact || 'sycl_e2e_bin_default' }}
153155
e2e_testing_mode: 'run-only'
154156

@@ -185,9 +187,9 @@ jobs:
185187
benchmark_preset: 'Minimal'
186188
benchmark_dry_run: true
187189
repo_ref: ${{ github.sha }}
188-
sycl_toolchain_artifact: sycl_linux_default
189-
sycl_toolchain_archive: ${{ needs.build.outputs.artifact_archive_name }}
190-
sycl_toolchain_decompress_command: ${{ needs.build.outputs.artifact_decompress_command }}
190+
toolchain_artifact: ${{ needs.build.outputs.toolchain_artifact }}
191+
toolchain_artifact_filename: ${{ needs.build.outputs.toolchain_artifact_filename }}
192+
toolchain_decompress_command: ${{ needs.build.outputs.toolchain_decompress_command }}
191193

192194
test-perf:
193195
needs: [build, detect_changes]
@@ -224,6 +226,6 @@ jobs:
224226

225227
repo_ref: ${{ github.sha }}
226228

227-
sycl_toolchain_artifact: sycl_linux_default
228-
sycl_toolchain_archive: ${{ needs.build.outputs.artifact_archive_name }}
229-
sycl_toolchain_decompress_command: ${{ needs.build.outputs.artifact_decompress_command }}
229+
toolchain_artifact: ${{ needs.build.outputs.toolchain_artifact }}
230+
toolchain_artifact_filename: ${{ needs.build.outputs.toolchain_artifact_filename }}
231+
toolchain_decompress_command: ${{ needs.build.outputs.toolchain_decompress_command }}

.github/workflows/sycl-linux-run-tests.yml

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,15 @@ on:
4545
required: False
4646
description: Commit SHA or branch to checkout e2e/cts tests.
4747

48-
sycl_toolchain_artifact:
48+
toolchain_artifact:
4949
type: string
5050
default: ''
5151
required: False
52-
sycl_toolchain_archive:
52+
toolchain_artifact_filename:
5353
type: string
5454
default: ''
5555
required: False
56-
sycl_toolchain_decompress_command:
56+
toolchain_decompress_command:
5757
type: string
5858
default: ''
5959
required: False
@@ -252,21 +252,22 @@ jobs:
252252
comm -13 env_before env_after >> $GITHUB_ENV
253253
rm env_before env_after
254254
- name: Download SYCL toolchain
255-
if: inputs.sycl_toolchain_artifact != '' && github.event_name != 'workflow_run'
255+
if: inputs.toolchain_artifact != '' && github.event_name != 'workflow_run'
256256
uses: actions/download-artifact@v4
257257
with:
258-
name: ${{ inputs.sycl_toolchain_artifact }}
258+
name: ${{ inputs.toolchain_artifact }}
259259
- name: Debug prints [workflow_run]
260-
if: inputs.sycl_toolchain_artifact != '' && github.event_name == 'workflow_run'
260+
if: inputs.toolchain_artifact != '' && github.event_name == 'workflow_run'
261261
run: |
262262
pwd
263263
ls
264264
- name: Download SYCL toolchain [workflow_run]
265-
if: inputs.sycl_toolchain_artifact != '' && github.event_name == 'workflow_run'
265+
# NOTE: This is for `sycl-linux-precommit-aws.yml`.
266+
if: inputs.toolchain_artifact != '' && github.event_name == 'workflow_run'
266267
uses: actions/github-script@v7
267268
with:
268269
script: |
269-
const name = '${{ inputs.sycl_toolchain_artifact }}'
270+
const name = '${{ inputs.toolchain_artifact }}'
270271
let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({
271272
owner: context.repo.owner,
272273
repo: context.repo.repo,
@@ -284,18 +285,18 @@ jobs:
284285
let fs = require('fs');
285286
fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/` + name + '.zip', Buffer.from(download.data));
286287
- name: Unzip artifact [workflow_run]
287-
if: inputs.sycl_toolchain_artifact != '' && github.event_name == 'workflow_run'
288+
if: inputs.toolchain_artifact != '' && github.event_name == 'workflow_run'
288289
run: |
289290
pwd
290291
ls
291-
unzip ${{ inputs.sycl_toolchain_artifact }}.zip
292-
rm ${{ inputs.sycl_toolchain_artifact }}.zip
292+
unzip ${{ inputs.toolchain_artifact }}.zip
293+
rm ${{ inputs.toolchain_artifact }}.zip
293294
- name: Extract/Setup SYCL toolchain
294-
if: inputs.sycl_toolchain_artifact != ''
295+
if: inputs.toolchain_artifact != ''
295296
run: |
296297
mkdir toolchain
297-
tar -I '${{ inputs.sycl_toolchain_decompress_command }}' -xf ${{ inputs.sycl_toolchain_archive }} -C toolchain
298-
rm -f ${{ inputs.sycl_toolchain_archive }}
298+
tar -I '${{ inputs.toolchain_decompress_command }}' -xf ${{ inputs.toolchain_artifact_filename }} -C toolchain
299+
rm -f ${{ inputs.toolchain_artifact_filename }}
299300
echo PATH=$PWD/toolchain/bin/:$PATH >> $GITHUB_ENV
300301
echo LD_LIBRARY_PATH=$PWD/toolchain/lib/:$LD_LIBRARY_PATH >> $GITHUB_ENV
301302
- run: which clang++ sycl-ls

.github/workflows/sycl-nightly-benchmarking.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,11 @@ jobs:
1414
secrets: inherit
1515
with:
1616
build_cache_root: "/__w/"
17-
build_artifact_suffix: default
1817
build_configure_extra_args: '--no-assertions'
1918
build_image: ghcr.io/intel/llvm/ubuntu2404_build:latest
20-
artifact_archive_name: sycl_linux.tar.gz
19+
20+
toolchain_artifact: sycl_linux_default
21+
toolchain_artifact_filename: sycl_linux.tar.gz
2122

2223
run-sycl-benchmarks:
2324
needs: [ubuntu2204_build]
@@ -44,7 +45,7 @@ jobs:
4445
benchmark_save_name: ${{ matrix.save_name }}
4546
benchmark_preset: ${{ matrix.preset }}
4647
repo_ref: ${{ matrix.ref }}
47-
sycl_toolchain_artifact: sycl_linux_default
48-
sycl_toolchain_archive: ${{ needs.ubuntu2204_build.outputs.artifact_archive_name }}
49-
sycl_toolchain_decompress_command: ${{ needs.ubuntu2204_build.outputs.artifact_decompress_command }}
48+
toolchain_artifact: ${{ needs.ubuntu2204_build.outputs.toolchain_artifact }}
49+
toolchain_artifact_filename: ${{ needs.ubuntu2204_build.outputs.toolchain_artifact_filename }}
50+
toolchain_decompress_command: ${{ needs.ubuntu2204_build.outputs.toolchain_decompress_command }}
5051

0 commit comments

Comments
 (0)