sim: RS mesh partition/heal (TestNodeReconnection intent) (#24) #55
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Parity with https://github.com/ethp2p/ethp2p/blob/main/.github/workflows/ci.yml (job names and intent). | |
| # - 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.15.0 | |
| jobs: | |
| 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 | |
| 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 |