Skip to content

Commit 8a03ac0

Browse files
committed
ci(optimization): Run workflows only when related files change
1 parent 5de054b commit 8a03ac0

File tree

3 files changed

+32
-5
lines changed

3 files changed

+32
-5
lines changed

.github/workflows/boards.yml

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
name: Boards Test
22

3-
# The workflow will run on schedule and labeled pull requests
43
on:
54
pull_request:
5+
paths:
6+
- 'boards.txt'
7+
- 'libraries/ESP32/examples/CI/CIBoardsTest/CIBoardsTest.ino'
8+
- '.github/workflows/boards.yml'
69

710
env:
811
# It's convenient to set variables for values used multiple times in the workflow
@@ -24,7 +27,7 @@ jobs:
2427
uses: dcarbone/[email protected]
2528

2629
- name: Get board name
27-
run:
30+
run:
2831
bash .github/scripts/find_new_boards.sh ${{ github.repository }} ${{github.event.number}}
2932

3033
test-boards:

.github/workflows/hil.yml

+10
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,16 @@ name: Run tests
33
on:
44
pull_request:
55
types: [opened, reopened, synchronize, labeled]
6+
paths:
7+
- 'tests/**'
8+
- 'cores/**'
9+
- 'libraries/**'
10+
- 'package/**'
11+
- '.github/workflows/hil.yml'
12+
- '.github/workflows/wokwi.yml'
13+
- '.github/scripts/install-*.sh'
14+
- '.github/scripts/tests_*.sh'
15+
- '.github/scripts/sketch_utils.sh'
616

717
schedule:
818
- cron: '0 2 * * *'

.github/workflows/push.yml

+17-3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,20 @@ on:
77
- master
88
- release/*
99
pull_request:
10+
paths:
11+
- 'cores/**'
12+
- 'libraries/**'
13+
- 'package/**'
14+
- 'tools/**.py'
15+
- 'platform.txt'
16+
- 'programmers.txt'
17+
- 'package.json'
18+
- '.github/workflows/push.yml'
19+
- '.github/scripts/**'
20+
- '!.github/scripts/find_*'
21+
- '!.github/scripts/on-release.sh'
22+
- '!.github/scripts/tests_*'
23+
- '!.github/scripts/upload_*'
1024

1125
concurrency:
1226
group: build-${{github.event.pull_request.number || github.ref}}
@@ -127,7 +141,7 @@ jobs:
127141
runs-on: ubuntu-latest
128142
steps:
129143
# Check out repository
130-
- name: Checkout repository
144+
- name: Checkout repository
131145
uses: actions/checkout@v4
132146
with:
133147
token: ${{secrets.GITHUB_TOKEN}}
@@ -143,7 +157,7 @@ jobs:
143157
pattern: pr_cli_compile_*
144158
merge-multiple: true
145159
path: master_cli_compile
146-
160+
147161
- name: List files in the directory
148162
run: ls -R
149163

@@ -155,7 +169,7 @@ jobs:
155169
git add --all
156170
git commit -m "Updated cli compile json files"
157171
git push origin HEAD:gh-pages
158-
172+
159173
#Upload PR number as artifact
160174
upload-pr-number:
161175
name: Upload PR number

0 commit comments

Comments
 (0)