-
Notifications
You must be signed in to change notification settings - Fork 152
297 lines (286 loc) · 10.4 KB
/
Copy pathci.yml
File metadata and controls
297 lines (286 loc) · 10.4 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
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
name: CI
on:
push:
branches: ["**"]
pull_request:
branches: ["**"]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
changes:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
outputs:
packages: ${{ steps.filter.outputs.packages }}
web: ${{ steps.filter.outputs.web }}
steps:
- uses: actions/checkout@v7
- uses: dorny/paths-filter@v4
id: filter
with:
filters: |
# Root manifests + lockfile affect every workspace project - a
# dependency-only change must not skip the test jobs.
packages:
- 'packages/**'
- 'tsconfig.base.json'
- 'package.json'
- 'pnpm-workspace.yaml'
- 'pnpm-lock.yaml'
- '.github/workflows/ci.yml'
web:
- 'apps/web/**'
- 'packages/**'
- 'package.json'
- 'pnpm-workspace.yaml'
- 'pnpm-lock.yaml'
- '.github/workflows/ci.yml'
lint:
needs: changes
if: ${{ needs.changes.outputs.packages == 'true' }}
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v7
- uses: pnpm/action-setup@v6.0.9
- uses: actions/setup-node@v7
with:
node-version: 20
cache: pnpm
- run: pnpm install --frozen-lockfile
- name: Lint packages
run: pnpm lint
- name: Check formatting
run: pnpm format:check
typecheck-packages:
needs: changes
if: ${{ needs.changes.outputs.packages == 'true' }}
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
matrix:
node-version: [20, 22]
fail-fast: false
steps:
- uses: actions/checkout@v7
- uses: pnpm/action-setup@v6.0.9
- uses: actions/setup-node@v7
with:
node-version: ${{ matrix.node-version }}
cache: pnpm
- run: pnpm install --frozen-lockfile
- name: Build abi-registry
run: pnpm tsc -p packages/abi-registry/tsconfig.json
- name: Build pulse-core
run: pnpm tsc -p packages/pulse-core/tsconfig.json
- name: Typecheck abi-registry
run: pnpm tsc --noEmit -p packages/abi-registry/tsconfig.json
- name: Typecheck pulse-webhooks
run: pnpm tsc --noEmit -p packages/pulse-webhooks/tsconfig.json
- name: Typecheck pulse-notify
run: pnpm tsc --noEmit -p packages/pulse-notify/tsconfig.json
- name: Typecheck anchor-sdk
run: pnpm tsc --noEmit -p packages/anchor-sdk/tsconfig.json
- name: Validate ABI specs
run: pnpm --filter @orbital-stellar/abi-registry validate
- name: Generate Horizon types & check drift
run: |
node scripts/generate-horizon-types.mjs
git diff --exit-code packages/pulse-core/src/_raw-horizon.gen.ts || {
echo "ERROR: Generated Horizon types are stale. Run 'pnpm generate:horizon-types' and commit the changes."
exit 1
}
- name: Test packages
run: pnpm -r --if-present test
bundle-size:
needs: changes
if: ${{ needs.changes.outputs.packages == 'true' }}
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v7
- uses: pnpm/action-setup@v6.0.9
- uses: actions/setup-node@v7
with:
node-version: 20
cache: pnpm
- run: pnpm install --frozen-lockfile
- name: Build abi-registry
run: pnpm tsc -p packages/abi-registry/tsconfig.json
- name: Build pulse-core
run: pnpm tsc -p packages/pulse-core/tsconfig.json
- name: Build pulse-notify
run: pnpm tsc -p packages/pulse-notify/tsconfig.json
- name: Check bundle size
id: size
run: pnpm --filter @orbital-stellar/pulse-notify size
- name: Explain the budget failure
# size-limit prints the size and the delta against the budget; --why
# adds the top contributing modules, which is what you actually need to
# decide whether a dependency or your own code moved the number.
if: failure() && steps.size.outcome == 'failure'
run: pnpm --filter @orbital-stellar/pulse-notify run size:why
chaos-tests:
needs: changes
if: ${{ needs.changes.outputs.packages == 'true' }}
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v7
- uses: pnpm/action-setup@v6.0.9
- uses: actions/setup-node@v7
with:
node-version: 20
cache: pnpm
- run: pnpm install --frozen-lockfile
# pulse-core imports @orbital-stellar/abi-registry, which resolves to its
# dist output - the suite cannot load without it built first.
- name: Build abi-registry
run: pnpm tsc -p packages/abi-registry/tsconfig.json
# Fixed seed on PRs so a failure here is always reproducible from the
# branch alone. nightly-chaos.yml runs the same suite with a random seed.
- name: Reconnection chaos suite (fixed seed)
env:
CHAOS_SEED: "20260802"
run: pnpm --filter @orbital-stellar/pulse-core exec vitest run test/chaos
typecheck-web:
needs: changes
if: ${{ needs.changes.outputs.web == 'true' }}
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v7
- uses: pnpm/action-setup@v6.0.9
- uses: actions/setup-node@v7
with:
node-version: 20
cache: pnpm
- run: pnpm install --frozen-lockfile
- name: Build abi-registry
run: pnpm tsc -p packages/abi-registry/tsconfig.json
- name: Build pulse-core
run: pnpm tsc -p packages/pulse-core/tsconfig.json
- name: Build pulse-webhooks
run: pnpm tsc -p packages/pulse-webhooks/tsconfig.json
- name: Typecheck apps/web
run: pnpm tsc --noEmit -p apps/web/tsconfig.json
build-web:
needs: changes
if: ${{ needs.changes.outputs.web == 'true' }}
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v7
- uses: pnpm/action-setup@v6.0.9
- uses: actions/setup-node@v7
with:
node-version: 20
cache: pnpm
- run: pnpm install --frozen-lockfile
# orbital/web's prebuild builds pulse-core + pulse-webhooks (with their
# workspace deps, incl. abi-registry) and generates reference docs, so
# no manual dependency-order steps here.
- name: Build apps/web
env:
# Canary secrets for the post-build client-bundle assertion. None of
# these may appear in .next/static (#892, #926).
DEMO_EMITTER_SECRET: SDEMOSECRET_CANARY_DO_NOT_SHIP_000000000000000000000000000
SOROBAN_INVOKER_SECRET: SINVOKER_CANARY_DO_NOT_SHIP_00000000000000000000000000000
UPSTASH_REDIS_REST_TOKEN: UPSTASH_CANARY_DO_NOT_SHIP_000000000000000000000000000
run: pnpm --filter orbital/web run build
- name: Assert no secret reaches the client bundle
env:
# Canary values for every secret the web app can read; the assertion
# greps .next/static for each. See SECURITY.md for the inventory.
DEMO_EMITTER_SECRET: SDEMOSECRET_CANARY_DO_NOT_SHIP_000000000000000000000000000
SOROBAN_INVOKER_SECRET: SINVOKER_CANARY_DO_NOT_SHIP_00000000000000000000000000000
UPSTASH_REDIS_REST_TOKEN: UPSTASH_CANARY_DO_NOT_SHIP_000000000000000000000000000
run: node scripts/assert-no-secrets-in-bundle.mjs
cli-smoke-test:
needs: changes
if: ${{ needs.changes.outputs.packages == 'true' }}
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v7
- uses: pnpm/action-setup@v6.0.9
- uses: actions/setup-node@v7
with:
node-version: 20
cache: pnpm
- run: pnpm install --frozen-lockfile
- name: Build abi-registry
run: pnpm tsc -p packages/abi-registry/tsconfig.json
- name: Build pulse-core
run: pnpm tsc -p packages/pulse-core/tsconfig.json
- name: Build pulse-webhooks
run: pnpm tsc -p packages/pulse-webhooks/tsconfig.json
- name: Smoke test pulse-core (--help, --version)
run: |
cd packages/pulse-core
pnpm pack --pack-destination /tmp/orbital-smoke
cd /tmp/orbital-smoke
npm install -g ./orbital-stellar-pulse-core-*.tgz
orbital --help
orbital --version
orbital cursor --help
orbital typegen --help
npm uninstall -g @orbital-stellar/pulse-core
- name: Smoke test pulse-webhooks (--help, --version)
run: |
cd packages/pulse-webhooks
pnpm pack --pack-destination /tmp/orbital-smoke
cd /tmp/orbital-smoke
npm install -g ./orbital-stellar-pulse-webhooks-*.tgz
orbital-dlq --help
orbital-dlq --version
npm uninstall -g @orbital-stellar/pulse-webhooks
- name: Smoke test abi-registry (--help, --version)
run: |
cd packages/abi-registry
pnpm pack --pack-destination /tmp/orbital-smoke
cd /tmp/orbital-smoke
npm install -g ./orbital-stellar-abi-registry-*.tgz
abi-registry-generate --help
abi-registry-generate --version
npm uninstall -g @orbital-stellar/abi-registry
coverage:
needs: changes
if: ${{ needs.changes.outputs.packages == 'true' }}
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v7
- uses: pnpm/action-setup@v6.0.9
- uses: actions/setup-node@v7
with:
node-version: 20
cache: pnpm
- run: pnpm install --frozen-lockfile
# Every package must be built, not just abi-registry: workspace packages
# resolve each other through their published `main` (./dist/index.js), so
# a cross-package import in a test file - e.g. anchor-sdk's sep10 suite
# importing WebAuth from pulse-core - fails to resolve without a dist.
- name: Build packages
run: pnpm build
- name: Run coverage (thresholds enforced)
run: pnpm -r --if-present test:coverage
- name: Upload coverage reports
if: always()
uses: actions/upload-artifact@v7
with:
name: coverage-reports
path: |
packages/*/coverage/
retention-days: 14