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 dba3b3c826..1dae4a72a4 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: