@@ -17,9 +17,34 @@ concurrency:
17
17
cancel-in-progress : true
18
18
19
19
jobs :
20
+ check_changes :
21
+ runs-on : ubuntu-latest
22
+ outputs :
23
+ should_run : ${{ steps.filter.outputs.any_changed }}
24
+ steps :
25
+ - uses : actions/checkout@v4
26
+ - uses : dorny/paths-filter@v2
27
+ id : filter
28
+ with :
29
+ filters : |
30
+ any_changed:
31
+ - '.github/workflows/pypi.yml'
32
+ - 'pyproject.toml'
33
+ - 'setup.py'
34
+ - 'pytensor/_version.py'
35
+ - 'pytensor/scan_perform.pyx'
36
+ - 'pytensor/scan_perform_ext.py'
37
+
20
38
# The job to build precompiled pypi wheels.
21
39
make_sdist :
22
40
name : Make SDist
41
+ needs : check_changes
42
+ # Run if it's a release, auto-release branch, or if relevant files changed on main
43
+ if : |
44
+ github.event_name == 'release' ||
45
+ github.ref == 'refs/heads/auto-release' ||
46
+ (github.ref == 'refs/heads/main' && needs.check_changes.outputs.should_run == 'true') ||
47
+ (github.event_name == 'pull_request' && needs.check_changes.outputs.should_run == 'true')
23
48
runs-on : ubuntu-latest
24
49
permissions :
25
50
# write id-token and attestations are required to attest build provenance
49
74
50
75
run_checks :
51
76
name : Build & inspect our package.
77
+ needs : check_changes
78
+ # Run if it's a release, auto-release branch, or if relevant files changed on main
79
+ if : |
80
+ github.event_name == 'release' ||
81
+ github.ref == 'refs/heads/auto-release' ||
82
+ (github.ref == 'refs/heads/main' && needs.check_changes.outputs.should_run == 'true') ||
83
+ (github.event_name == 'pull_request' && needs.check_changes.outputs.should_run == 'true')
52
84
# Note: the resulting builds are not actually published.
53
85
# This is purely for additional testing and diagnostic purposes.
54
86
runs-on : ubuntu-latest
62
94
63
95
build_wheels :
64
96
name : Build wheels for ${{ matrix.platform }}
97
+ needs : check_changes
98
+ # Run if it's a release, auto-release branch, or if relevant files changed on main
99
+ if : |
100
+ github.event_name == 'release' ||
101
+ github.ref == 'refs/heads/auto-release' ||
102
+ (github.ref == 'refs/heads/main' && needs.check_changes.outputs.should_run == 'true') ||
103
+ (github.event_name == 'pull_request' && needs.check_changes.outputs.should_run == 'true')
65
104
runs-on : ${{ matrix.platform }}
66
105
permissions :
67
106
# write id-token and attestations are required to attest build provenance
@@ -96,6 +135,13 @@ jobs:
96
135
97
136
build_universal_wheel :
98
137
name : Build universal wheel for Pyodide
138
+ needs : check_changes
139
+ # Run if it's a release, auto-release branch, or if relevant files changed on main
140
+ if : |
141
+ github.event_name == 'release' ||
142
+ github.ref == 'refs/heads/auto-release' ||
143
+ (github.ref == 'refs/heads/main' && needs.check_changes.outputs.should_run == 'true') ||
144
+ (github.event_name == 'pull_request' && needs.check_changes.outputs.should_run == 'true')
99
145
runs-on : ubuntu-latest
100
146
permissions :
101
147
# write id-token and attestations are required to attest build provenance
@@ -133,7 +179,12 @@ jobs:
133
179
134
180
check_dist :
135
181
name : Check dist
136
- needs : [make_sdist,build_wheels]
182
+ needs : [check_changes, make_sdist, build_wheels]
183
+ if : |
184
+ github.event_name == 'release' ||
185
+ github.ref == 'refs/heads/auto-release' ||
186
+ (github.ref == 'refs/heads/main' && needs.check_changes.outputs.should_run == 'true') ||
187
+ (github.event_name == 'pull_request' && needs.check_changes.outputs.should_run == 'true')
137
188
runs-on : ubuntu-22.04
138
189
steps :
139
190
- uses : actions/download-artifact@v4
0 commit comments