fix(#712/#711/#710/#709): wire auth tokens, mock IDs, limits API, set… #368
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: | |
| push: | |
| branches: | |
| - main | |
| - staging | |
| pull_request: | |
| branches: | |
| - main | |
| - staging | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| typecheck: | |
| name: Typecheck | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4 | |
| with: | |
| version: 9 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: "22" | |
| cache: "pnpm" | |
| - name: Verify pnpm lockfile is the only lockfile | |
| run: | | |
| if [ -f package-lock.json ] || [ -f yarn.lock ] || [ -f npm-shrinkwrap.json ]; then | |
| echo "::error::Found a non-pnpm lockfile. This repo only tracks pnpm-lock.yaml." | |
| exit 1 | |
| fi | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| # Runs `tsc --noEmit` against the same tsconfig.json used by `next | |
| # build` (via the `next` compiler plugin), so a type error here is | |
| # guaranteed to also fail the build step below. This job intentionally | |
| # runs before build/test so type errors fail fast. | |
| - name: Typecheck | |
| run: pnpm run typecheck | |
| unit-tests: | |
| name: Unit tests (Vitest) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4 | |
| with: | |
| version: 9 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: "22" | |
| cache: "pnpm" | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Run unit/component tests | |
| run: pnpm test | |
| e2e-tests: | |
| name: E2E smoke tests (Playwright) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4 | |
| with: | |
| version: 9 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: "22" | |
| cache: "pnpm" | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| # The specs drive a `pnpm run dev` server (see playwright.config.ts) and | |
| # only need Chromium. `--with-deps` pulls the OS libraries the browser | |
| # needs on the ubuntu runner. | |
| - name: Install Playwright browser (Chromium) | |
| run: pnpm exec playwright install --with-deps chromium | |
| # NEXT_PUBLIC_API_URL is left empty on purpose: the specs run against the | |
| # in-repo mock `/api/*` routes so they need no live backend or secrets. | |
| - name: Run Playwright e2e smoke tests | |
| run: pnpm run test:e2e | |
| env: | |
| NEXT_PUBLIC_API_URL: "" | |
| build: | |
| name: Build (${{ matrix.network }}) | |
| needs: [typecheck, unit-tests] | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| # `next build` type-checks and statically analyzes every route, | |
| # including the API routes that branch on NEXT_PUBLIC_API_URL | |
| # (see src/app/api/auth/login/route.ts and | |
| # src/lib/api/config.ts::getApiBaseUrl()). Building once with a | |
| # testnet-shaped URL and once with a mainnet-shaped URL catches | |
| # env-specific breakage before it reaches either environment. | |
| network: [testnet, mainnet] | |
| include: | |
| - network: testnet | |
| api_url: https://testnet-api.example.com | |
| - network: mainnet | |
| api_url: https://api.example.com | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4 | |
| with: | |
| version: 9 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: "22" | |
| cache: "pnpm" | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Build | |
| run: pnpm run build | |
| env: | |
| NEXT_PUBLIC_API_URL: ${{ matrix.api_url }} |