From 8d42149304b18472f50428248d04ad81a5debac5 Mon Sep 17 00:00:00 2001 From: Anthony LC Date: Fri, 29 Aug 2025 10:21:13 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B7(CI)=20trigger=20bundle-size-check?= =?UTF-8?q?=20only=20if=20necessary?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- .github/workflows/impress-frontend.yml | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/.github/workflows/impress-frontend.yml b/.github/workflows/impress-frontend.yml index 9a2c3531..70b611a4 100644 --- a/.github/workflows/impress-frontend.yml +++ b/.github/workflows/impress-frontend.yml @@ -149,10 +149,15 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - - name: Setup Node.js - uses: actions/setup-node@v4 + - name: Detect relevant changes + id: changes + uses: dorny/paths-filter@v2 with: - node-version: "22.x" + filters: | + lock: + - 'src/frontend/**/yarn.lock' + app: + - 'src/frontend/apps/impress/**' - name: Restore the frontend cache uses: actions/cache@v4 @@ -161,7 +166,14 @@ jobs: key: front-node_modules-${{ hashFiles('src/frontend/**/yarn.lock') }} 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 + if: steps.changes.outputs.lock == 'true' || steps.changes.outputs.app == 'true' uses: preactjs/compressed-size-action@v2 with: repo-token: "${{ secrets.GITHUB_TOKEN }}"