# Suite, Go. Dispatched by hand, on development. Never a push gate. # # The complete gate set minus race: the build, both static gates, the full # suite with every short-layer skip unskipped, and the coverage floor. It is # the pipeline form of the local gate, for the moments when the tree must be # proven end to end and nobody is at the keyboard. # # Race never runs in CI. It roughly doubles time and memory on a box shared # with the forge, and the local `just gates` races the tree on the machine at # the keyboard, which is where that gate belongs. name: Suite on: workflow_dispatch: env: # One core: parallelism buys no speed here and costs memory the box does not have. GOFLAGS: -p=1 GOMAXPROCS: "2" jobs: suite: runs-on: fedora steps: - uses: actions/checkout@v7 - uses: actions/setup-go@v6 with: # The module is the source of truth for the version, so it cannot drift. go-version-file: go.mod cache: true - name: Build # The examples are main programs; the build is what compiles them. run: go build ./... - name: Format run: | perl -e ' open(my $g, q{-|}, q{gofmt}, q{-l}, q{.}) or die qq{gofmt: $!}; my @bad = <$g>; close($g); print @bad; exit(@bad ? 1 : 0); ' - name: Vet run: go vet ./... - name: Modernise # Exits non-zero when it has something to rewrite, so it needs no output capture. run: go fix -diff ./... - name: Tests # The full suite, every skip layer lifted, with the coverage profile. # No timeout: a run that does not finish is a defect to find. run: go test -count=1 -timeout 0 -coverprofile=coverage.out ./... - name: Coverage floor run: | perl -e ' open(my $c, q{-|}, q{go}, q{tool}, q{cover}, q{-func=coverage.out}) or die qq{cover: $!}; my $total; while (my $l = <$c>) { $total = $1 if $l =~ m{^total:\s+\S+\s+([0-9.]+)%} } close($c); die qq{no total line in coverage.out\n} unless defined $total; printf qq{Total coverage: %s%%\n}, $total; exit($total < 80 ? 1 : 0); '