feat(bench): open cell-renderer scripts to comparator adapters (B2 follow-up #5a) #285
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: CI | |
| on: | |
| pull_request: | |
| branches: [main] | |
| push: | |
| branches: [main] | |
| concurrency: | |
| group: ci-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: pnpm/action-setup@v6 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 22 | |
| cache: pnpm | |
| - run: pnpm install --frozen-lockfile | |
| - run: pnpm test | |
| typecheck: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: pnpm/action-setup@v6 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 22 | |
| cache: pnpm | |
| - run: pnpm install --frozen-lockfile | |
| - run: pnpm typecheck | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: pnpm/action-setup@v6 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 22 | |
| cache: pnpm | |
| - run: pnpm install --frozen-lockfile | |
| - run: pnpm lint | |
| format: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: pnpm/action-setup@v6 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 22 | |
| cache: pnpm | |
| - run: pnpm install --frozen-lockfile | |
| - run: pnpm format | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: pnpm/action-setup@v6 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 22 | |
| cache: pnpm | |
| - run: pnpm install --frozen-lockfile | |
| - run: pnpm build | |
| packaging: | |
| name: Packaging — publint + attw | |
| runs-on: ubuntu-latest | |
| needs: [build] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: pnpm/action-setup@v6 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 22 | |
| cache: pnpm | |
| - run: pnpm install --frozen-lockfile | |
| - run: pnpm -r --filter '@pretable/core' --filter '@pretable/react' --filter '@cacheplane/json-stream' --filter '@pretable/stream-adapter' --filter '@pretable/ui' build | |
| - run: pnpm lint:packaging | |
| api-report: | |
| name: API Extractor — report freshness | |
| runs-on: ubuntu-latest | |
| needs: [build] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: pnpm/action-setup@v6 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 22 | |
| cache: pnpm | |
| - run: pnpm install --frozen-lockfile | |
| - run: pnpm -r --filter '@pretable/core' --filter '@pretable/react' --filter '@pretable/stream-adapter' --filter '@pretable/ui' build | |
| - run: pnpm api:check | |
| deploy-prod: | |
| name: Deploy → Vercel (production) | |
| needs: [test, typecheck, lint, format, build, packaging, api-report] | |
| runs-on: ubuntu-latest | |
| if: github.ref == 'refs/heads/main' && github.event_name == 'push' | |
| # Required GitHub secrets: | |
| # VERCEL_TOKEN — vercel.com/account/tokens | |
| # VERCEL_ORG_ID — Vercel team id | |
| # VERCEL_PROJECT_ID — pretable project id | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: pnpm/action-setup@v6 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 22 | |
| cache: pnpm | |
| - run: pnpm install --frozen-lockfile | |
| - name: Install Playwright browser | |
| run: pnpm exec playwright install --with-deps chromium webkit | |
| - name: Pull Vercel project settings | |
| run: | | |
| mkdir -p .vercel | |
| cat > .vercel/project.json <<EOF | |
| {"projectId":"${{ secrets.VERCEL_PROJECT_ID }}","orgId":"${{ secrets.VERCEL_ORG_ID }}","projectName":"pretable"} | |
| EOF | |
| npx vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }} | |
| rm -rf .vercel/output | |
| - name: Build with Vercel | |
| run: npx vercel build --prod --token=${{ secrets.VERCEL_TOKEN }} | |
| - name: Deploy to Vercel (production) | |
| id: deploy | |
| run: | | |
| url=$(npx vercel deploy --prebuilt --archive=tgz --prod --yes --token=${{ secrets.VERCEL_TOKEN }} | tail -n 1) | |
| echo "deployment_url=$url" >> "$GITHUB_OUTPUT" | |
| echo "Deployed: $url" | |
| - name: Wait for production alias to update | |
| # vercel deploy --prod returns once the unique deployment URL is | |
| # ready; the public alias atomically repoints shortly after. A short | |
| # readiness loop avoids racing the alias swap. | |
| run: | | |
| for i in 1 2 3 4 5 6; do | |
| code=$(curl -sS -o /dev/null -w "%{http_code}" "https://pretable.vercel.app" || true) | |
| echo "Attempt $i: HTTP $code" | |
| if [ "$code" = "200" ]; then exit 0; fi | |
| sleep 5 | |
| done | |
| echo "Public alias did not return 200 after deploy" | |
| exit 1 | |
| - name: Smoke test prod with Playwright | |
| env: | |
| BASE_URL: https://pretable.vercel.app | |
| run: pnpm --filter @pretable/app-website smoke | |
| - name: Upload smoke artifacts on failure | |
| if: failure() | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: website-smoke-traces | |
| path: apps/website/test-results/ | |
| retention-days: 7 | |
| deploy-preview: | |
| name: Deploy → Vercel (preview) | |
| needs: [test, typecheck, lint, format, build, packaging, api-report] | |
| runs-on: ubuntu-latest | |
| if: >- | |
| github.event_name == 'pull_request' && | |
| github.event.pull_request.head.repo.full_name == github.repository && | |
| github.event.pull_request.user.login != 'dependabot[bot]' | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| outputs: | |
| preview_url: ${{ steps.deploy.outputs.preview_url }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: pnpm/action-setup@v6 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 22 | |
| cache: pnpm | |
| - run: pnpm install --frozen-lockfile | |
| - name: Pull Vercel project settings | |
| run: | | |
| mkdir -p .vercel | |
| cat > .vercel/project.json <<EOF | |
| {"projectId":"${{ secrets.VERCEL_PROJECT_ID }}","orgId":"${{ secrets.VERCEL_ORG_ID }}","projectName":"pretable"} | |
| EOF | |
| npx vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }} | |
| rm -rf .vercel/output | |
| - name: Build with Vercel | |
| run: npx vercel build --token=${{ secrets.VERCEL_TOKEN }} | |
| - name: Deploy preview to Vercel | |
| id: deploy | |
| run: | | |
| url=$(npx vercel deploy --prebuilt --archive=tgz --yes --token=${{ secrets.VERCEL_TOKEN }} | tail -n 1) | |
| echo "preview_url=$url" >> "$GITHUB_OUTPUT" | |
| echo "Preview: $url" | |
| - name: Comment preview URL on PR | |
| uses: marocchino/sticky-pull-request-comment@v3 | |
| with: | |
| header: vercel-preview | |
| message: | | |
| ### Vercel preview ready | |
| **Preview**: ${{ steps.deploy.outputs.preview_url }} | |
| **Commit**: `${{ github.event.pull_request.head.sha }}` | |
| <sub>Updated automatically by the `deploy-preview` job.</sub> | |
| smoke-preview: | |
| name: Smoke test → Vercel preview (Playwright) | |
| needs: deploy-preview | |
| runs-on: ubuntu-latest | |
| if: >- | |
| github.event_name == 'pull_request' && | |
| github.event.pull_request.head.repo.full_name == github.repository && | |
| github.event.pull_request.user.login != 'dependabot[bot]' | |
| env: | |
| PREVIEW_URL: ${{ needs.deploy-preview.outputs.preview_url }} | |
| VERCEL_AUTOMATION_BYPASS_SECRET: ${{ secrets.VERCEL_AUTOMATION_BYPASS_SECRET }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: pnpm/action-setup@v6 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 22 | |
| cache: pnpm | |
| - run: pnpm install --frozen-lockfile | |
| - name: Prepare Vercel project settings | |
| run: | | |
| mkdir -p .vercel | |
| cat > .vercel/project.json <<EOF | |
| {"projectId":"${{ secrets.VERCEL_PROJECT_ID }}","orgId":"${{ secrets.VERCEL_ORG_ID }}","projectName":"pretable"} | |
| EOF | |
| - name: Choose preview verification mode | |
| id: preview-access | |
| run: | | |
| if [ -n "$VERCEL_AUTOMATION_BYPASS_SECRET" ]; then | |
| echo "mode=browser" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "mode=vercel-curl" >> "$GITHUB_OUTPUT" | |
| echo "No VERCEL_AUTOMATION_BYPASS_SECRET repository secret is configured; verifying protected preview readiness with vercel curl instead of browser smoke." >> "$GITHUB_STEP_SUMMARY" | |
| fi | |
| - name: Install Playwright browser | |
| if: steps.preview-access.outputs.mode == 'browser' | |
| run: pnpm exec playwright install --with-deps chromium | |
| - name: Wait for preview to respond | |
| if: steps.preview-access.outputs.mode == 'browser' | |
| run: | | |
| for i in 1 2 3 4 5 6; do | |
| code=$(curl -sS -o /dev/null -w "%{http_code}" \ | |
| -H "x-vercel-protection-bypass: $VERCEL_AUTOMATION_BYPASS_SECRET" \ | |
| -H "x-vercel-set-bypass-cookie: true" \ | |
| "$PREVIEW_URL" || true) | |
| echo "Attempt $i: HTTP $code" | |
| if [ "$code" = "200" ]; then exit 0; fi | |
| sleep 5 | |
| done | |
| echo "Preview did not return 200" | |
| exit 1 | |
| - name: Verify protected preview readiness with Vercel CLI | |
| if: steps.preview-access.outputs.mode == 'vercel-curl' | |
| run: | | |
| for i in 1 2 3 4 5 6; do | |
| code=$(npx --yes vercel@latest curl / \ | |
| --deployment "$PREVIEW_URL" \ | |
| --token=${{ secrets.VERCEL_TOKEN }} \ | |
| --yes \ | |
| -- \ | |
| --silent \ | |
| --show-error \ | |
| --output /dev/null \ | |
| --write-out "%{http_code}" || true) | |
| echo "Attempt $i: HTTP $code" | |
| if [ "$code" = "200" ]; then exit 0; fi | |
| sleep 5 | |
| done | |
| echo "Protected preview did not return 200 through vercel curl" | |
| exit 1 | |
| - name: Smoke test preview with Playwright | |
| if: steps.preview-access.outputs.mode == 'browser' | |
| env: | |
| BASE_URL: ${{ env.PREVIEW_URL }} | |
| run: pnpm --filter @pretable/app-website exec playwright test --project=chromium | |
| - name: Upload Playwright traces on failure | |
| if: failure() | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: website-preview-traces | |
| path: apps/website/test-results/ | |
| retention-days: 7 |