File tree 2 files changed +36
-27
lines changed
2 files changed +36
-27
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -2,20 +2,32 @@ name: Matrix Test
2
2
on :
3
3
push :
4
4
branches : [main, devel]
5
- paths :
6
- - " ultraplot/**"
7
5
pull_request :
8
6
branches : [main, devel]
9
- paths :
10
- - " ultraplot/**"
11
7
12
8
concurrency :
13
9
group : ${{ github.workflow }}-${{ github.ref }}
14
10
cancel-in-progress : true
15
11
16
12
jobs :
13
+ run-if-changes :
14
+ runs-on : ubuntu-latest
15
+ outputs :
16
+ run : ${{ steps.filter.outputs.python }}
17
+ steps :
18
+ - uses : actions/checkout@v4
19
+ - uses : dorny/paths-filter@v3
20
+ id : filter
21
+ with :
22
+ filters : |
23
+ python:
24
+ - 'ultraplot/**'
25
+
17
26
get-versions :
18
27
runs-on : ubuntu-latest
28
+ needs :
29
+ - run-if-changes
30
+ if : always() && needs.run-if-changes.outputs.run == 'true'
19
31
outputs :
20
32
python-versions : ${{ steps.set-versions.outputs.python-versions }}
21
33
matplotlib-versions : ${{ steps.set-versions.outputs.matplotlib-versions }}
@@ -110,7 +122,10 @@ jobs:
110
122
echo "matplotlib-versions=$(echo $MPL_VERSIONS | jq -c)" >> $GITHUB_OUTPUT
111
123
112
124
build :
113
- needs : get-versions
125
+ needs :
126
+ - get-versions
127
+ - run-if-changes
128
+ if : always() && needs.run-if-changes.outputs.run == 'true' && needs.get-versions.result == 'success'
114
129
strategy :
115
130
matrix :
116
131
python-version : ${{ fromJson(needs.get-versions.outputs.python-versions) }}
@@ -122,7 +137,21 @@ jobs:
122
137
matplotlib-version : ${{ matrix.matplotlib-version }}
123
138
124
139
build-success :
125
- needs : build
140
+ needs :
141
+ - build
142
+ - run-if-changes
143
+ if : always()
126
144
runs-on : ubuntu-latest
127
145
steps :
128
- - run : echo "All tests passed successfully!"
146
+ - run : |
147
+ if [[ '${{ needs.run-if-changes.outputs.run }}' == 'false' ]]; then
148
+ echo "No changes detected, tests skipped."
149
+ else
150
+ if [[ '${{ needs.build.result }}' == 'success' ]]; then
151
+ echo "All tests passed successfully!"
152
+ else
153
+ echo "Tests failed!"
154
+ exit 1
155
+ fi
156
+ fi
157
+
You can’t perform that action at this time.
0 commit comments