Skip to content

Commit 1a36eaa

Browse files
authored
Merge pull request #124 from per1234/triggers
Add additional triggers to integration test workflow
2 parents b3ab95f + e6e67e5 commit 1a36eaa

14 files changed

+62
-14
lines changed

.github/workflows/check-action-metadata-task.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
- name: Determine if the rest of the workflow should run
3838
id: determination
3939
run: |
40-
RELEASE_BRANCH_REGEX="refs/heads/[0-9]+.[0-9]+.x"
40+
RELEASE_BRANCH_REGEX="^refs/heads/v[0-9]+$"
4141
# The `create` event trigger doesn't support `branches` filters, so it's necessary to use Bash instead.
4242
if [[
4343
"${{ github.event_name }}" != "create" ||

.github/workflows/check-files-task.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- name: Determine if the rest of the workflow should run
2222
id: determination
2323
run: |
24-
RELEASE_BRANCH_REGEX="refs/heads/[0-9]+.[0-9]+.x"
24+
RELEASE_BRANCH_REGEX="^refs/heads/v[0-9]+$"
2525
# The `create` event trigger doesn't support `branches` filters, so it's necessary to use Bash instead.
2626
if [[
2727
"${{ github.event_name }}" != "create" ||

.github/workflows/check-general-formatting-task.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- name: Determine if the rest of the workflow should run
2222
id: determination
2323
run: |
24-
RELEASE_BRANCH_REGEX="refs/heads/[0-9]+.[0-9]+.x"
24+
RELEASE_BRANCH_REGEX="^refs/heads/v[0-9]+$"
2525
# The `create` event trigger doesn't support `branches` filters, so it's necessary to use Bash instead.
2626
if [[
2727
"${{ github.event_name }}" != "create" ||

.github/workflows/check-license.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
- name: Determine if the rest of the workflow should run
4242
id: determination
4343
run: |
44-
RELEASE_BRANCH_REGEX="refs/heads/[0-9]+.[0-9]+.x"
44+
RELEASE_BRANCH_REGEX="^refs/heads/v[0-9]+$"
4545
# The `create` event trigger doesn't support `branches` filters, so it's necessary to use Bash instead.
4646
if [[
4747
"${{ github.event_name }}" != "create" ||

.github/workflows/check-markdown-task.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
- name: Determine if the rest of the workflow should run
4848
id: determination
4949
run: |
50-
RELEASE_BRANCH_REGEX="refs/heads/[0-9]+.[0-9]+.x"
50+
RELEASE_BRANCH_REGEX="^refs/heads/v[0-9]+$"
5151
# The `create` event trigger doesn't support `branches` filters, so it's necessary to use Bash instead.
5252
if [[
5353
"${{ github.event_name }}" != "create" ||

.github/workflows/check-npm-task.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
- name: Determine if the rest of the workflow should run
3939
id: determination
4040
run: |
41-
RELEASE_BRANCH_REGEX="refs/heads/[0-9]+.[0-9]+.x"
41+
RELEASE_BRANCH_REGEX="^refs/heads/v[0-9]+$"
4242
# The `create` event trigger doesn't support `branches` filters, so it's necessary to use Bash instead.
4343
if [[
4444
"${{ github.event_name }}" != "create" ||

.github/workflows/check-prettier-formatting-task.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ jobs:
215215
- name: Determine if the rest of the workflow should run
216216
id: determination
217217
run: |
218-
RELEASE_BRANCH_REGEX="refs/heads/[0-9]+.[0-9]+.x"
218+
RELEASE_BRANCH_REGEX="^refs/heads/v[0-9]+$"
219219
# The `create` event trigger doesn't support `branches` filters, so it's necessary to use Bash instead.
220220
if [[
221221
"${{ github.event_name }}" != "create" ||

.github/workflows/check-python-task.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
- name: Determine if the rest of the workflow should run
4242
id: determination
4343
run: |
44-
RELEASE_BRANCH_REGEX="refs/heads/[0-9]+.[0-9]+.x"
44+
RELEASE_BRANCH_REGEX="^refs/heads/v[0-9]+$"
4545
# The `create` event trigger doesn't support `branches` filters, so it's necessary to use Bash instead.
4646
if [[
4747
"${{ github.event_name }}" != "create" ||

.github/workflows/check-taskfiles.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
- name: Determine if the rest of the workflow should run
3636
id: determination
3737
run: |
38-
RELEASE_BRANCH_REGEX="refs/heads/[0-9]+.[0-9]+.x"
38+
RELEASE_BRANCH_REGEX="^refs/heads/v[0-9]+$"
3939
# The `create` event trigger doesn't support `branches` filters, so it's necessary to use Bash instead.
4040
if [[
4141
"${{ github.event_name }}" != "create" ||

.github/workflows/check-toc-task.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
- name: Determine if the rest of the workflow should run
3636
id: determination
3737
run: |
38-
RELEASE_BRANCH_REGEX="refs/heads/[0-9]+.[0-9]+.x"
38+
RELEASE_BRANCH_REGEX="^refs/heads/v[0-9]+$"
3939
# The `create` event trigger doesn't support `branches` filters, so it's necessary to use Bash instead.
4040
if [[
4141
"${{ github.event_name }}" != "create" ||

.github/workflows/check-yaml-task.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353
- name: Determine if the rest of the workflow should run
5454
id: determination
5555
run: |
56-
RELEASE_BRANCH_REGEX="refs/heads/[0-9]+.[0-9]+.x"
56+
RELEASE_BRANCH_REGEX="^refs/heads/v[0-9]+$"
5757
# The `create` event trigger doesn't support `branches` filters, so it's necessary to use Bash instead.
5858
if [[
5959
"${{ github.event_name }}" != "create" ||

.github/workflows/spell-check-task.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- name: Determine if the rest of the workflow should run
2222
id: determination
2323
run: |
24-
RELEASE_BRANCH_REGEX="refs/heads/[0-9]+.[0-9]+.x"
24+
RELEASE_BRANCH_REGEX="^refs/heads/v[0-9]+$"
2525
# The `create` event trigger doesn't support `branches` filters, so it's necessary to use Bash instead.
2626
if [[
2727
"${{ github.event_name }}" != "create" ||

.github/workflows/test-integration.yml

+49-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
name: Run integration tests
22

33
on:
4+
create:
5+
46
pull_request:
57
paths:
68
- ".github/workflows/test-integration.yml"
@@ -21,14 +23,47 @@ on:
2123
- "action.yml"
2224
- "compilesketches/**"
2325

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+
2434
env:
2535
SKETCHES_REPORTS_PATH: sketches-reports
2636
TESTDATA_PLATFORMS_PATH: .github/workflows/testdata/platforms
2737
TESTDATA_SKETCHES_PATH: .github/workflows/testdata/sketches
2838
TESTDATA_REPORTS_PATH: .github/workflows/testdata/reports
2939

3040
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+
3164
default-inputs:
65+
needs: run-determination
66+
if: needs.run-determination.outputs.result == 'true'
3267
runs-on: ubuntu-latest
3368

3469
steps:
@@ -49,6 +84,8 @@ jobs:
4984
uses: ./extras/compile-sketches
5085

5186
all-inputs:
87+
needs: run-determination
88+
if: needs.run-determination.outputs.result == 'true'
5289
runs-on: ubuntu-latest
5390

5491
strategy:
@@ -120,6 +157,8 @@ jobs:
120157

121158
multiple-steps:
122159
name: multiple-steps (${{ matrix.board.source-type }})
160+
needs: run-determination
161+
if: needs.run-determination.outputs.result == 'true'
123162
runs-on: ubuntu-latest
124163

125164
strategy:
@@ -209,6 +248,8 @@ jobs:
209248
- examples/Sweep
210249
211250
python-package-dependency:
251+
needs: run-determination
252+
if: needs.run-determination.outputs.result == 'true'
212253
runs-on: ubuntu-latest
213254

214255
steps:
@@ -239,6 +280,8 @@ jobs:
239280
240281
# Targeted testing for ESP32 boards platform support.
241282
pyserial-dependency:
283+
needs: run-determination
284+
if: needs.run-determination.outputs.result == 'true'
242285
runs-on: ubuntu-latest
243286

244287
steps:
@@ -267,7 +310,10 @@ jobs:
267310
- ${{ env.TESTDATA_SKETCHES_PATH }}/BareMinimum
268311
269312
check-sketches-reports:
270-
needs: all-inputs
313+
needs:
314+
- run-determination
315+
- all-inputs
316+
if: needs.run-determination.outputs.result == 'true'
271317
runs-on: ubuntu-latest
272318

273319
steps:
@@ -334,6 +380,8 @@ jobs:
334380
exit $EXIT_STATUS
335381
336382
expected-failed-compilation:
383+
needs: run-determination
384+
if: needs.run-determination.outputs.result == 'true'
337385
runs-on: ubuntu-latest
338386

339387
steps:

.github/workflows/test-python-poetry-task.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
- name: Determine if the rest of the workflow should run
4444
id: determination
4545
run: |
46-
RELEASE_BRANCH_REGEX="refs/heads/[0-9]+.[0-9]+.x"
46+
RELEASE_BRANCH_REGEX="^refs/heads/v[0-9]+$"
4747
# The `create` event trigger doesn't support `branches` filters, so it's necessary to use Bash instead.
4848
if [[
4949
"${{ github.event_name }}" != "create" ||

0 commit comments

Comments
 (0)