-
Notifications
You must be signed in to change notification settings - Fork 0
124 lines (120 loc) · 4.33 KB
/
Copy pathci.yml
File metadata and controls
124 lines (120 loc) · 4.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
quality:
name: Lint · Typecheck · Unit
runs-on: ubuntu-latest
# The unit/integration suite hits a real Postgres + Redis + MinIO (no
# mocks, per CLAUDE.md). Run sequentially (--no-file-parallelism): the
# shared-DB integration tests have cross-test contention under
# file-parallelism.
services:
postgres:
image: postgres:16-alpine
env:
POSTGRES_USER: forge
POSTGRES_PASSWORD: forge
POSTGRES_DB: forge
ports: ["5432:5432"]
options: >-
--health-cmd="pg_isready -U forge"
--health-interval=5s --health-timeout=5s --health-retries=10
redis:
image: redis:7-alpine
ports: ["6379:6379"]
minio:
# Bitnami's Docker Hub namespace moved historical images to
# bitnamilegacy. This image runs `minio server` by default (GH service
# containers can't pass a command), exposing the S3 API on :9000.
image: bitnamilegacy/minio:latest
env:
MINIO_ROOT_USER: forgeminio
MINIO_ROOT_PASSWORD: forgeminio-dev-password
ports: ["9000:9000"]
options: >-
--health-cmd="mc ready local || curl -f http://localhost:9000/minio/health/live"
--health-interval=5s --health-timeout=5s --health-retries=20
env:
DATABASE_URL: postgresql://forge:forge@localhost:5432/forge?schema=public
DIRECT_URL: postgresql://forge:forge@localhost:5432/forge?schema=public
REDIS_URL: redis://localhost:6379
AUTH_SECRET: test-secret-test-secret-test-secret
S3_ENDPOINT: http://localhost:9000
S3_PUBLIC_ENDPOINT: http://localhost:9000
S3_REGION: us-east-1
S3_ACCESS_KEY: forgeminio
S3_SECRET_KEY: forgeminio-dev-password
S3_FORCE_PATH_STYLE: "true"
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with: { version: 10.33.0 }
- uses: actions/setup-node@v4
with: { node-version: 20, cache: "pnpm" }
- run: pnpm install --frozen-lockfile
- run: pnpm prisma:generate
- run: pnpm exec prisma migrate deploy
- run: pnpm lint
- run: pnpm typecheck
- run: pnpm test --no-file-parallelism
e2e:
name: Playwright E2E (shard ${{ matrix.shard }}/${{ strategy.job-total }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
shard: [1, 2]
services:
postgres:
image: postgres:16-alpine
env:
POSTGRES_USER: forge
POSTGRES_PASSWORD: forge
POSTGRES_DB: forge_e2e
ports: ["5432:5432"]
options: >-
--health-cmd="pg_isready -U forge -d forge_e2e"
--health-interval=5s --health-timeout=5s --health-retries=10
redis:
image: redis:7-alpine
ports: ["6379:6379"]
env:
# E2E harness (see scripts/e2e-web.sh + playwright.config.ts).
E2E_MANAGE_STACK: "0" # use the service containers above, not docker-compose
E2E_PORT: "3200"
FORGE_E2E: "1" # mock-runs connector + seed fixtures
DATABASE_URL: postgresql://forge:forge@localhost:5432/forge_e2e?schema=public
REDIS_URL: redis://localhost:6379
AUTH_SECRET: test-secret-test-secret-test-secret
AUTH_URL: http://localhost:3200
AUTH_TRUST_HOST: "true"
NEXT_PUBLIC_APP_URL: http://localhost:3200
PLAYWRIGHT_BASE_URL: http://localhost:3200
ADMIN_EMAIL: owner@forge.local
ADMIN_PASSWORD: forge-dev
ADMIN_NAME: Forge Owner
ADMIN_HANDLE: forge
PLUGIN_JWT_SECRET: test-plugin-secret
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with: { version: 10.33.0 }
- uses: actions/setup-node@v4
with: { node-version: 20, cache: "pnpm" }
- run: pnpm install --frozen-lockfile
- run: pnpm prisma:generate
- run: pnpm exec playwright install --with-deps chromium
# e2e-web.sh (the Playwright webServer) migrates + seeds the forge_e2e DB.
- run: pnpm exec playwright test --shard=${{ matrix.shard }}/2
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report-${{ matrix.shard }}
path: playwright-report/