-
Notifications
You must be signed in to change notification settings - Fork 0
140 lines (129 loc) · 5.07 KB
/
Copy pathci.yml
File metadata and controls
140 lines (129 loc) · 5.07 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
name: CI
# docs/ is a BUILD INPUT: docs/embed.go compiles the whole corpus into the binary
# (spec 32), so a doc-only change can ship a broken cross-link inside a release.
# Only files that are genuinely not compiled in may be skipped here.
on:
push:
branches: [main]
paths-ignore: ["README.md", "PROGRESS.md", "LICENSE", "NOTICE"]
pull_request:
paths-ignore: ["README.md", "PROGRESS.md", "LICENSE", "NOTICE"]
permissions:
contents: read
# Cancel superseded runs on the same ref (fail-fast + CI economy).
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
env:
# Single enforced Go toolchain floor (DECISIONS, ARCHITECTURE §7.8).
GO_VERSION: "1.25"
jobs:
# One consolidated lane ordered cheap → expensive so a lint/unit failure stops
# before the costly Docker + cross-compile work. actions/setup-go caches the
# module + build cache (keyed by go.sum). ubuntu-latest ships Docker, used by
# the integration + e2e steps.
ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
check-latest: true
cache: true # GOMODCACHE + GOCACHE, keyed by go.sum
# --- cheap, high-signal (fail fast) ---
- name: gofmt
run: |
unformatted=$(gofmt -l .)
if [ -n "$unformatted" ]; then
echo "These files are not gofmt-clean:"; echo "$unformatted"; exit 1
fi
- name: go vet
run: go vet ./...
- name: installer lint (shellcheck + POSIX sh)
run: |
shellcheck --severity=warning install.sh
sh -n install.sh
- name: build (CGO disabled — static binary invariant)
run: CGO_ENABLED=0 go build ./...
- name: unit tests -race
env:
CGO_ENABLED: "1" # the race detector requires cgo (see Makefile)
run: go test -race ./...
- name: smoke (built binary, end-to-end in an XDG sandbox)
run: make smoke
- name: determinism (byte-identical generation)
run: make determinism
# --- medium ---
- name: cross-compile (4 CGO-free release targets)
env:
CGO_ENABLED: "0"
run: |
for t in linux/amd64 linux/arm64 darwin/amd64 darwin/arm64; do
echo "→ $t"
GOOS=${t%/*} GOARCH=${t#*/} go build -o /dev/null ./cmd/devstack
done
- name: govulncheck
run: |
go install golang.org/x/vuln/cmd/govulncheck@latest
govulncheck ./...
# --- expensive, real-daemon (Docker on ubuntu-latest) ---
- name: docker available
run: docker version
- name: integration tests (-tags=integration -race)
env:
CGO_ENABLED: "1"
run: go test -tags=integration -race ./...
- name: e2e tests (-tags=e2e, real up/down via the CLI)
env:
DEVSTACK_E2E: "1" # ephemeral runner: safe to mutate the shared stack
run: go test -tags=e2e ./tests/e2e/...
# The full release pipeline (4 CGO-free targets + archives + checksums +
# .deb/.rpm) — expensive and independent, so it runs in parallel and never
# gates the fast feedback above. Needs full history for goreleaser's versioning.
release-dryrun:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
check-latest: true
cache: true
- uses: goreleaser/goreleaser-action@v6
with:
version: "~> v2"
# --skip=sign: the dry-run validates build/archive/package config only.
# Signing is keyless cosign over GitHub OIDC (release.yml) and cannot run
# in a PR dry-run (no cosign binary, no id-token) — the real release signs.
args: release --snapshot --clean --skip=sign
# Native macOS arm64 lane (G2): proves the darwin/arm64 RUNTIME target — not just
# the cross-compile on the Linux lane — actually builds and passes its daemon-free
# tests. Hosted macOS runners have no Docker, so the integration/e2e (daemon)
# steps stay on the ubuntu `ci` lane; this lane runs build + unit(-race) + a
# binary preflight. Invoked via `go` directly (not make: hosted macOS ships BSD
# make, and the Makefile uses GNU features).
macos:
runs-on: macos-14
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
check-latest: true
cache: true
- name: build (CGO disabled — static binary invariant)
run: CGO_ENABLED=0 go build ./...
- name: unit tests -race
env:
CGO_ENABLED: "1" # the race detector requires cgo
run: go test -race ./...
- name: binary preflight (runs natively on arm64)
run: |
go build -o devstack ./cmd/devstack
./devstack version
./devstack --help >/dev/null
# Placeholder lanes wired as their milestones land:
# - config-conformance: golden workspace exercising every schema field