-
Notifications
You must be signed in to change notification settings - Fork 1
500 lines (437 loc) · 16.2 KB
/
ci.yml
File metadata and controls
500 lines (437 loc) · 16.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
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
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
name: CI
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
permissions:
contents: read
packages: read
env:
GOPRIVATE: github.com/GoCodeAlone/*
GONOSUMCHECK: github.com/GoCodeAlone/*
# CI runners are ephemeral; the iac/diffcache filesystem cache would
# cold-miss every job and waste a few ms on disk I/O. Force in-memory
# mode per the T3.5 rev3 lifecycle constraint — no filesystem writes
# in containerized runners. Operators running wfctl locally see the
# default filesystem cache at ~/.cache/wfctl/diff/.
WFCTL_DIFFCACHE: ":memory:"
jobs:
test:
name: Test (Go ${{ matrix.go-version }})
runs-on: ubuntu-latest
needs: [go-mod-tidy]
permissions:
contents: read
packages: read
strategy:
matrix:
go-version: ['1.26.4']
steps:
- name: Check out code
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Set up Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: ${{ matrix.go-version }}
cache: false
- name: Set up Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: '24'
registry-url: 'https://npm.pkg.github.com'
cache: 'npm'
cache-dependency-path: ui/package-lock.json
- name: Build UI assets
run: |
cd ui && npm ci && npm run build
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Download dependencies
run: |
go mod download
go mod verify
- name: Run tests
run: |
go test -v -race -coverprofile=coverage.out ./...
- name: Check Codecov token
id: codecov-token
if: always()
run: |
if [ -n "$CODECOV_TOKEN" ]; then
echo "available=true" >> "$GITHUB_OUTPUT"
else
echo "available=false" >> "$GITHUB_OUTPUT"
fi
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Upload coverage reports
uses: codecov/codecov-action@75cd11691c0faa626561e295848008c8a7dddffe # v5.5.4
if: always() && steps.codecov-token.outputs.available == 'true'
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.out
fail_ci_if_error: false
lint:
name: Lint
runs-on: ubuntu-latest
needs: [go-mod-tidy]
permissions:
contents: read
packages: read
steps:
- name: Check out code
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Set up Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: '1.26.4'
cache: false
- name: Set up Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: '24'
registry-url: 'https://npm.pkg.github.com'
cache: 'npm'
cache-dependency-path: ui/package-lock.json
- name: Build UI assets
run: |
cd ui && npm ci && npm run build
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run golangci-lint
uses: golangci/golangci-lint-action@82606bf257cbaff209d206a39f5134f0cfbfd2ee # v9.2.1
with:
version: v2.12.0
args: --timeout=10m
build:
name: Build
runs-on: ubuntu-latest
needs: [go-mod-tidy]
permissions:
contents: read
packages: read
steps:
- name: Check out code
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Set up Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: '1.26.4'
cache: false
- name: Set up Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: '24'
registry-url: 'https://npm.pkg.github.com'
cache: 'npm'
cache-dependency-path: ui/package-lock.json
- name: Build UI assets
run: |
cd ui && npm ci && npm run build
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build server binary
run: go build -v -o /dev/null ./cmd/server
- name: Build all packages
run: go build -v ./...
- name: Upload UI build artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: admin-ui-dist
path: ui/dist/
retention-days: 3
build-examples:
name: Build Examples
runs-on: ubuntu-latest
needs: [go-mod-tidy]
permissions:
contents: read
packages: read
steps:
- name: Check out code
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Set up Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: '1.26.4'
cache: false
- name: Build examples
run: |
cd example
go build -v ./...
lint-examples:
name: Lint Examples
runs-on: ubuntu-latest
needs: [go-mod-tidy]
permissions:
contents: read
packages: read
steps:
- name: Check out code
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Set up Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: '1.26.4'
cache: false
- name: Run golangci-lint on examples
uses: golangci/golangci-lint-action@82606bf257cbaff209d206a39f5134f0cfbfd2ee # v9.2.1
with:
version: v2.12.0
args: --timeout=10m
working-directory: example
go-mod-tidy:
name: Go Mod Tidy
runs-on: ubuntu-latest
permissions:
contents: write
packages: read
steps:
- name: Check out code
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: '1.26.4'
cache: false
- name: Run go mod tidy (workflow)
run: go mod tidy
- name: Run go mod tidy (examples)
run: |
cd example
go mod tidy
- name: Commit tidy changes
if: github.event_name == 'push'
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git diff --quiet go.mod go.sum example/go.mod example/go.sum || {
git add go.mod go.sum example/go.mod example/go.sum
git commit -m "chore: go mod tidy"
git push
}
- name: Fail if go mod tidy produced changes (PR check)
if: github.event_name == 'pull_request'
run: |
git diff --exit-code go.mod go.sum
git diff --exit-code example/go.mod example/go.sum
ui-test:
name: UI Tests
runs-on: ubuntu-latest
permissions:
contents: read
packages: read
defaults:
run:
working-directory: ui
steps:
- name: Check out code
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Set up Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: '24'
registry-url: 'https://npm.pkg.github.com'
cache: 'npm'
cache-dependency-path: ui/package-lock.json
- name: Install dependencies
run: npm ci
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Lint
run: npm run lint
- name: Unit tests
run: npm test -- --run
# Validate all example workflow configs at three levels:
# 1. YAML parsing (can it be loaded?)
# 2. Schema validation (correct types, required fields, valid references?)
# 3. Engine loading (can BuildFromConfig produce a working engine?)
example-configs:
name: Validate Example Configs
runs-on: ubuntu-latest
needs: [go-mod-tidy]
permissions:
contents: read
packages: read
steps:
- name: Check out code
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Set up Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: '1.26.4'
cache: false
- name: Set up Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: '24'
registry-url: 'https://npm.pkg.github.com'
cache: 'npm'
cache-dependency-path: ui/package-lock.json
- name: Build UI assets
run: |
cd ui && npm ci && npm run build
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: YAML parsing — all configs loadable
run: go test -v -run TestExampleConfigsLoad -timeout 60s .
- name: Schema validation — types, fields, dependencies
run: go test -v -run TestExampleConfigsValidate -timeout 60s .
- name: Engine loading — BuildFromConfig + start/stop cycle
run: go test -v -run TestExampleConfigsBuildFromConfig -timeout 120s .
- name: Build example runner binary
run: |
cd example
go build -o workflow-example .
- name: Smoke test — run each config with timeout
run: |
cd example
passed=0
warned=0
total=0
for config in $(find . -name "*.yaml" \
-not -path "*/configs/*" -not -path "*/seed/*" -not -path "*/observability/*" \
-not -path "*/spa/*" -not -path "*/components/*" -not -path "*/node_modules/*" \
-not -path "*/e2e/*" -not -path "*/data/*" -not -path "*/.*" \
-not -name "docker-compose.yaml" -not -name "docker-compose.yml" | sort); do
total=$((total + 1))
echo -n " $config ... "
# Run with timeout — exit 124 means timeout (expected for servers)
if timeout 10s ./workflow-example -config "$config" >/tmp/workflow-example.out 2>&1; then
echo "OK (exited cleanly)"
passed=$((passed + 1))
else
rc=$?
if [ "$rc" -eq 124 ]; then
echo "OK (server timeout — expected)"
passed=$((passed + 1))
else
echo "WARN (exit $rc — may need runtime deps)"
warned=$((warned + 1))
fi
fi
done
echo ""
echo "Results: $total configs, $passed passed, $warned warnings"
godo-banned:
name: Verify godo is not imported (issue #617)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Grep gate — *.go files must not import godo
run: |
! grep -rn --include="*.go" \
--exclude-dir=_worktrees \
--exclude-dir=.worktrees \
--exclude-dir=.claude \
--exclude="godo_absent_test.go" \
"digitalocean/godo" .
- name: Grep gate — go.mod files must not list godo
run: |
! grep -qH "digitalocean/godo" go.mod example/go.mod
cloud-sdk-audit:
name: Cloud-SDK inventory + k8s-backend init() partition + asymmetric graph audit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version-file: go.mod
cache: false
- name: Download module deps (needed for `go list -deps`)
env:
GOWORK: "off"
run: go mod download
- name: Audit cloud-SDK imports + init() partition + Phase C asymmetric gate
# The script enforces (once .phase-c-complete is armed):
# - module/ zero gcp/azure SDK real imports
# - build graph: zero Azure/azure-sdk-for-go, zero google.golang.org/api,
# zero cloud.google.com/go except compute/metadata (OAuth2 ADC helper
# legitimately pulled by provider/gcp's service-account auth).
run: bash scripts/audit-cloud-symbols.sh --check
- name: Standalone asymmetric gate — `go list -deps` (mirrors audit script)
# Independent assertion of the same invariant for clarity in CI failure logs.
# Any cloud.google.com/go path other than compute/metadata fails the build.
env:
GOWORK: "off"
run: |
set +e
DEPS=$(go list -deps ./... 2>&1)
LIST_EXIT=$?
set -e
if [ "$LIST_EXIT" -ne 0 ]; then
echo "FAIL: \`go list -deps ./...\` exited $LIST_EXIT (gate cannot enforce):"
echo "$DEPS" | head -10 | sed 's/^/ /'
exit 1
fi
# `|| true` on grep is fine: exit 1 from grep means "no matches" = success.
UNEXPECTED=$(echo "$DEPS" \
| grep -E '^(cloud\.google\.com/go|google\.golang\.org/api|github\.com/Azure/azure-sdk-for-go)' \
| grep -v '^cloud\.google\.com/go/compute/metadata$' \
|| true)
if [ -n "$UNEXPECTED" ]; then
echo "FAIL: unexpected gcp/azure/api transitive deps in workflow-core build graph:"
while IFS= read -r dep; do
printf ' %s\n' "$dep"
done <<< "$UNEXPECTED"
echo
echo "Only cloud.google.com/go/compute/metadata is allowlisted (OAuth2 ADC helper)."
echo "Other gcp/azure SDK packages belong in a plugin, not workflow core."
echo "See docs/migrations/2026-05-15-plugin-modules-on-iac.md (Phase C)."
exit 1
fi
aws-sdk-banned:
name: Verify removed AWS SDK packages are not imported (issue #653)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Grep gate — no *.go file (repo-wide) may import fully-removed AWS service packages
# Scans the whole repo. service/eks is allowed only in provider/ (ECS/EKS deploy pipeline).
# platform/providers/aws/ was deleted in Phase 3; provider/aws/ (deploy pipeline) is kept.
run: |
! grep -rn --include="*.go" \
--exclude-dir=_worktrees \
--exclude-dir=.worktrees \
--exclude-dir=.claude \
--exclude="aws_absent_test.go" \
--exclude="nosql_dynamodb.go" \
-e "aws-sdk-go-v2/service/apigatewayv2" \
-e "aws-sdk-go-v2/service/applicationautoscaling" \
-e "aws-sdk-go-v2/service/route53" \
-e "aws-sdk-go-v2/service/codebuild" \
-e "aws-sdk-go-v2/service/ec2" \
-e "aws-sdk-go-v2/service/dynamodb" \
-e "aws-sdk-go-v2/service/elasticloadbalancingv2" \
-e "aws-sdk-go-v2/service/rds" \
-e "aws-sdk-go-v2/service/sqs" \
.
- name: Grep gate — service/eks must only appear in provider/ (deploy pipeline)
# platform/providers/aws/ was deleted in Phase 3; only provider/aws/ legitimately uses
# service/eks for ECS/EKS deploy pipeline. Any new import outside provider/ is a regression.
run: |
! grep -rn --include="*.go" \
--exclude-dir=_worktrees \
--exclude-dir=.worktrees \
--exclude-dir=.claude \
--exclude="aws_absent_test.go" \
--exclude-dir="provider" \
-e "aws-sdk-go-v2/service/eks" \
.
- name: Grep gate — go.mod files must not list removed AWS SDK packages
# service/eks is intentionally omitted from this go.mod gate: provider/aws/ (deploy
# pipeline) has a legitimate caller. ec2/dynamodb/elb/rds/sqs are added here because
# platform/providers/aws/ (their only consumer) was deleted in Phase 3.
run: |
! grep -qH \
-e "aws-sdk-go-v2/service/apigatewayv2" \
-e "aws-sdk-go-v2/service/applicationautoscaling" \
-e "aws-sdk-go-v2/service/route53" \
-e "aws-sdk-go-v2/service/ec2" \
-e "aws-sdk-go-v2/service/dynamodb" \
-e "aws-sdk-go-v2/service/elasticloadbalancingv2" \
-e "aws-sdk-go-v2/service/rds" \
-e "aws-sdk-go-v2/service/sqs" \
go.mod example/go.mod