-
Notifications
You must be signed in to change notification settings - Fork 0
223 lines (217 loc) · 10.2 KB
/
Copy pathci.yml
File metadata and controls
223 lines (217 loc) · 10.2 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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
name: CI
on:
pull_request:
branches: [main, dev]
# Without this, nothing ever ran on main: every recorded run came from a
# pull request, so the branch the releases are cut from had no signal of its
# own and a merge could land red without anything turning red afterwards.
# Pull-request runs test the merge commit against the base at open time, not
# what main actually became, so they are not a substitute.
push:
branches: [main]
merge_group:
# The e2e suites below are gated on the merge queue, and no merge queue is
# configured, so they had never run: 11 of 11 recorded runs skipped all three.
# A manual dispatch is the only way to exercise them without changing how
# merges work, and their secrets live in the `e2e` environment, which is
# reachable from Actions and nowhere else.
workflow_dispatch:
concurrency:
# The event belongs in the key. Without it a manual dispatch and the branch's
# pull-request runs share one group, and since the group cancels in progress,
# any push kills a dispatch already running. That makes the e2e suites, which
# take hours, impossible to finish by hand. Pushes still supersede each other
# within their own event, which is the behaviour this cancellation is for.
# Main pushes add their SHA to the key below, so this remains true without
# allowing one merged commit to cancel the verdict for its predecessor.
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.ref_name }}-${{ github.event_name == 'push' && github.sha || 'shared' }}
# Main pushes have unique groups; pull-request and manual runs keep the
# existing superseding behavior.
cancel-in-progress: true
jobs:
ci:
runs-on: ubuntu-latest
# `pnpm run test` alone measured 16:52, 17:52, 17:55 and 18:58 across four
# branches on one day, so a 20 minute job left one to three minutes for
# everything else and cancelled mid-step whenever a runner was slow. A
# cancelled check reads as neither red nor green, which is worse than a
# failure: it is easy to merge past. The suite's cost is dominated by
# per-file database setup rather than test count, so this ceiling has to
# cover that until the database fixture is shared.
timeout-minutes: 35
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
# Node 24 to match local dev and the Vercel runtime: the dashboard
# test script relies on node --test glob patterns (Node 21+).
node-version: 24
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm run typecheck
- run: pnpm run test
- run: pnpm run test:release-notes
- run: pnpm run test:ci
# Durable-workflow tests. They need their own Workflow SDK builder config,
# so vitest.config.ts cannot pick them up alongside the rest of the suite.
- run: pnpm run test:workflow-sdk
e2e-orchestration:
needs: [ci]
if: github.event_name == 'merge_group' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
timeout-minutes: 60
environment: e2e
env:
E2E_BASE_URL: ${{ secrets.E2E_BASE_URL }}
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
JIRA_PROJECT_KEY: ${{ secrets.JIRA_PROJECT_KEY }}
JIRA_WEBHOOK_SECRET: ${{ secrets.JIRA_WEBHOOK_SECRET }}
JIRA_E2E_COMMENTER_TOKEN: ${{ secrets.JIRA_E2E_COMMENTER_TOKEN }}
COLUMN_AI: ${{ secrets.COLUMN_AI }}
COLUMN_AI_REVIEW: ${{ secrets.COLUMN_AI_REVIEW }}
COLUMN_BACKLOG: ${{ secrets.COLUMN_BACKLOG }}
E2E_GITHUB_APP_ID: ${{ secrets.E2E_GITHUB_APP_ID }}
E2E_GITHUB_APP_PRIVATE_KEY: ${{ secrets.E2E_GITHUB_APP_PRIVATE_KEY }}
E2E_GITHUB_INSTALLATION_ID: ${{ secrets.E2E_GITHUB_INSTALLATION_ID }}
E2E_GITHUB_OWNER: ${{ secrets.E2E_GITHUB_OWNER }}
E2E_GITHUB_REPO: ${{ secrets.E2E_GITHUB_REPO }}
CRON_SECRET: ${{ secrets.CRON_SECRET }}
DATABASE_URL: ${{ secrets.DATABASE_URL }}
VERCEL_AUTOMATION_BYPASS_SECRET: ${{ secrets.VERCEL_AUTOMATION_BYPASS_SECRET }}
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
VERCEL_TEAM_ID: ${{ secrets.VERCEL_TEAM_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
MAX_CONCURRENT_AGENTS: ${{ secrets.MAX_CONCURRENT_AGENTS }}
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: "20.12"
cache: pnpm
- run: pnpm install --frozen-lockfile
- name: Verify required e2e secrets present
run: |
: "${DATABASE_URL:?DATABASE_URL missing in e2e environment — must be the Neon branch the deployment under test (ai-workflow-demo) uses}"
: "${VERCEL_TOKEN:?VERCEL_TOKEN missing in e2e environment}"
: "${VERCEL_TEAM_ID:?VERCEL_TEAM_ID missing in e2e environment}"
: "${VERCEL_PROJECT_ID:?VERCEL_PROJECT_ID missing in e2e environment}"
- name: Preflight — verify e2e DATABASE_URL is the migrated branch
working-directory: apps/worker
run: pnpm exec tsx e2e/scripts/check-db.ts
- run: pnpm run test:e2e:orchestration
- if: failure()
uses: actions/upload-artifact@v4
with:
name: e2e-orchestration-results
path: |
apps/worker/e2e/**/*.log
retention-days: 7
e2e-capacity:
needs: [e2e-orchestration]
if: github.event_name == 'merge_group' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
timeout-minutes: 30
environment: e2e
env:
E2E_BASE_URL: ${{ secrets.E2E_BASE_URL }}
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
JIRA_PROJECT_KEY: ${{ secrets.JIRA_PROJECT_KEY }}
JIRA_WEBHOOK_SECRET: ${{ secrets.JIRA_WEBHOOK_SECRET }}
JIRA_E2E_COMMENTER_TOKEN: ${{ secrets.JIRA_E2E_COMMENTER_TOKEN }}
COLUMN_AI: ${{ secrets.COLUMN_AI }}
COLUMN_AI_REVIEW: ${{ secrets.COLUMN_AI_REVIEW }}
COLUMN_BACKLOG: ${{ secrets.COLUMN_BACKLOG }}
E2E_GITHUB_APP_ID: ${{ secrets.E2E_GITHUB_APP_ID }}
E2E_GITHUB_APP_PRIVATE_KEY: ${{ secrets.E2E_GITHUB_APP_PRIVATE_KEY }}
E2E_GITHUB_INSTALLATION_ID: ${{ secrets.E2E_GITHUB_INSTALLATION_ID }}
E2E_GITHUB_OWNER: ${{ secrets.E2E_GITHUB_OWNER }}
E2E_GITHUB_REPO: ${{ secrets.E2E_GITHUB_REPO }}
CRON_SECRET: ${{ secrets.CRON_SECRET }}
DATABASE_URL: ${{ secrets.DATABASE_URL }}
VERCEL_AUTOMATION_BYPASS_SECRET: ${{ secrets.VERCEL_AUTOMATION_BYPASS_SECRET }}
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
VERCEL_TEAM_ID: ${{ secrets.VERCEL_TEAM_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
MAX_CONCURRENT_AGENTS: ${{ secrets.MAX_CONCURRENT_AGENTS }}
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: "20.12"
cache: pnpm
- run: pnpm install --frozen-lockfile
- name: Verify required e2e secrets present
run: |
: "${DATABASE_URL:?DATABASE_URL missing in e2e environment — must be the Neon branch the deployment under test (ai-workflow-demo) uses}"
: "${VERCEL_TOKEN:?VERCEL_TOKEN missing in e2e environment}"
: "${VERCEL_TEAM_ID:?VERCEL_TEAM_ID missing in e2e environment}"
: "${VERCEL_PROJECT_ID:?VERCEL_PROJECT_ID missing in e2e environment}"
- name: Preflight — verify e2e DATABASE_URL is the migrated branch
working-directory: apps/worker
run: pnpm exec tsx e2e/scripts/check-db.ts
- run: pnpm run test:e2e:capacity
- if: failure()
uses: actions/upload-artifact@v4
with:
name: e2e-capacity-results
path: |
apps/worker/e2e/**/*.log
retention-days: 7
e2e-agent:
needs: [e2e-capacity]
if: github.event_name == 'merge_group' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
timeout-minutes: 120
environment: e2e
env:
E2E_BASE_URL: ${{ secrets.E2E_BASE_URL }}
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
JIRA_PROJECT_KEY: ${{ secrets.JIRA_PROJECT_KEY }}
JIRA_WEBHOOK_SECRET: ${{ secrets.JIRA_WEBHOOK_SECRET }}
JIRA_E2E_COMMENTER_TOKEN: ${{ secrets.JIRA_E2E_COMMENTER_TOKEN }}
COLUMN_AI: ${{ secrets.COLUMN_AI }}
COLUMN_AI_REVIEW: ${{ secrets.COLUMN_AI_REVIEW }}
COLUMN_BACKLOG: ${{ secrets.COLUMN_BACKLOG }}
E2E_GITHUB_APP_ID: ${{ secrets.E2E_GITHUB_APP_ID }}
E2E_GITHUB_APP_PRIVATE_KEY: ${{ secrets.E2E_GITHUB_APP_PRIVATE_KEY }}
E2E_GITHUB_INSTALLATION_ID: ${{ secrets.E2E_GITHUB_INSTALLATION_ID }}
E2E_GITHUB_OWNER: ${{ secrets.E2E_GITHUB_OWNER }}
E2E_GITHUB_REPO: ${{ secrets.E2E_GITHUB_REPO }}
CRON_SECRET: ${{ secrets.CRON_SECRET }}
DATABASE_URL: ${{ secrets.DATABASE_URL }}
VERCEL_AUTOMATION_BYPASS_SECRET: ${{ secrets.VERCEL_AUTOMATION_BYPASS_SECRET }}
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
VERCEL_TEAM_ID: ${{ secrets.VERCEL_TEAM_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
MAX_CONCURRENT_AGENTS: ${{ secrets.MAX_CONCURRENT_AGENTS }}
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: "20.12"
cache: pnpm
- run: pnpm install --frozen-lockfile
- name: Verify required e2e secrets present
run: |
: "${DATABASE_URL:?DATABASE_URL missing in e2e environment — must be the Neon branch the deployment under test (ai-workflow-demo) uses}"
: "${VERCEL_TOKEN:?VERCEL_TOKEN missing in e2e environment}"
: "${VERCEL_TEAM_ID:?VERCEL_TEAM_ID missing in e2e environment}"
: "${VERCEL_PROJECT_ID:?VERCEL_PROJECT_ID missing in e2e environment}"
- name: Preflight — verify e2e DATABASE_URL is the migrated branch
working-directory: apps/worker
run: pnpm exec tsx e2e/scripts/check-db.ts
- run: pnpm run test:e2e:agent
- if: failure()
uses: actions/upload-artifact@v4
with:
name: e2e-agent-results
path: |
apps/worker/e2e/**/*.log
retention-days: 7