👷(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.
This commit is contained in:
18
.github/workflows/impress-frontend.yml
vendored
18
.github/workflows/impress-frontend.yml
vendored
@@ -149,10 +149,15 @@ jobs:
|
|||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Setup Node.js
|
- name: Detect relevant changes
|
||||||
uses: actions/setup-node@v4
|
id: changes
|
||||||
|
uses: dorny/paths-filter@v2
|
||||||
with:
|
with:
|
||||||
node-version: "22.x"
|
filters: |
|
||||||
|
lock:
|
||||||
|
- 'src/frontend/**/yarn.lock'
|
||||||
|
app:
|
||||||
|
- 'src/frontend/apps/impress/**'
|
||||||
|
|
||||||
- name: Restore the frontend cache
|
- name: Restore the frontend cache
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
@@ -161,7 +166,14 @@ jobs:
|
|||||||
key: front-node_modules-${{ hashFiles('src/frontend/**/yarn.lock') }}
|
key: front-node_modules-${{ hashFiles('src/frontend/**/yarn.lock') }}
|
||||||
fail-on-cache-miss: true
|
fail-on-cache-miss: true
|
||||||
|
|
||||||
|
- name: Setup Node.js
|
||||||
|
if: steps.changes.outputs.lock == 'true' || steps.changes.outputs.app == 'true'
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: "22.x"
|
||||||
|
|
||||||
- name: Check bundle size changes
|
- name: Check bundle size changes
|
||||||
|
if: steps.changes.outputs.lock == 'true' || steps.changes.outputs.app == 'true'
|
||||||
uses: preactjs/compressed-size-action@v2
|
uses: preactjs/compressed-size-action@v2
|
||||||
with:
|
with:
|
||||||
repo-token: "${{ secrets.GITHUB_TOKEN }}"
|
repo-token: "${{ secrets.GITHUB_TOKEN }}"
|
||||||
|
|||||||
Reference in New Issue
Block a user