Skip to content

Merge pull request #530 from microsoft/copilot/fix-nightly-deploy-errors #122

Merge pull request #530 from microsoft/copilot/fix-nightly-deploy-errors

Merge pull request #530 from microsoft/copilot/fix-nightly-deploy-errors #122

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v5
with:
node-version: "24"
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Build design tokens
run: npm run tokens:build -w @acroyoga/tokens
- name: Typecheck
run: npm run typecheck
- name: Lint (includes jsx-a11y)
run: npm run lint -w @acroyoga/web
- name: Build web app
run: npm run build -w @acroyoga/web
- name: Check bundle size
run: |
# Check gzipped size of initial JS chunks for the home page (Constitution VI, FR-013)
# Only chunks referenced in the prerendered index.html count as "initial bundle"
INDEX_HTML="apps/web/.next/server/app/index.html"
TOTAL_GZ=0
while IFS= read -r chunk; do
CHUNK_FILE="apps/web/.next/static/chunks/${chunk}"
if [ -f "$CHUNK_FILE" ]; then
GZ_SIZE=$(gzip -c "$CHUNK_FILE" | wc -c)
TOTAL_GZ=$((TOTAL_GZ + GZ_SIZE))
fi
done < <(grep -oP 'src="/_next/static/chunks/\K[^"]+(?=")' "$INDEX_HTML" 2>/dev/null)
TOTAL_KB=$((TOTAL_GZ / 1024))
echo "Initial JS bundle size (gzipped): ${TOTAL_KB}KB"
if [ "$TOTAL_KB" -gt 200 ]; then
echo "::error::Initial JS bundle size (${TOTAL_KB}KB gzipped) exceeds 200KB budget (Constitution VI, FR-013)"
exit 1
fi
- name: Run token tests
run: npm run test -w @acroyoga/tokens
- name: Run shared-ui tests
run: npm run test -w @acroyoga/shared-ui
- name: Run shared tests
run: npm run test -w @acroyoga/shared
- name: Run web tests
run: npm run test -w @acroyoga/web
- name: Run mobile unit tests (Spec 016)
run: npm run test -w @acroyoga/mobile
- name: Install Playwright browsers
run: npx playwright install --with-deps chromium
- name: Run E2E tests (Playwright)
run: npx playwright test --config apps/web/playwright.config.ts
env:
CI: true
- name: i18n string lint (Constitution VIII, QG-9)
run: bash scripts/lint-i18n.sh
- name: Build Storybook
run: npx storybook build --config-dir apps/web/.storybook -o apps/web/storybook-static
- name: Storybook a11y audit (FR-019, QG-6)
run: |
npx concurrently -k -s first -n storybook,test \
"npx http-server apps/web/storybook-static --port 6006 --silent" \
"npx wait-on http://localhost:6006 && npx test-storybook --url http://localhost:6006 --config-dir apps/web/.storybook"