Skip to content

Commit 29d2c2a

Browse files
committed
👷(CI) add bundle size check job
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.
1 parent 409e073 commit 29d2c2a

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

.github/workflows/impress-frontend.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,3 +136,40 @@ jobs:
136136
name: playwright-other-report
137137
path: src/frontend/apps/e2e/report/
138138
retention-days: 7
139+
140+
bundle-size-check:
141+
runs-on: ubuntu-latest
142+
needs: install-dependencies
143+
if: github.event_name == 'pull_request'
144+
permissions:
145+
contents: read
146+
pull-requests: write
147+
issues: write
148+
steps:
149+
- name: Checkout repository
150+
uses: actions/checkout@v4
151+
152+
- name: Setup Node.js
153+
uses: actions/setup-node@v4
154+
with:
155+
node-version: "22.x"
156+
157+
- name: Restore the frontend cache
158+
uses: actions/cache@v4
159+
with:
160+
path: "src/frontend/**/node_modules"
161+
key: front-node_modules-${{ hashFiles('src/frontend/**/yarn.lock') }}
162+
fail-on-cache-miss: true
163+
164+
- name: Check bundle size changes
165+
uses: preactjs/compressed-size-action@v2
166+
with:
167+
repo-token: "${{ secrets.GITHUB_TOKEN }}"
168+
build-script: "build"
169+
pattern: "./out/**/*.css,./out/_next/static/chunks/pages/**/*.js,./out/_next/static/chunks/**/*.js,./out/**/*.js,./out/**/*.html"
170+
exclude: "{**/*.map,**/node_modules/**}"
171+
minimum-change-threshold: 100
172+
compression: "gzip"
173+
cwd: "./src/frontend/apps/impress"
174+
show-total: true
175+
strip-hash: "\\b\\w+\\."

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ and this project adheres to
88

99
## [Unreleased]
1010

11+
### Added
12+
13+
- 👷(CI) add bundle size check job #1268
14+
1115
### Changed
1216

1317
- ⚡️(frontend) improve accessibility:

0 commit comments

Comments
 (0)