Skip to content

Commit ab95658

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 ab95658

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

.github/workflows/impress-frontend.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,3 +136,35 @@ 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+
steps:
145+
- name: Checkout repository
146+
uses: actions/checkout@v4
147+
148+
- name: Setup Node.js
149+
uses: actions/setup-node@v4
150+
with:
151+
node-version: "22.x"
152+
153+
- name: Restore the frontend cache
154+
uses: actions/cache@v4
155+
with:
156+
path: "src/frontend/**/node_modules"
157+
key: front-node_modules-${{ hashFiles('src/frontend/**/yarn.lock') }}
158+
fail-on-cache-miss: true
159+
160+
- name: Check bundle size changes
161+
uses: preactjs/compressed-size-action@v2
162+
with:
163+
repo-token: "${{ secrets.GITHUB_TOKEN }}"
164+
build-script: "build"
165+
pattern: "./out/**/*.{js,css,html}"
166+
exclude: "{**/*.map,**/node_modules/**}"
167+
minimum-change-threshold: 100
168+
compression: "gzip"
169+
cwd: "./src/frontend/apps/impress"
170+
show-total: true

0 commit comments

Comments
 (0)