-
-
Notifications
You must be signed in to change notification settings - Fork 0
104 lines (94 loc) · 4.01 KB
/
Copy pathci.yml
File metadata and controls
104 lines (94 loc) · 4.01 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
name: CI
on:
push:
branches: [main]
tags: ["v*"]
pull_request:
branches: [main]
jobs:
test:
strategy:
matrix:
include:
- arch: amd64
runner: ubuntu-latest
- arch: arm64
runner: ubuntu-24.04-arm
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@v6
- name: Set up Go
uses: actions/setup-go@v7
with:
go-version: "1.26"
# CGO_ENABLED=0 throughout, matching .goreleaser.yaml: the SQLite driver
# is pure Go, and testing the mode that ships is the point — a cgo-only
# driver once compiled here and then died at startup in every release
# archive, because nothing exercised the released build configuration.
- name: Run Go tests
# ./... rather than ./internal/... so cmd/devcloud's ServicePlugin
# conformance test runs in CI too.
run: go test ./... -v
env:
CGO_ENABLED: "0"
- name: Build Go binaries
run: |
CGO_ENABLED=0 go build -o dist/devcloud ./cmd/devcloud
CGO_ENABLED=0 go build -o dist/codegen ./tools/codegen
# docs/coverage.md publishes the binary size, and the single-binary,
# zero-config property is what that figure is evidence for. Nothing
# checked it, so a regression would have been found by a reader rather
# than by CI. The startup half of the same claim is gated in
# cmd/devcloud/budget_test.go.
#
# 45 MiB is a regression ceiling, not the published figure: coverage.md
# measures 36.8 MiB on Apple Silicon and this builds for linux, so the two
# are not the same number and a tight budget would fail on the difference.
# The ceiling is named in coverage.md's runtime section, so a reader who
# hits this failure finds it where the 36.8 MiB is.
#
# stat -c%s is GNU stat: this job runs only on the ubuntu runners above.
- name: Check the binary stays within its regression ceiling
run: |
size=$(stat -c%s dist/devcloud)
limit=$((45 * 1024 * 1024))
echo "dist/devcloud: $((size / 1024 / 1024)) MiB (ceiling $((limit / 1024 / 1024)) MiB)"
if [ "$size" -gt "$limit" ]; then
echo "::error::dist/devcloud exceeds the 45 MiB ceiling docs/coverage.md names, against a published 36.8 MiB. Raising the ceiling is a decision; first find what grew."
exit 1
fi
# internal/generated is committed but derived. The Go tests check the fidelity
# manifest's shape — floors, registered services, the CRUD registry — none of
# which notice an operation a provider gained and the manifest never did.
# Regenerating and diffing is the only check that does.
codegen-drift:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up Go
uses: actions/setup-go@v7
with:
go-version: "1.26"
# Regenerating in place only overwrites the filenames the generator still
# emits — it never removes one it has stopped emitting, and
# internal/codegen/generator.go has no deletion path at all. Clearing the
# tree first turns a retired or renamed output into a visible deletion.
# Every tracked file under internal/generated carries a generated marker,
# so nothing hand-written is lost.
#
# No SQLite headers: tools/codegen builds with CGO_ENABLED=0.
- name: Regenerate from a clean tree
run: |
rm -rf internal/generated
make codegen
- name: Check the committed output is current
# --porcelain rather than `git diff --exit-code` so an added or removed
# file counts as drift instead of being silently dropped, matching
# smithy-sync.yml's check.
run: |
drift="$(git status --porcelain internal/generated)"
if [ -n "$drift" ]; then
echo "$drift"
echo "::error::internal/generated is stale. Run 'make codegen' and commit the result."
exit 1
fi