@@ -17,9 +17,34 @@ concurrency:
1717 cancel-in-progress : true
1818
1919jobs :
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+
2038 # The job to build precompiled pypi wheels.
2139 make_sdist :
2240 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')
2348 runs-on : ubuntu-latest
2449 permissions :
2550 # write id-token and attestations are required to attest build provenance
4974
5075 run_checks :
5176 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')
5284 # Note: the resulting builds are not actually published.
5385 # This is purely for additional testing and diagnostic purposes.
5486 runs-on : ubuntu-latest
6294
6395 build_wheels :
6496 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')
65104 runs-on : ${{ matrix.platform }}
66105 permissions :
67106 # write id-token and attestations are required to attest build provenance
@@ -96,6 +135,13 @@ jobs:
96135
97136 build_universal_wheel :
98137 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')
99145 runs-on : ubuntu-latest
100146 permissions :
101147 # write id-token and attestations are required to attest build provenance
@@ -133,7 +179,12 @@ jobs:
133179
134180 check_dist :
135181 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')
137188 runs-on : ubuntu-22.04
138189 steps :
139190 - uses : actions/download-artifact@v4
0 commit comments