Skip to content

Commit c78b576

Browse files
authored
Merge pull request #5961 from JSONbored/feat/codecov-bundle-analysis
feat(ci): upload loopover-ui bundle stats to Codecov
2 parents 545a020 + 17b4237 commit c78b576

4 files changed

Lines changed: 347 additions & 2 deletions

File tree

.github/workflows/ci.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,21 @@ jobs:
398398
- name: UI build
399399
if: ${{ github.event_name == 'push' || needs.changes.outputs.ui == 'true' }}
400400
run: npm run extension:build && npm run miner-extension:build && npm --workspace @loopover/ui run build
401+
# Bundle-size regression tracking for the deployed marketing/product site (loopover-ui only --
402+
# loopover-miner-ui is a self-hosted operator dashboard with no build step in this job at all, see
403+
# "UI build" above). Fork-excluded (no secrets.CODECOV_TOKEN on a fork PR, same boundary as the
404+
# coverage-upload steps below) and non-blocking (continue-on-error): unlike coverage, nothing gates
405+
# merges on bundle size, so an upload hiccup must never fail CI. Uses @codecov/bundle-analyzer's
406+
# standalone CLI against the built dist/client directly rather than a bundler-plugin hook --
407+
# @codecov/vite-plugin's latest release doesn't support this repo's Vite 8 yet (peer range caps at
408+
# 6.x; this repo's Vite 8 runs on rolldown, not classic rollup, so @codecov/rollup-plugin doesn't fit
409+
# either) -- revisit wiring the plugin in once upstream catches up.
410+
- name: Upload UI bundle stats to Codecov
411+
if: ${{ (github.event_name == 'push' || needs.changes.outputs.ui == 'true') && github.event.pull_request.head.repo.fork != true }}
412+
continue-on-error: true
413+
env:
414+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
415+
run: npm run bundle-analysis --workspace @loopover/ui
401416

402417
# The full-suite coverage run, sharded (#ci-shard-coverage). This alone was ~9-10 of the ~11 minutes a
403418
# typical backend PR spent in validate-code, because vitest schedules whole test FILES atomically to

apps/loopover-ui/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"build": "vite build",
1212
"build:cloudflare": "npm --prefix ../.. run ui:build",
1313
"build:dev": "vite build --mode development",
14+
"bundle-analysis": "bundle-analyzer ./dist/client --bundle-name=loopover-ui --upload-token=$CODECOV_TOKEN",
1415
"deploy:built": "wrangler deploy --config dist/server/wrangler.json",
1516
"preview": "vite preview",
1617
"version:built": "wrangler versions upload --config dist/server/wrangler.json",
@@ -76,6 +77,7 @@
7677
"zod": "^4.4.3"
7778
},
7879
"devDependencies": {
80+
"@codecov/bundle-analyzer": "^2.0.1",
7981
"@eslint/js": "^9.39.4",
8082
"@lovable.dev/vite-tanstack-config": "2.6.5",
8183
"@testing-library/dom": "^10.4.1",

package-lock.json

Lines changed: 298 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)