Skip to content

Commit 9440df5

Browse files
[CI] Don't rely on github.event_name in devops/actions/run-tests/e2e/action.yml (#20580)
This effectively reverts "[CI] Use E2E container binaries in `run-only` manual E2E task dispatch (#19744)" The problem is that `github.event_name` corresponds to the top-level workflow, not how `.github/workflows/sycl-linux-run-tests.yml` was triggered, effectively doing the wrong thing for the manual dispatch of (at least) post-commit workflow. Instead of that, add a new fake input parameter for the `workflow_call` trigger in `sycl-linux-run-tests.yml` to use as the condition.
1 parent ebbdd1f commit 9440df5

File tree

2 files changed

+21
-21
lines changed

2 files changed

+21
-21
lines changed

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

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,16 @@ on:
135135
default: 'false'
136136
required: False
137137

138+
in_workflow_call_mode:
139+
description: |
140+
Unlike `github.event_type` that captures the original trigger, we use
141+
this to determine how this particular workflow has been called. This
142+
isn't supposed to be specified by a caller and only relies on the
143+
default value.
144+
default: 'true'
145+
required: False
146+
type: string
147+
138148
workflow_dispatch:
139149
inputs:
140150
runner:
@@ -332,7 +342,9 @@ jobs:
332342
timeout-minutes: 60
333343
with:
334344
ref: ${{ inputs.tests_ref || inputs.repo_ref || github.sha }}
335-
binaries_artifact: ${{ inputs.binaries_artifact }}
345+
binaries_artifact: ${{ inputs.in_workflow_call_mode && inputs.binaries_artifact
346+
|| inputs.testing_mode == 'run-only' && 'in-container'
347+
|| '' }}
336348
testing_mode: ${{ inputs.testing_mode }}
337349
extra_cmake_args: ${{ inputs.extra_cmake_args }}
338350
target_devices: ${{ inputs.target_devices }}
@@ -349,7 +361,9 @@ jobs:
349361
ref: ${{ inputs.tests_ref || 'main' }}
350362
extra_cmake_args: ${{ inputs.extra_cmake_args }}
351363
testing_mode: ${{ inputs.testing_mode }}
352-
binaries_artifact: ${{ inputs.binaries_artifact }}
364+
binaries_artifact: ${{ inputs.in_workflow_call_mode && inputs.binaries_artifact
365+
|| inputs.testing_mode == 'run-only' && 'in-container'
366+
|| '' }}
353367
target_devices: ${{ inputs.target_devices }}
354368
retention-days: ${{ inputs.retention-days }}
355369

devops/actions/run-tests/e2e/action.yml

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ inputs:
44
ref:
55
required: false
66
binaries_artifact:
7-
# Number of input parameters for manual 'workflow_dispatch' is limited, so
8-
# we treat empty value as 'in-container' when in 'run-only' mode via
9-
# 'workflow_dispatch'.
107
required: false
118
testing_mode:
129
required: true
@@ -22,14 +19,12 @@ inputs:
2219
sycl_compiler:
2320
required: false
2421

22+
2523
runs:
2624
using: "composite"
2725
steps:
2826
- name: Checkout E2E tests
29-
if: |
30-
!(inputs.testing_mode == 'run-only'
31-
&& (inputs.binaries_artifact == 'in-container'
32-
|| github.event_name == 'workflow_dispatch'))
27+
if: ${{ !(inputs.testing_mode == 'run-only' && inputs.binaries_artifact == 'in-container') }}
3328
uses: actions/checkout@v4
3429
with:
3530
path: llvm
@@ -38,28 +33,19 @@ runs:
3833
llvm/utils/lit
3934
sycl/test-e2e
4035
- name: Download E2E Binaries
41-
if: |
42-
inputs.testing_mode == 'run-only'
43-
&& !(inputs.binaries_artifact == 'in-container'
44-
|| github.event_name == 'workflow_dispatch')
36+
if: ${{ inputs.testing_mode == 'run-only' && inputs.binaries_artifact != 'in-container' }}
4537
uses: actions/download-artifact@v4
4638
with:
4739
name: ${{ inputs.binaries_artifact }}
4840
- name: Extract E2E Binaries
49-
if: |
50-
inputs.testing_mode == 'run-only'
51-
&& !(inputs.binaries_artifact == 'in-container'
52-
|| github.event_name == 'workflow_dispatch')
41+
if: ${{ inputs.testing_mode == 'run-only' && inputs.binaries_artifact != 'in-container' }}
5342
shell: bash
5443
run: |
5544
mkdir build-e2e
5645
tar -I 'zstd' -xf e2e_binaries.tar.zst -C build-e2e
5746
5847
- name: Extract E2E tests from container image
59-
if: |
60-
inputs.testing_mode == 'run-only'
61-
&& (inputs.binaries_artifact == 'in-container'
62-
|| github.event_name == 'workflow_dispatch')
48+
if: ${{ inputs.testing_mode == 'run-only' && inputs.binaries_artifact == 'in-container' }}
6349
shell: bash
6450
run: |
6551
mkdir build-e2e llvm

0 commit comments

Comments
 (0)