-
Notifications
You must be signed in to change notification settings - Fork 0
138 lines (112 loc) · 4.15 KB
/
Copy pathci.yml
File metadata and controls
138 lines (112 loc) · 4.15 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
# Parity with https://github.com/ethp2p/ethp2p/blob/main/.github/workflows/ci.yml (job names and intent).
# - markdown-lint: rumdl on ethp2p `specs/` at ETHP2P_SPECS_REF (second checkout; no specs/ in this repo).
# - lint: go vet/staticcheck → zig fmt, default build, zig ast-check (syntax only; not staticcheck).
# - unit-tests: go test -race ./broadcast/... → zig build test-broadcast (Debug + TSan ≈ -race).
# - simnet-rs: filtered sim RS + reconnection → zig build test-sim-rs (no Zig reconnection test yet).
# - simnet-gossipsub: filtered Gossipsub → zig build test-sim-gossipsub.
# - large-network-rs: main only, large RS/scalability → zig build test-stress-ci (full root + ZIG_ETHP2P_STRESS + TSan).
#
# Zig toolchain: keep ZIG_VERSION in sync with `minimum_zig_version` in build.zig.zon.
name: CI
on:
push:
branches: [main, feature]
pull_request:
branches: [main, feature]
env:
ZIG_VERSION: 0.16.0
# Normative prose under ethp2p `specs/`; keep in sync with `UPSTREAM.md` "Pinned revision".
ETHP2P_SPECS_REF: 741d8d9cf682ff93b7d8eb56e0377ba8eea83a7e
jobs:
markdown-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
repository: ethp2p/ethp2p
ref: ${{ env.ETHP2P_SPECS_REF }}
path: ethp2p
- name: Lint ethp2p specs (rumdl)
uses: rvben/rumdl@v0
with:
path: ethp2p/specs/
report-type: annotations
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: minimum_zig_version matches CI ZIG_VERSION
run: |
set -euo pipefail
want="${ZIG_VERSION}"
got="$(sed -n 's/^[[:space:]]*\.minimum_zig_version = "\([^"]*\)".*/\1/p' build.zig.zon | head -1)"
if test -z "$got"; then
echo "error: could not parse minimum_zig_version from build.zig.zon" >&2
exit 1
fi
if test "$got" != "$want"; then
echo "error: build.zig.zon minimum_zig_version=${got} but CI ZIG_VERSION=${want}" >&2
exit 1
fi
- uses: mlugg/setup-zig@v2
with:
version: ${{ env.ZIG_VERSION }}
- name: zig fmt --check
run: zig fmt --check .
- name: zig build (default target)
run: zig build
- name: zig ast-check (syntax only)
run: |
set -euo pipefail
zig ast-check build.zig
zig ast-check --zon build.zig.zon
find src -name '*.zig' -print0 | while IFS= read -r -d '' f; do zig ast-check "$f"; done
unit-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: mlugg/setup-zig@v2
with:
version: ${{ env.ZIG_VERSION }}
- name: Run unit tests (broadcast stack parity)
run: zig build test-broadcast --summary all
simnet-rs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: mlugg/setup-zig@v2
with:
version: ${{ env.ZIG_VERSION }}
- name: Run RS simnet tests
run: zig build test-sim-rs --summary all
simnet-gossipsub:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: mlugg/setup-zig@v2
with:
version: ${{ env.ZIG_VERSION }}
- name: Run Gossipsub simnet tests
run: zig build test-sim-gossipsub --summary all
quic-transport:
runs-on: ubuntu-latest
# Default job cap is 6h; without this, a hung `quic.poll` / test subprocess can burn the full budget.
timeout-minutes: 45
steps:
- uses: actions/checkout@v4
- uses: mlugg/setup-zig@v2
with:
version: ${{ env.ZIG_VERSION }}
# `timeout` (coreutils) fails the step with 124 if the build or test binary never finishes.
- name: QUIC transport tests (zquic)
run: timeout 40m zig build test-quic --summary all
large-network-rs:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v4
- uses: mlugg/setup-zig@v2
with:
version: ${{ env.ZIG_VERSION }}
- name: Run large network RS tests (stress + TSan)
run: zig build test-stress-ci --summary all