feat(devx): developer experience & quality (M19.1-M19.8)
- Storybook 8 setup with dark glass canvas, stories for all ui/ components - Visual regression tests (Playwright screenshots, 0.5% pixel diff) - Bundle size CI gate (fail > 250KB gzipped) - Comprehensive mock data: 20+ items for films, songs, books, TV, images, places, podcasts, news, nostr events; mock TMDB responses - E2E cross-browser matrix: Chromium + Firefox + WebKit + iPhone 14 + Galaxy S21 - Proxy integration tests (SSE format, tool_use, error handling, disconnect) - Lighthouse CI config (LCP < 3s, CLS < 0.15) - Dependency audit: weekly GitHub Actions workflow with license checker - CI workflow: lint, typecheck, test, bundle size, e2e, lighthouse, audit Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
a01f43c95f
commit
18b972b351
@@ -0,0 +1,131 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main, development]
|
||||
pull_request:
|
||||
branches: [main, development]
|
||||
|
||||
jobs:
|
||||
lint-typecheck:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: pnpm/action-setup@v4
|
||||
with:
|
||||
version: 10
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20
|
||||
cache: pnpm
|
||||
- run: pnpm install --frozen-lockfile
|
||||
- run: pnpm typecheck
|
||||
- run: pnpm lint
|
||||
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: pnpm/action-setup@v4
|
||||
with:
|
||||
version: 10
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20
|
||||
cache: pnpm
|
||||
- run: pnpm install --frozen-lockfile
|
||||
- run: pnpm test
|
||||
|
||||
bundle-size:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: pnpm/action-setup@v4
|
||||
with:
|
||||
version: 10
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20
|
||||
cache: pnpm
|
||||
- run: pnpm install --frozen-lockfile
|
||||
- run: pnpm build
|
||||
- name: Check bundle size
|
||||
run: |
|
||||
BUNDLE_SIZE=$(find packages/app/dist/assets -name '*.js' -o -name '*.css' | xargs gzip -c | wc -c)
|
||||
BUNDLE_KB=$((BUNDLE_SIZE / 1024))
|
||||
echo "Bundle size: ${BUNDLE_KB}KB gzipped"
|
||||
if [ "$BUNDLE_KB" -gt 250 ]; then
|
||||
echo "::error::Bundle size ${BUNDLE_KB}KB exceeds 250KB budget"
|
||||
exit 1
|
||||
fi
|
||||
echo "Bundle size ${BUNDLE_KB}KB is within 250KB budget"
|
||||
|
||||
e2e:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
browser: [chromium, firefox, webkit]
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: pnpm/action-setup@v4
|
||||
with:
|
||||
version: 10
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20
|
||||
cache: pnpm
|
||||
- run: pnpm install --frozen-lockfile
|
||||
- run: cd packages/app && npx playwright install --with-deps ${{ matrix.browser }}
|
||||
- run: cd packages/app && pnpm test:e2e --project=${{ matrix.browser }}
|
||||
|
||||
e2e-mobile:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: pnpm/action-setup@v4
|
||||
with:
|
||||
version: 10
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20
|
||||
cache: pnpm
|
||||
- run: pnpm install --frozen-lockfile
|
||||
- run: cd packages/app && npx playwright install --with-deps chromium webkit
|
||||
- run: cd packages/app && pnpm test:e2e --project=iphone14 --project=galaxy-s21
|
||||
|
||||
lighthouse:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: pnpm/action-setup@v4
|
||||
with:
|
||||
version: 10
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20
|
||||
cache: pnpm
|
||||
- run: pnpm install --frozen-lockfile
|
||||
- run: pnpm build
|
||||
- name: Run Lighthouse
|
||||
uses: treosh/lighthouse-ci-action@v12
|
||||
with:
|
||||
configPath: packages/app/lighthouserc.json
|
||||
uploadArtifacts: true
|
||||
|
||||
dependency-audit:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: pnpm/action-setup@v4
|
||||
with:
|
||||
version: 10
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20
|
||||
cache: pnpm
|
||||
- run: pnpm install --frozen-lockfile
|
||||
- name: Audit dependencies
|
||||
run: pnpm audit --audit-level=critical || true
|
||||
- name: Check licenses
|
||||
run: |
|
||||
npx license-checker --production --onlyAllow 'MIT;Apache-2.0;ISC;BSD-2-Clause;BSD-3-Clause;0BSD;CC0-1.0;Unlicense;CC-BY-4.0;Python-2.0;BlueOak-1.0.0' --excludePrivatePackages || echo "::warning::Non-approved licenses found"
|
||||
@@ -0,0 +1,57 @@
|
||||
name: Weekly Dependency Audit
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 9 * * 1' # Every Monday at 9am UTC
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
audit:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
issues: write
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: pnpm/action-setup@v4
|
||||
with:
|
||||
version: 10
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20
|
||||
cache: pnpm
|
||||
- run: pnpm install --frozen-lockfile
|
||||
|
||||
- name: Audit for vulnerabilities
|
||||
id: audit
|
||||
run: |
|
||||
AUDIT_RESULT=$(pnpm audit --audit-level=moderate 2>&1) || true
|
||||
echo "$AUDIT_RESULT"
|
||||
if echo "$AUDIT_RESULT" | grep -q "critical"; then
|
||||
echo "has_critical=true" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "has_critical=false" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Check licenses
|
||||
id: licenses
|
||||
run: |
|
||||
LICENSE_RESULT=$(npx license-checker --production --onlyAllow 'MIT;Apache-2.0;ISC;BSD-2-Clause;BSD-3-Clause;0BSD;CC0-1.0;Unlicense;CC-BY-4.0;Python-2.0;BlueOak-1.0.0' --excludePrivatePackages 2>&1) || true
|
||||
echo "$LICENSE_RESULT"
|
||||
if echo "$LICENSE_RESULT" | grep -q "FAIL"; then
|
||||
echo "has_violations=true" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "has_violations=false" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Create issue if violations found
|
||||
if: steps.audit.outputs.has_critical == 'true' || steps.licenses.outputs.has_violations == 'true'
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
await github.rest.issues.create({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
title: '⚠️ Dependency audit: violations found',
|
||||
body: `The weekly dependency audit found issues:\n\n- Critical vulnerabilities: ${{ steps.audit.outputs.has_critical }}\n- License violations: ${{ steps.licenses.outputs.has_violations }}\n\nRun \`pnpm audit\` and \`npx license-checker\` locally for details.`,
|
||||
labels: ['security', 'dependencies'],
|
||||
})
|
||||
Reference in New Issue
Block a user