Files
zeekayandHanzo Dev 999a5bcd75 ci: a runner label names the platform, not the org
hanzo-build-linux-amd64, lux-build-linux-amd64, zoo-build-linux-amd64 and
every other org-prefixed spelling all meant the same machine. Which org a
job belongs to does not change which host can build it, so the org bought
one pool name per org per arch and each could go stale on its own -- the
evo host alone answered to fourteen names for one label.

One vocabulary now: linux-amd64, linux-arm64, macos-arm64, win-amd64. The
generic labels every plain workflow uses (ubuntu-latest, self-hosted) are
untouched, so naive CI keeps working.

Co-authored-by: Hanzo Dev <[email protected]>
2026-09-08 12:08:05 -07:00

118 lines
4.0 KiB
YAML

name: CI
# The Go suite, the lint, the C library, the Rust FFI wrapper and the
# cross-compile, on the native runners (git.hanzo.ai → git-runner).
#
# This replaces .github/workflows/ci.yml, .github/workflows/sdk-verification.yml
# and .github/workflows/fresh-clone-ci.yml. Every job in all three named
# `runs-on: lux-build-amd64`. No runner on this forge carries that label — the
# pools are `lux-build-linux-<arch>` — and a job naming a label nothing carries
# does not fail, it waits. This repo was leaking roughly twenty such jobs per
# push.
#
# Three of those files were also largely the same work. sdk-verification.yml's
# go-sdk, c-sdk and rust-sdk jobs are ci.yml's test, test-c and test-rust; only
# the duplication is dropped, not the coverage.
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
permissions:
contents: read
# A newer commit makes the older run irrelevant.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
runs-on: [linux-amd64]
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-go-for-project
- run: go mod download
# -timeout=40m, not 15m. protocol/quasar is 11601 tests over SLH-DSA
# (FIPS 205 at ParamsM192s) and the race detector multiplies it ~22x:
# measured on one host, -count=1, with the fixture caching already in
# no -race 50.5s -> -race 1105.1s, ALL PASS, 85.5% coverage
# It was never a hang. 900s simply sat below the work, so the package
# was killed mid-run and reported FAIL at exactly 900.0xs.
#
# Cutting the work was tried first and is already shipped (5305e785,
# 0ba1f553 cache the two SLH-DSA fixtures: ~117s -> 50.5s un-raced).
# Skipping the crypto under -race was tried and rejected: it bought
# nothing measurable, because the detector taxes all 11601 tests and
# not just the fixtures — and this package has real concurrency
# (TestGroupedEpochManager_ParallelKeygen) that -race must keep seeing.
- name: Test
run: go test -v -race -timeout=40m -coverprofile=coverage.txt -covermode=atomic ./...
lint:
runs-on: [linux-amd64]
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-go-for-project
- name: Install golangci-lint v2
run: go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest
- run: golangci-lint run --timeout=10m
test-c:
name: C library
runs-on: [linux-amd64]
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y build-essential
- name: Build
working-directory: pkg/c
run: make all
- name: Test
working-directory: pkg/c
run: make test
test-rust:
name: Rust FFI wrapper
runs-on: [linux-amd64]
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Build the C library (Rust wraps it)
working-directory: pkg/c
run: make all
- name: Build and test
working-directory: pkg/rust
run: |
cargo build --release
LD_LIBRARY_PATH=../c/lib:$LD_LIBRARY_PATH cargo test --release
build:
# Cross-compilation, all from the one Linux runner: the matrix sets GOOS and
# GOARCH, it does not select a runner.
runs-on: [linux-amd64]
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
os: [linux, darwin, windows]
arch: [amd64, arm64]
exclude:
- os: windows
arch: arm64
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-go-for-project
- name: Build ${{ matrix.os }}/${{ matrix.arch }}
env:
GOOS: ${{ matrix.os }}
GOARCH: ${{ matrix.arch }}
run: go build -v -o consensus-${{ matrix.os }}-${{ matrix.arch }} ./cmd/consensus