|
1 | 1 | name: Run integration tests
|
2 | 2 |
|
3 | 3 | on:
|
| 4 | + create: |
| 5 | + |
4 | 6 | pull_request:
|
5 | 7 | paths:
|
6 | 8 | - ".github/workflows/test-integration.yml"
|
|
21 | 23 | - "action.yml"
|
22 | 24 | - "compilesketches/**"
|
23 | 25 |
|
| 26 | + repository_dispatch: |
| 27 | + |
| 28 | + schedule: |
| 29 | + # Run periodically to catch breakage caused by external changes. |
| 30 | + - cron: "0 12 * * THU" |
| 31 | + |
| 32 | + workflow_dispatch: |
| 33 | + |
24 | 34 | env:
|
25 | 35 | SKETCHES_REPORTS_PATH: sketches-reports
|
26 | 36 | TESTDATA_PLATFORMS_PATH: .github/workflows/testdata/platforms
|
27 | 37 | TESTDATA_SKETCHES_PATH: .github/workflows/testdata/sketches
|
28 | 38 | TESTDATA_REPORTS_PATH: .github/workflows/testdata/reports
|
29 | 39 |
|
30 | 40 | jobs:
|
| 41 | + run-determination: |
| 42 | + runs-on: ubuntu-latest |
| 43 | + outputs: |
| 44 | + result: ${{ steps.determination.outputs.result }} |
| 45 | + steps: |
| 46 | + - name: Determine if the rest of the workflow should run |
| 47 | + id: determination |
| 48 | + run: | |
| 49 | + RELEASE_BRANCH_REGEX="^refs/heads/v[0-9]+$" |
| 50 | + # The `create` event trigger doesn't support `branches` filters, so it's necessary to use Bash instead. |
| 51 | + if [[ |
| 52 | + "${{ github.event_name }}" != "create" || |
| 53 | + "${{ github.ref }}" =~ $RELEASE_BRANCH_REGEX |
| 54 | + ]]; then |
| 55 | + # Run the other jobs. |
| 56 | + RESULT="true" |
| 57 | + else |
| 58 | + # There is no need to run the other jobs. |
| 59 | + RESULT="false" |
| 60 | + fi |
| 61 | +
|
| 62 | + echo "result=$RESULT" >> $GITHUB_OUTPUT |
| 63 | +
|
31 | 64 | default-inputs:
|
| 65 | + needs: run-determination |
| 66 | + if: needs.run-determination.outputs.result == 'true' |
32 | 67 | runs-on: ubuntu-latest
|
33 | 68 |
|
34 | 69 | steps:
|
|
49 | 84 | uses: ./extras/compile-sketches
|
50 | 85 |
|
51 | 86 | all-inputs:
|
| 87 | + needs: run-determination |
| 88 | + if: needs.run-determination.outputs.result == 'true' |
52 | 89 | runs-on: ubuntu-latest
|
53 | 90 |
|
54 | 91 | strategy:
|
@@ -120,6 +157,8 @@ jobs:
|
120 | 157 |
|
121 | 158 | multiple-steps:
|
122 | 159 | name: multiple-steps (${{ matrix.board.source-type }})
|
| 160 | + needs: run-determination |
| 161 | + if: needs.run-determination.outputs.result == 'true' |
123 | 162 | runs-on: ubuntu-latest
|
124 | 163 |
|
125 | 164 | strategy:
|
@@ -209,6 +248,8 @@ jobs:
|
209 | 248 | - examples/Sweep
|
210 | 249 |
|
211 | 250 | python-package-dependency:
|
| 251 | + needs: run-determination |
| 252 | + if: needs.run-determination.outputs.result == 'true' |
212 | 253 | runs-on: ubuntu-latest
|
213 | 254 |
|
214 | 255 | steps:
|
@@ -239,6 +280,8 @@ jobs:
|
239 | 280 |
|
240 | 281 | # Targeted testing for ESP32 boards platform support.
|
241 | 282 | pyserial-dependency:
|
| 283 | + needs: run-determination |
| 284 | + if: needs.run-determination.outputs.result == 'true' |
242 | 285 | runs-on: ubuntu-latest
|
243 | 286 |
|
244 | 287 | steps:
|
@@ -267,7 +310,10 @@ jobs:
|
267 | 310 | - ${{ env.TESTDATA_SKETCHES_PATH }}/BareMinimum
|
268 | 311 |
|
269 | 312 | check-sketches-reports:
|
270 |
| - needs: all-inputs |
| 313 | + needs: |
| 314 | + - run-determination |
| 315 | + - all-inputs |
| 316 | + if: needs.run-determination.outputs.result == 'true' |
271 | 317 | runs-on: ubuntu-latest
|
272 | 318 |
|
273 | 319 | steps:
|
@@ -334,6 +380,8 @@ jobs:
|
334 | 380 | exit $EXIT_STATUS
|
335 | 381 |
|
336 | 382 | expected-failed-compilation:
|
| 383 | + needs: run-determination |
| 384 | + if: needs.run-determination.outputs.result == 'true' |
337 | 385 | runs-on: ubuntu-latest
|
338 | 386 |
|
339 | 387 | steps:
|
|
0 commit comments