name: Fan Passport demo CI on: push: branches: - main pull_request: workflow_dispatch: permissions: contents: read jobs: validate: name: Build, test, and release-preflight runs-on: ubuntu-latest timeout-minutes: 25 steps: - name: Check out repository uses: actions/checkout@v4 - name: Set up Node.js uses: actions/setup-node@v4 with: node-version: "22" - name: Install workspace dependencies run: npm install - name: Run static release preflight run: node scripts/qa/release-preflight.mjs - name: Typecheck root package if available run: npm run typecheck --if-present - name: Typecheck workspaces if available run: npm --workspaces run typecheck --if-present - name: Run root tests if available run: npm test --if-present - name: Run workspace tests if available run: npm --workspaces run test --if-present - name: Build root package if available run: npm run build --if-present - name: Build workspaces if available run: npm --workspaces run build --if-present - name: Install Playwright browser if Playwright is declared shell: bash run: | if node <<'NODE' const fs = require("fs"); const manifestFiles = [ "package.json", "apps/web/package.json", "apps/api/package.json", "packages/shared/package.json" ]; const hasPlaywright = manifestFiles.some((file) => { if (!fs.existsSync(file)) return false; const manifest = JSON.parse(fs.readFileSync(file, "utf8")); return Boolean( manifest.dependencies?.["@playwright/test"] || manifest.devDependencies?.["@playwright/test"] ); }); process.exit(hasPlaywright ? 0 : 1); NODE then npx playwright install --with-deps chromium else echo "Playwright is not declared in the workspace manifests; skipping browser install." fi - name: Run end-to-end tests if available run: npm run e2e --if-present - name: Run alternate end-to-end script if available run: npm run test:e2e --if-present