Skip to content
Merged
Show file tree
Hide file tree
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
49 changes: 0 additions & 49 deletions .github/workflows/check.yml

This file was deleted.

92 changes: 92 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: CI

on:
push:
branches: [cloudflare-workers, main]
pull_request:

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

# Target: the whole workflow finishes in under 2 minutes. The three jobs run in parallel and every
# one of them restores the pnpm store (and, for e2e, the Playwright browsers and the build) from cache.
jobs:
typecheck:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
- run: pnpm install --frozen-lockfile --prefer-offline
- run: npx tsc --noEmit -p .

integration:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
- run: pnpm install --frozen-lockfile --prefer-offline
# Real D1 (workerd) with the production migrations: authorization, balances, expenses, recurrence.
- run: pnpm test:integration

e2e:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
- run: pnpm install --frozen-lockfile --prefer-offline

- name: Resolve Playwright version
id: pw
run: echo "version=$(node -p "require('@playwright/test/package.json').version")" >> "$GITHUB_OUTPUT"
- name: Cache Playwright browsers
id: pw-cache
uses: actions/cache@v4
with:
path: ~/.cache/ms-playwright
key: playwright-${{ runner.os }}-${{ steps.pw.outputs.version }}
- name: Install Chromium
run: |
if [ "${{ steps.pw-cache.outputs.cache-hit }}" = "true" ]; then
npx playwright install-deps chromium
else
npx playwright install --with-deps chromium
fi

- name: Cache the production build
id: build-cache
uses: actions/cache@v4
with:
path: dist
key: build-${{ runner.os }}-${{ hashFiles('src/**', 'worker/**', 'public/**', 'migrations/**', 'package.json', 'pnpm-lock.yaml', 'vite*.ts', 'next.config.js', 'wrangler.example.jsonc', 'tsconfig.json') }}
- name: Build
if: steps.build-cache.outputs.cache-hit != 'true'
run: |
cp wrangler.example.jsonc wrangler.jsonc
SKIP_ENV_VALIDATION=1 pnpm build

- run: pnpm test:e2e
env:
CI: '1'
- name: Upload Playwright traces on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: playwright-traces
path: test-results
retention-days: 3
14 changes: 14 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,17 @@ SEED_STATISTICS.md
# Agents
.worktrees/
docs/superpowers/

.dev.vars
.wrangler/
dist/
.vinext/

# Personal Cloudflare deployment config (copy wrangler.example.jsonc to wrangler.jsonc)
wrangler.jsonc

# e2e artifacts
.e2e-state
.e2e-seed.sql
test-results
playwright-report
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
public-hoist-pattern[]=@radix-ui/*
Loading
Loading