@@ -2,23 +2,10 @@ name: tests
2
2
3
3
on :
4
4
pull_request :
5
- paths :
6
- - " .github/workflows/tests.yml"
7
- - " pymc/**.py"
8
- - " *.py"
9
- - " conda-envs/**"
10
- - " codecov.yml"
11
- - " requirements*.txt"
12
- - " scripts/*.sh"
13
5
push :
14
- branches : [main]
15
- paths :
16
- - " .github/workflows/tests.yml"
17
- - " pymc/**.py"
18
- - " *.py"
19
- - " conda-envs/**"
20
- - " codecov.yml"
21
- - " scripts/*.sh"
6
+ branches :
7
+ - main
8
+
22
9
23
10
# Tests are split into multiple jobs to accelerate the CI.
24
11
# Different jobs should be organized to take approximately the same
30
17
# enforces that test run just once per OS / floatX setting.
31
18
32
19
jobs :
20
+
21
+ changes :
22
+ name : " Check for changes"
23
+ runs-on : ubuntu-latest
24
+ outputs :
25
+ changes : ${{ steps.changes.outputs.src }}
26
+ steps :
27
+ - uses : actions/checkout@v3
28
+ with :
29
+ fetch-depth : 0
30
+ - uses : dorny/paths-filter@v2
31
+ id : changes
32
+ with :
33
+ filters : |
34
+ src:
35
+ - ".github/workflows/tests.yml"
36
+ - "pymc/**.py"
37
+ - "tests/**.py"
38
+ - "*.py"
39
+ - "conda-envs/**"
40
+ - "requirements*.txt"
41
+ - "codecov.yml"
42
+ - "scripts/*.sh"
43
+
33
44
ubuntu :
45
+ needs : changes
46
+ if : ${{ needs.changes.outputs.changes == 'true' }}
34
47
strategy :
35
48
matrix :
36
49
os : [ubuntu-20.04]
@@ -160,7 +173,10 @@ jobs:
160
173
env_vars : TEST_SUBSET
161
174
name : ${{ matrix.os }} ${{ matrix.floatx }}
162
175
fail_ci_if_error : false
176
+
163
177
windows :
178
+ needs : changes
179
+ if : ${{ needs.changes.outputs.changes == 'true' }}
164
180
strategy :
165
181
matrix :
166
182
os : [windows-latest]
@@ -233,7 +249,10 @@ jobs:
233
249
env_vars : TEST_SUBSET
234
250
name : ${{ matrix.os }} ${{ matrix.floatx }}
235
251
fail_ci_if_error : false
252
+
236
253
macos :
254
+ needs : changes
255
+ if : ${{ needs.changes.outputs.changes == 'true' }}
237
256
strategy :
238
257
matrix :
239
258
os : [macos-latest]
@@ -309,7 +328,10 @@ jobs:
309
328
env_vars : TEST_SUBSET
310
329
name : ${{ matrix.os }} ${{ matrix.floatx }}
311
330
fail_ci_if_error : false
331
+
312
332
external_samplers :
333
+ needs : changes
334
+ if : ${{ needs.changes.outputs.changes == 'true' }}
313
335
strategy :
314
336
matrix :
315
337
os : [ubuntu-20.04]
@@ -379,7 +401,10 @@ jobs:
379
401
env_vars : TEST_SUBSET
380
402
name : JAX tests - ${{ matrix.os }} ${{ matrix.floatx }}
381
403
fail_ci_if_error : false
404
+
382
405
float32 :
406
+ needs : changes
407
+ if : ${{ needs.changes.outputs.changes == 'true' }}
383
408
strategy :
384
409
matrix :
385
410
os : [windows-latest]
@@ -448,3 +473,17 @@ jobs:
448
473
env_vars : TEST_SUBSET
449
474
name : ${{ matrix.os }} ${{ matrix.floatx }}
450
475
fail_ci_if_error : false
476
+
477
+ all_tests :
478
+ if : ${{ always() }}
479
+ runs-on : ubuntu-latest
480
+ needs : [ changes, ubuntu, windows, macos, external_samplers, float32 ]
481
+ steps :
482
+ - name : Check build matrix status
483
+ if : ${{ needs.changes.outputs.changes == 'true' &&
484
+ ( needs.ubuntu.result != 'success' ||
485
+ needs.windows.result != 'success' ||
486
+ needs.macos.result != 'success' ||
487
+ needs.external_samplers.result != 'success' ||
488
+ needs.float32.result != 'success' ) }}
489
+ run : exit 1
0 commit comments