|
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"
|
|
28 | 30 | TESTDATA_REPORTS_PATH: .github/workflows/testdata/reports
|
29 | 31 |
|
30 | 32 | jobs:
|
| 33 | + run-determination: |
| 34 | + runs-on: ubuntu-latest |
| 35 | + outputs: |
| 36 | + result: ${{ steps.determination.outputs.result }} |
| 37 | + steps: |
| 38 | + - name: Determine if the rest of the workflow should run |
| 39 | + id: determination |
| 40 | + run: | |
| 41 | + RELEASE_BRANCH_REGEX="^refs/heads/v[0-9]+$" |
| 42 | + # The `create` event trigger doesn't support `branches` filters, so it's necessary to use Bash instead. |
| 43 | + if [[ |
| 44 | + "${{ github.event_name }}" != "create" || |
| 45 | + "${{ github.ref }}" =~ $RELEASE_BRANCH_REGEX |
| 46 | + ]]; then |
| 47 | + # Run the other jobs. |
| 48 | + RESULT="true" |
| 49 | + else |
| 50 | + # There is no need to run the other jobs. |
| 51 | + RESULT="false" |
| 52 | + fi |
| 53 | +
|
| 54 | + echo "result=$RESULT" >> $GITHUB_OUTPUT |
| 55 | +
|
31 | 56 | default-inputs:
|
| 57 | + needs: run-determination |
| 58 | + if: needs.run-determination.outputs.result == 'true' |
32 | 59 | runs-on: ubuntu-latest
|
33 | 60 |
|
34 | 61 | steps:
|
|
49 | 76 | uses: ./extras/compile-sketches
|
50 | 77 |
|
51 | 78 | all-inputs:
|
| 79 | + needs: run-determination |
| 80 | + if: needs.run-determination.outputs.result == 'true' |
52 | 81 | runs-on: ubuntu-latest
|
53 | 82 |
|
54 | 83 | strategy:
|
@@ -120,6 +149,8 @@ jobs:
|
120 | 149 |
|
121 | 150 | multiple-steps:
|
122 | 151 | name: multiple-steps (${{ matrix.board.source-type }})
|
| 152 | + needs: run-determination |
| 153 | + if: needs.run-determination.outputs.result == 'true' |
123 | 154 | runs-on: ubuntu-latest
|
124 | 155 |
|
125 | 156 | strategy:
|
@@ -209,6 +240,8 @@ jobs:
|
209 | 240 | - examples/Sweep
|
210 | 241 |
|
211 | 242 | python-package-dependency:
|
| 243 | + needs: run-determination |
| 244 | + if: needs.run-determination.outputs.result == 'true' |
212 | 245 | runs-on: ubuntu-latest
|
213 | 246 |
|
214 | 247 | steps:
|
@@ -239,6 +272,8 @@ jobs:
|
239 | 272 |
|
240 | 273 | # Targeted testing for ESP32 boards platform support.
|
241 | 274 | pyserial-dependency:
|
| 275 | + needs: run-determination |
| 276 | + if: needs.run-determination.outputs.result == 'true' |
242 | 277 | runs-on: ubuntu-latest
|
243 | 278 |
|
244 | 279 | steps:
|
@@ -267,7 +302,10 @@ jobs:
|
267 | 302 | - ${{ env.TESTDATA_SKETCHES_PATH }}/BareMinimum
|
268 | 303 |
|
269 | 304 | check-sketches-reports:
|
270 |
| - needs: all-inputs |
| 305 | + needs: |
| 306 | + - run-determination |
| 307 | + - all-inputs |
| 308 | + if: needs.run-determination.outputs.result == 'true' |
271 | 309 | runs-on: ubuntu-latest
|
272 | 310 |
|
273 | 311 | steps:
|
@@ -334,6 +372,8 @@ jobs:
|
334 | 372 | exit $EXIT_STATUS
|
335 | 373 |
|
336 | 374 | expected-failed-compilation:
|
| 375 | + needs: run-determination |
| 376 | + if: needs.run-determination.outputs.result == 'true' |
337 | 377 | runs-on: ubuntu-latest
|
338 | 378 |
|
339 | 379 | steps:
|
|
0 commit comments