Skip to content

Commit 8d42149

Browse files
committed
👷(CI) trigger bundle-size-check only if necessary
We don't need to run the bundle-size-check job if the app didn't change. If the yarn.lock file or the app have changed, the bundle-size-check job will be triggered.
1 parent 2451a6a commit 8d42149

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

.github/workflows/impress-frontend.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,10 +149,15 @@ jobs:
149149
- name: Checkout repository
150150
uses: actions/checkout@v4
151151

152-
- name: Setup Node.js
153-
uses: actions/setup-node@v4
152+
- name: Detect relevant changes
153+
id: changes
154+
uses: dorny/paths-filter@v2
154155
with:
155-
node-version: "22.x"
156+
filters: |
157+
lock:
158+
- 'src/frontend/**/yarn.lock'
159+
app:
160+
- 'src/frontend/apps/impress/**'
156161
157162
- name: Restore the frontend cache
158163
uses: actions/cache@v4
@@ -161,7 +166,14 @@ jobs:
161166
key: front-node_modules-${{ hashFiles('src/frontend/**/yarn.lock') }}
162167
fail-on-cache-miss: true
163168

169+
- name: Setup Node.js
170+
if: steps.changes.outputs.lock == 'true' || steps.changes.outputs.app == 'true'
171+
uses: actions/setup-node@v4
172+
with:
173+
node-version: "22.x"
174+
164175
- name: Check bundle size changes
176+
if: steps.changes.outputs.lock == 'true' || steps.changes.outputs.app == 'true'
165177
uses: preactjs/compressed-size-action@v2
166178
with:
167179
repo-token: "${{ secrets.GITHUB_TOKEN }}"

0 commit comments

Comments
 (0)