-
Notifications
You must be signed in to change notification settings - Fork 0
106 lines (95 loc) · 4.25 KB
/
Copy pathbuild-cli.yaml
File metadata and controls
106 lines (95 loc) · 4.25 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
# Build cascade CLI
# Called by orchestrate workflow - no direct triggers
# Distribution: Use `go install github.com/stablekernel/cascade/cmd/cascade@latest`
name: Build CLI
on:
workflow_call:
inputs:
sha:
description: 'SHA to build'
type: string
required: false
outputs:
result:
description: 'Build result (success/failure)'
value: ${{ jobs.e2e-tests.result }}
permissions:
contents: read
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: '1.23'
cache: true
- name: Build binary
run: go build -o cascade ./cmd/cascade
- name: Verify CLI works
run: |
./cascade version
./cascade --help
./cascade parse-config --help
./cascade detect-changes --help
./cascade generate-changelog --help
./cascade generate-workflow --help
e2e-tests:
name: E2E Tests
runs-on: ubuntu-latest
needs: [build]
# The act + gitea scenarios run serially (-parallel 1, see the test step),
# which trades wall-clock for reliability, so the job needs more than the
# default headroom. 70m covers the 60m go test budget plus checkout, Go
# install, and container teardown.
timeout-minutes: 70
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
# This job runs the e2e module (go 1.24); install the Go it declares
# so `go test` doesn't hard-fail under GOTOOLCHAIN=local with
# "go.mod requires go >= 1.24.0". The root build job above stays on
# the root go.mod's 1.23.
go-version-file: e2e/go.mod
cache: true
cache-dependency-path: e2e/go.sum
- name: Widen Docker network address pool
# Each scenario creates its own docker network, and the daemon's
# default address pool is small. Even with synchronous per-scenario
# network teardown, brief cleanup lag under serial load can leave the
# pool short and fail a later scenario at setup with "all predefined
# address pools have been fully subnetted". Carving /24 subnets out of
# a 10.99.0.0/16 base yields 256 networks of headroom, well above the
# handful in flight at once, so cleanup lag can never exhaust the pool.
run: |
sudo mkdir -p /etc/docker
echo '{"default-address-pools":[{"base":"10.99.0.0/16","size":24}]}' | sudo tee /etc/docker/daemon.json
sudo systemctl restart docker
# Wait for the daemon to come back before the tests start.
timeout 60 sh -c 'until docker info >/dev/null 2>&1; do sleep 1; done'
- name: Run E2E tests
working-directory: e2e
# Run scenarios serially (-parallel 1). The 4-core / ~7.9GB runner is
# OOM-killed at 4 (silent FAIL, see #104), and even at 2 the concurrent
# act + gitea container load throttles gitea (405 "try again later") and
# destabilises act runs, producing intermittent failures unrelated to
# the product. Serial execution removes that contention; the longer
# 60m timeout covers the resulting slower wall-clock.
run: go test -v -parallel 1 -timeout 60m ./...
# On a retry-exhausted scenario the harness writes the last attempt's raw
# act stdout/stderr to e2e/_artifacts/<scenario>-attempt<N>.log so the
# stack-trace origin survives the CI log retention window. Upload it on
# every run (always()) so the evidence is recoverable whether the job
# failed or a flake was absorbed. The directory may not exist when no
# scenario exhausted its retries; if-no-files-found: ignore keeps that a
# clean no-op rather than a warning.
- name: Upload e2e crash evidence
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: e2e-crash-evidence
path: e2e/_artifacts/
if-no-files-found: ignore
retention-days: 14