Skip to content

Commit 043a3a1

Browse files
authored
Gate Metal and CUDA CI workflows on path and ciflow labels (pytorch#18246)
Metal and CUDA backend tests were running on every PR regardless of which files were changed. Gate them so they only run when: - Files in backends/apple/metal/**, backends/cuda/**, or backends/aoti/** are touched (aoti is shared by both backends) - The workflow file itself is modified - A ciflow/metal or ciflow/cuda label is added to the PR - Code is pushed to main or release branches This reduces CI load for PRs that don't touch these backends.
1 parent b7ca1a4 commit 043a3a1

4 files changed

Lines changed: 26 additions & 3 deletions

File tree

.github/pytorch-probot.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ tracking_issue: 7679
33
ciflow_push_tags:
44
- ciflow/android
55
- ciflow/apple
6+
- ciflow/cuda
7+
- ciflow/metal
68
- ciflow/nightly
79
- ciflow/trunk
810
- ciflow/binaries

.github/workflows/cuda-windows.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,18 @@
55
name: Test CUDA Windows Export and E2E
66

77
on:
8-
pull_request:
98
push:
109
branches:
1110
- main
1211
- release/*
12+
tags:
13+
- ciflow/cuda/*
14+
pull_request:
15+
paths:
16+
- .github/workflows/cuda-windows.yml
17+
- backends/cuda/**
18+
- backends/aoti/**
19+
workflow_dispatch:
1320

1421
concurrency:
1522
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }}-${{ github.event_name == 'schedule' }}

.github/workflows/cuda.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,18 @@
99
name: Test CUDA Builds
1010

1111
on:
12-
pull_request:
1312
push:
1413
branches:
1514
- main
1615
- release/*
16+
tags:
17+
- ciflow/cuda/*
18+
pull_request:
19+
paths:
20+
- .github/workflows/cuda.yml
21+
- backends/cuda/**
22+
- backends/aoti/**
23+
workflow_dispatch:
1724

1825
concurrency:
1926
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }}-${{ github.event_name == 'schedule' }}

.github/workflows/metal.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11
name: Test Metal Backend
22

33
on:
4-
pull_request:
54
push:
65
branches:
76
- main
87
- release/*
8+
tags:
9+
- ciflow/metal/*
10+
pull_request:
11+
paths:
12+
- .github/workflows/metal.yml
13+
- backends/apple/metal/**
14+
- backends/aoti/**
15+
workflow_dispatch:
916

1017
concurrency:
1118
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }}-${{ github.event_name == 'schedule' }}

0 commit comments

Comments
 (0)