feat(vehicles): day log, timeline clamp, overlay chrome #126
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: perf | |
| on: | |
| pull_request: | |
| branches: [main] | |
| paths: | |
| - 'web/**' | |
| - '.github/workflows/perf.yml' | |
| workflow_dispatch: | |
| inputs: | |
| runner: | |
| description: 'Runner to use (manual runs only)' | |
| type: choice | |
| options: | |
| - arc-runner | |
| - ubuntu-latest | |
| default: arc-runner | |
| concurrency: | |
| group: perf-${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: ${{ github.event_name == 'pull_request' }} | |
| permissions: | |
| contents: read | |
| jobs: | |
| lighthouse: | |
| name: Lighthouse CI | |
| # Pin to ubuntu-latest because lighthouse-ci-action requires Chrome, | |
| # which the self-hosted arc-runner image does not ship (`CHROME_PATH | |
| # environment variable must be set to a Chrome/Chromium executable`). | |
| # GitHub-hosted ubuntu-latest has Chrome preinstalled. | |
| runs-on: ${{ inputs.runner || 'ubuntu-latest' }} | |
| defaults: | |
| run: | |
| working-directory: web | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| cache-dependency-path: web/package-lock.json | |
| - name: Install | |
| run: npm ci --legacy-peer-deps | |
| - name: Build | |
| # CLEAN-04/CLEAN-07: `private` emits HIDDEN source maps β full `.map` | |
| # files with no `sourceMappingURL` comment, so nothing fetches them β | |
| # which is what gives `perf:check` module attribution for the startup | |
| # icon/feature locality checks and the duplicate-module gate. They are | |
| # CI-only artefacts and are deleted below before anything is served. | |
| env: | |
| VITE_SOURCEMAP_MODE: private | |
| run: npm run build | |
| - name: Install Playwright Chromium | |
| run: npx playwright install --with-deps chromium | |
| - name: Bundle-size budget + duplicate-module gate (strict) | |
| env: | |
| VITE_SOURCEMAP_MODE: private | |
| run: npm run perf:check | |
| - name: Drop private source maps before anything is served | |
| run: | | |
| find dist -name '*.map' -delete | |
| npm run check:source-maps | |
| - name: Start preview server | |
| run: | | |
| npx vite preview --port 4173 --strictPort > preview.log 2>&1 & | |
| echo $! > preview.pid | |
| # Wait for server to be reachable | |
| for i in $(seq 1 30); do | |
| if curl -fsS http://localhost:4173/ -o /dev/null; then | |
| echo "preview server is up" | |
| exit 0 | |
| fi | |
| sleep 1 | |
| done | |
| echo "preview server failed to start" | |
| cat preview.log | |
| exit 1 | |
| - name: Lighthouse CI | |
| uses: treosh/lighthouse-ci-action@v12 | |
| with: | |
| urls: | | |
| http://localhost:4173/ | |
| http://localhost:4173/vehicles | |
| http://localhost:4173/drives | |
| http://localhost:4173/analytics | |
| http://localhost:4173/charging | |
| http://localhost:4173/battery | |
| uploadArtifacts: true | |
| temporaryPublicStorage: true | |
| configPath: ./web/lighthouserc.json | |
| runs: 1 | |
| - name: Stop preview server | |
| if: always() | |
| run: | | |
| if [ -f preview.pid ]; then | |
| kill "$(cat preview.pid)" 2>/dev/null || true | |
| fi |