From ff9e13ca03d1a66721c9989e7a5a493e9f63f1db Mon Sep 17 00:00:00 2001 From: Anthony LC Date: Tue, 5 Aug 2025 16:00:34 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B7(CI)=20add=20bundle=20size=20check?= =?UTF-8?q?=20job?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Job that will give a report on the bundle size of the frontend application. Good to know if the bundle size is increasing or decreasing and if the changes are acceptable. --- .github/workflows/impress-frontend.yml | 38 ++++++++++++++++++++++++++ CHANGELOG.md | 4 +++ 2 files changed, 42 insertions(+) diff --git a/.github/workflows/impress-frontend.yml b/.github/workflows/impress-frontend.yml index 1d8193522c..9a2c3531f1 100644 --- a/.github/workflows/impress-frontend.yml +++ b/.github/workflows/impress-frontend.yml @@ -136,3 +136,41 @@ jobs: name: playwright-other-report path: src/frontend/apps/e2e/report/ retention-days: 7 + + bundle-size-check: + runs-on: ubuntu-latest + needs: install-dependencies + if: github.event_name == 'pull_request' + permissions: + contents: read + pull-requests: write + issues: write + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: "22.x" + + - name: Restore the frontend cache + uses: actions/cache@v4 + with: + path: "src/frontend/**/node_modules" + key: front-node_modules-${{ hashFiles('src/frontend/**/yarn.lock') }} + fail-on-cache-miss: true + + - name: Check bundle size changes + uses: preactjs/compressed-size-action@v2 + with: + repo-token: "${{ secrets.GITHUB_TOKEN }}" + build-script: "build" + pattern: "./out/**/*.{css,js,html}" + exclude: "{**/*.map,**/node_modules/**}" + minimum-change-threshold: 500 + compression: "gzip" + cwd: "./src/frontend/apps/impress" + show-total: true + strip-hash: "\\b\\w+\\." + omit-unchanged: true diff --git a/CHANGELOG.md b/CHANGELOG.md index b7fc30cbb0..1a15197de5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,10 @@ and this project adheres to ## [Unreleased] +### Added + +- 👷(CI) add bundle size check job #1268 + ### Changed - ⚡️(frontend) improve accessibility: