File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66 branches :
77 - main
88 - release-*
9- paths :
10- - ' python/**'
11- - ' protocol/**'
129 pull_request :
13- # running for all, since github does not detect skipped on this when required for merging
14- # paths:
15- # - 'python/**'
16- # - 'protocol/**'
10+ branches :
11+ - main
12+ - ' release-*'
1713 merge_group :
1814
1915permissions :
2016 contents : read
2117 pull-requests : read
2218
2319jobs :
20+ changes :
21+ if : github.repository_owner == 'jumpstarter-dev'
22+ runs-on : ubuntu-latest
23+ outputs :
24+ should_run : ${{ steps.filter.outputs.python }}
25+ steps :
26+ - uses : actions/checkout@v4
27+ with :
28+ fetch-depth : 0
29+ - uses : dorny/paths-filter@v3
30+ id : filter
31+ with :
32+ base : ${{ github.base_ref || github.event.merge_group.base_ref || 'main' }}
33+ filters : |
34+ python:
35+ - 'python/**'
36+ - '.github/workflows/python-tests.yaml'
37+
2438 pytest-matrix :
39+ needs : changes
40+ if : needs.changes.outputs.should_run == 'true' || github.event_name == 'workflow_dispatch'
2541 runs-on : ${{ matrix.runs-on }}
2642 strategy :
2743 matrix :
@@ -89,13 +105,14 @@ jobs:
89105 # https://github.com/orgs/community/discussions/26822
90106 pytest :
91107 runs-on : ubuntu-latest
92- needs : [pytest-matrix]
108+ needs : [changes, pytest-matrix]
93109 if : ${{ always() }}
94110 steps :
95111 - run : exit 1
112+ # Fail on failures or cancellations, but allow skips when no relevant changes
96113 if : >-
97114 ${{
98115 contains(needs.*.result, 'failure')
99116 || contains(needs.*.result, 'cancelled')
100- || contains(needs.*.result, 'skipped')
117+ || ( contains(needs.*.result, 'skipped') && needs.changes.outputs.should_run == 'true ')
101118 }}
You can’t perform that action at this time.
0 commit comments