@@ -456,65 +456,92 @@ jobs:
456456 flags : api
457457 fail_ci_if_error : false
458458
459- # dashboard-e2e:
460- # name: Dashboard E2E
461- # needs: wait-for-gateful
462- # if: ${{ !(startsWith(github.head_ref, 'changeset-release/') && github.actor == 'github-actions[bot]' && github.event.pull_request.user.login == 'github-actions[bot]' && github.event.pull_request.head.repo.full_name == github.repository) }}
463- # runs-on: ubuntu-latest
464- # timeout-minutes: 20
465-
466- # steps:
467- # - name: Checkout repository
468- # uses: actions/checkout@v4
469- # with:
470- # fetch-depth: 0
471-
472- # - name: Setup pnpm
473- # uses: pnpm/action-setup@v4
474- # with:
475- # version: 10.10.0
476-
477- # - name: Setup Node.js
478- # uses: actions/setup-node@v4
479- # with:
480- # node-version: "20"
481- # cache: "pnpm"
482-
483- # - name: Install dependencies
484- # run: pnpm install --frozen-lockfile
485-
486- # - name: Cache Playwright browsers
487- # uses: actions/cache@v4
488- # with:
489- # path: ~/.cache/ms-playwright
490- # key: playwright-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
491- # restore-keys: |
492- # playwright-${{ runner.os }}-
493-
494- # - name: Install Playwright browsers
495- # run: pnpm --filter @anticapture/dashboard exec playwright install --with-deps chromium
496-
497- # - name: Run dashboard E2E tests
498- # run: pnpm dashboard test:e2e
499- # env:
500- # CI: "true"
501- # NEXT_PUBLIC_WC_PROJECT_ID: ${{ secrets.E2E_NEXT_PUBLIC_WC_PROJECT_ID }}
502- # BLOCKFUL_API_TOKEN: ${{ secrets.E2E_BLOCKFUL_API_TOKEN }}
503- # TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
504- # TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
505-
506- # - name: Upload Playwright report
507- # if: failure()
508- # uses: actions/upload-artifact@v4
509- # with:
510- # name: playwright-report
511- # path: apps/dashboard/playwright-report
512- # retention-days: 14
513-
514- # - name: Upload Playwright traces
515- # if: failure()
516- # uses: actions/upload-artifact@v4
517- # with:
518- # name: playwright-test-results
519- # path: apps/dashboard/test-results
520- # retention-days: 14
459+ dashboard-e2e :
460+ name : Dashboard E2E
461+ needs : [configure-vercel-preview, wait-for-gateful]
462+ if : ${{ !(startsWith(github.head_ref, 'changeset-release/') && github.actor == 'github-actions[bot]' && github.event.pull_request.user.login == 'github-actions[bot]' && github.event.pull_request.head.repo.full_name == github.repository) }}
463+ runs-on : ubuntu-latest
464+ timeout-minutes : 20
465+
466+ steps :
467+ - name : Checkout repository
468+ uses : actions/checkout@v4
469+ with :
470+ fetch-depth : 0
471+
472+ - name : Setup pnpm
473+ uses : pnpm/action-setup@v4
474+ with :
475+ version : 10.10.0
476+
477+ - name : Setup Node.js
478+ uses : actions/setup-node@v4
479+ with :
480+ node-version : " 20"
481+ cache : " pnpm"
482+
483+ - name : Install dependencies
484+ run : pnpm install --frozen-lockfile
485+
486+ - name : Cache Playwright browsers
487+ uses : actions/cache@v4
488+ with :
489+ path : ~/.cache/ms-playwright
490+ key : playwright-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
491+ restore-keys : |
492+ playwright-${{ runner.os }}-
493+
494+ - name : Install Playwright browsers
495+ run : pnpm --filter @anticapture/dashboard exec playwright install --with-deps chromium
496+
497+ # Gateful tokens are revocable server-side, so a stale secret used to
498+ # surface as 9 minutes of data specs dying on 401s. Probe once up front
499+ # and fail in seconds with the actual fix instead. (Reading the token
500+ # from Vercel is not an option: the env API returns ciphertext for
501+ # encrypted values; only deployments receive plaintext.)
502+ - name : Check the gateful token still authenticates
503+ shell : bash
504+ env :
505+ E2E_TOKEN : ${{ secrets.E2E_BLOCKFUL_API_TOKEN }}
506+ GATEFUL_URL : https://dev-gateful.up.railway.app
507+ run : |
508+ set -euo pipefail
509+ code=$(curl --silent --output /dev/null --write-out "%{http_code}" \
510+ --header "Authorization: Bearer ${E2E_TOKEN}" \
511+ "${GATEFUL_URL}/ens/proposals?limit=1&skip=0" || echo "000")
512+ echo "${GATEFUL_URL}: HTTP ${code}"
513+ if [ "${code}" != "200" ]; then
514+ echo "::error::E2E_BLOCKFUL_API_TOKEN no longer authenticates against ${GATEFUL_URL}. Update it with a valid dev token: gh secret set E2E_BLOCKFUL_API_TOKEN"
515+ exit 1
516+ fi
517+
518+ - name : Run dashboard E2E tests
519+ run : pnpm dashboard test:e2e
520+ env :
521+ CI : " true"
522+ # Shared dev services, NOT the PR's own preview stack: previews run
523+ # their own authful, so the dev-issued e2e token gets 401s there.
524+ ANTICAPTURE_API_URL : https://dev-gateful.up.railway.app
525+ # The /api/user auth/session proxy throws on boot without this, and
526+ # the resulting same-origin 500s trip the suite's 5xx watcher.
527+ USER_API_URL : https://user-api-dev-9002.up.railway.app
528+ NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID : ${{ secrets.E2E_NEXT_PUBLIC_WC_PROJECT_ID }}
529+ BLOCKFUL_API_TOKEN : ${{ secrets.E2E_BLOCKFUL_API_TOKEN }}
530+ TURBO_TOKEN : ${{ secrets.TURBO_TOKEN }}
531+ TURBO_TEAM : ${{ secrets.TURBO_TEAM }}
532+
533+ - name : Upload Playwright report
534+ if : failure()
535+ uses : actions/upload-artifact@v4
536+ with :
537+ name : playwright-report
538+ path : apps/dashboard/playwright-report
539+ retention-days : 14
540+
541+ - name : Upload Playwright traces
542+ if : failure()
543+ uses : actions/upload-artifact@v4
544+ with :
545+ name : playwright-test-results
546+ path : apps/dashboard/test-results
547+ retention-days : 14
0 commit comments