Skip to content

Commit 359518b

Browse files
[CI] New Trigger function for windows CI (#1479)
1 parent 7d5bb13 commit 359518b

File tree

2 files changed

+46
-3
lines changed

2 files changed

+46
-3
lines changed

.github/workflows/_windows_ut.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,16 @@ on:
3333
type: string
3434
default: '2025.0'
3535
description: Python version
36+
files-changed:
37+
required: true
38+
type: string
39+
default: 'false'
40+
description: Check if filtered file changed
41+
has-label:
42+
required: true
43+
type: string
44+
default: 'false'
45+
description: Check if labelled
3646

3747
permissions: read-all
3848

@@ -42,6 +52,7 @@ env:
4252
jobs:
4353
Torch-XPU-Windows-UT:
4454
runs-on: ${{ inputs.runner }}
55+
if: ${{ inputs.files-changed == 'true' || inputs.has-label == 'true' }}
4556
timeout-minutes: 900
4657
steps:
4758
- name: Checkout torch-xpu-ops

.github/workflows/pull.yml

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,13 +222,45 @@ jobs:
222222
pytorch: ${{ needs.preci-linux-build-abi-0.outputs.torch_commit_id }}
223223
ut: op_extended
224224
runner: linux.idc.xpu
225-
225+
226+
check-conditions:
227+
if: ${{ github.repository_owner == 'intel' }}
228+
name: preci-win-conditions-filter
229+
runs-on: ubuntu-22.04
230+
outputs:
231+
files-changed: ${{ steps.check-files.outputs.src_changed }}
232+
has-label: ${{ steps.check-label.outputs.results }}
233+
steps:
234+
- uses: dorny/paths-filter@v2
235+
id: check-files
236+
with:
237+
filters: |
238+
src_changed:
239+
- 'cmake/**'
240+
- 'tools/**'
241+
- 'src/**.cmake'
242+
- 'CMakeLists.txt'
243+
- 'test/sycl/CMakeLists.txt'
244+
- 'src/xccl/CMakeLists.txt'
245+
- 'src/ATen/CMakeLists.txt'
246+
- 'src/CMakeLists.txt'
247+
- '.github/workflows/_windows_ut.yml'
248+
249+
- name: Check Label
250+
id: check-label
251+
run: |
252+
LABEL_EXISTS=$(echo '${{ toJSON(github.event.pull_request.labels) }}' | jq 'any(.name == "windows_ci")')
253+
echo $LABEL_EXISTS
254+
echo "results=$LABEL_EXISTS" >> $GITHUB_OUTPUT
255+
226256
preci-windows:
227257
# Don't run on forked repos and draft PRs
228-
if: ${{ (github.repository_owner == 'intel') && (github.event.pull_request.draft == false) && contains(github.event.pull_request.labels.*.name, 'windows_ci') }}
258+
if: ${{ (github.repository_owner == 'intel') && (github.event.pull_request.draft == false) }}
229259
name: preci-windows
230-
needs: preci-lint-check
260+
needs: [preci-lint-check, check-conditions]
231261
uses: ./.github/workflows/_windows_ut.yml
232262
with:
233263
ut: op_extended
234264
runner: Windows_CI
265+
files-changed: ${{ needs.check-conditions.outputs.files-changed }}
266+
has-label: ${{ needs.check-conditions.outputs.has-label }}

0 commit comments

Comments
 (0)