Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
168 changes: 167 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,178 @@
name: ci

on:
push:
branches: [main, staging, dev]
pull_request:
branches: [staging]
branches: [main, staging, dev]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
# ============================================================================
# Build
# ============================================================================
build:
name: Build
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: 'pnpm'

- name: Cache Turborepo
uses: actions/cache@v4
with:
path: .turbo
key: turbo-${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}

- name: Install dependencies
run: pnpm install

- name: Run build
run: pnpm build

# ============================================================================
# Lint
# ============================================================================
lint:
name: Lint
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: 'pnpm'

- name: Cache Turborepo
uses: actions/cache@v4
with:
path: .turbo
key: turbo-${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}

- name: Install dependencies
run: pnpm install

- name: Run prettier check
run: pnpm format:check

- name: Run lint
run: pnpm lint

# ============================================================================
# Tests (matrix: Node 20, 22, 24)
# ============================================================================
test:
name: Tests (node ${{ matrix.node }})
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
node: [20, 22, 24]

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: 'pnpm'

- name: Cache Turborepo
uses: actions/cache@v4
with:
path: .turbo
key: turbo-${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}

- name: Install dependencies
run: pnpm install

- name: Run tests
run: pnpm test

# Apps/web SEO regression suite (apps/web/tests/seo). Runs after the
# root test pipeline so we benefit from the existing install cache.
# The suite is a pure-Vitest run; no real Next build is required.
- name: Run apps/web SEO tests
run: pnpm --filter web test:run

# Apps/web has a test-specific tsconfig that enables
# `allowImportingTsExtensions` so tests can target routes whose
# directory names contain a dot (e.g. `llms.txt/route.ts`). The
# production tsconfig does not enable it, so we run type-check:test
# explicitly. The regular `pnpm turbo type-check` is run on the
# rest of the workspace by the `Type Check` job below.
- name: Type-check apps/web test suite
run: pnpm --filter web type-check:test

# ============================================================================
# Type Check (matrix: Node 20, 22, 24)
# ============================================================================
type-check:
name: Type Check (node ${{ matrix.node }})
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
node: [20, 22, 24]

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: 'pnpm'

- name: Cache Turborepo
uses: actions/cache@v4
with:
path: .turbo
key: turbo-${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}

- name: Install dependencies
run: pnpm install

- name: Run type check
run: pnpm turbo type-check

# ============================================================================
# Changeset required (PRs to staging only)
# ============================================================================
changeset-check:
name: Changeset required
if: github.event_name == 'pull_request' && github.base_ref == 'staging'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down
Loading