ci: fence the test recipes and rebuild the pipelines around the gate set
Test / test (push) Failing after 24s
Test / test (push) Failing after 24s
Assisted-by: DeepSeek V4.1 Flash
This commit is contained in:
@@ -1,36 +0,0 @@
|
||||
# Fuzz smoke, Go. Dispatched by hand when a change asks for it.
|
||||
#
|
||||
# Fuzzing is exploration, so it never belongs to the push pipeline; a 30 second
|
||||
# smoke per target on a hand dispatch checks a change without holding the
|
||||
# shared box. The targets run the seeds and whatever the corpus has gathered; a
|
||||
# failure leaves its crashing input in testdata/fuzz, which the ordinary suite
|
||||
# then reproduces on every push.
|
||||
#
|
||||
# Every step is one command, so the step that fails is the gate that failed.
|
||||
name: Fuzz
|
||||
|
||||
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:
|
||||
fuzz:
|
||||
runs-on: fedora
|
||||
timeout-minutes: 10
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
|
||||
- uses: actions/setup-go@v6
|
||||
with:
|
||||
go-version-file: go.mod
|
||||
cache: true
|
||||
|
||||
- name: Fuzz the parser
|
||||
run: go test -run '^$' -fuzz FuzzParse -fuzztime=30s -timeout 10m .
|
||||
|
||||
- name: Fuzz the encoder
|
||||
run: go test -run '^$' -fuzz FuzzMarshal -fuzztime=30s -timeout 10m .
|
||||
@@ -1,37 +0,0 @@
|
||||
# Race, Go. Dispatched by hand.
|
||||
#
|
||||
# The race detector roughly doubles both time and memory, which the shared runner box
|
||||
# cannot afford on every push. Locally it belongs to `just gates`, which runs it once
|
||||
# per task; here it is an explicit decision rather than a routine, a hand dispatch
|
||||
# when a change asks for one. Development carries its race gate on every push through
|
||||
# that local gate.
|
||||
#
|
||||
# Every step is one command, so the step that fails is the gate that failed.
|
||||
name: Race
|
||||
|
||||
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:
|
||||
race:
|
||||
runs-on: fedora
|
||||
timeout-minutes: 45
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
|
||||
- uses: actions/setup-go@v6
|
||||
with:
|
||||
go-version-file: go.mod
|
||||
cache: true
|
||||
|
||||
- name: Install gcc
|
||||
# The race detector needs cgo and the runner image carries no C compiler.
|
||||
run: dnf install -y gcc
|
||||
|
||||
- name: Race
|
||||
run: go test -race -count=1 -timeout 10m ./...
|
||||
@@ -1,49 +1,33 @@
|
||||
# Release, Go library. Runs on version tags (v1.2.3) pushed to main.
|
||||
# Release, Go library. Runs on a version tag (v1.2.3) pushed to main.
|
||||
#
|
||||
# A library ships no binaries, so there is no build matrix and no smoke test: the release
|
||||
# carries the CHANGELOG section as its body and nothing else. The gates still run first,
|
||||
# in their own job and once, minus the race detector: race never runs on a push path or a
|
||||
# tag, and the local gate raced this tree before the tag was cut. The write permission
|
||||
# sits on the release job alone, and the version the binary reports is the one the
|
||||
# toolchain records from the tag, with nothing injected.
|
||||
# The pipeline does one thing: it publishes the release from the tag, notes and
|
||||
# all. No gate runs here. The tagged tree was tested on every push to
|
||||
# development, the deep suite is the suite workflow's business, and race never
|
||||
# runs in CI at all. A library ships no assets, so there is no build and
|
||||
# nothing to upload.
|
||||
#
|
||||
# Every step is one command, so the step that fails is the gate that failed, and no shell
|
||||
# option has to be trusted for the run to stop. The scripted steps are Perl, not shell and
|
||||
# not Python: Perl behaves the same on both runner images, there is no bashism to trip over
|
||||
# on ash, and it is one language instead of two. The Perl uses builtins only, because
|
||||
# Fedora packages the Perl modules separately and nothing beyond `perl` itself may be
|
||||
# assumed present, which is why the release body is escaped by hand and curl is the
|
||||
# transport.
|
||||
# Every step is one command, and the scripted steps are Perl with builtins
|
||||
# only. Perl drives curl through a list, so no argument is ever word-split,
|
||||
# globbed or quoted wrong.
|
||||
name: Release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags: ["v*"]
|
||||
|
||||
env:
|
||||
# The box is shared with the forge, so parallelism is bounded on purpose. The gates job
|
||||
# needs it most, since it runs the suite.
|
||||
GOFLAGS: -p=1
|
||||
GOMAXPROCS: "2"
|
||||
|
||||
jobs:
|
||||
gates:
|
||||
release:
|
||||
runs-on: fedora
|
||||
timeout-minutes: 10
|
||||
permissions:
|
||||
# contents: read is required for the checkout: a job that declares any
|
||||
# permissions gets a token scoped to exactly those, and releases: write
|
||||
# alone leaves the fetch with no read access, which Gitea answers with
|
||||
# a 404 "Repository not found". Verified on the instance 2026-09-16.
|
||||
contents: read
|
||||
releases: write
|
||||
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: Install Perl
|
||||
# Perl for the steps below. The install is a no-op where the package
|
||||
# is already present.
|
||||
run: dnf install -y perl
|
||||
|
||||
- name: Validate the tag
|
||||
env:
|
||||
VERSION: ${{ gitea.ref_name }}
|
||||
@@ -55,68 +39,12 @@ jobs:
|
||||
print qq{tag $v\n};
|
||||
'
|
||||
|
||||
- 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: Build
|
||||
run: go build ./...
|
||||
|
||||
- name: Tests
|
||||
# Keep the pattern equal to `packages` in the project's justfile.
|
||||
run: go test -count=1 -timeout 10m -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);
|
||||
'
|
||||
|
||||
release:
|
||||
runs-on: fedora
|
||||
timeout-minutes: 15
|
||||
needs: gates
|
||||
permissions:
|
||||
# contents: read is required for the checkout: a job that declares any
|
||||
# permissions gets a token scoped to exactly those, and releases: write
|
||||
# alone leaves the fetch with no read access, which Gitea answers with
|
||||
# a 404 "Repository not found". Verified on the instance 2026-09-16.
|
||||
contents: read
|
||||
releases: write
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
|
||||
- name: Install Perl
|
||||
# The runner images are minimal and Perl is not guaranteed. The install is a
|
||||
# no-op where it is already present; drop this step once verified on the box.
|
||||
run: dnf install -y perl
|
||||
|
||||
- name: Extract the CHANGELOG section
|
||||
env:
|
||||
VERSION: ${{ gitea.ref_name }}
|
||||
run: |
|
||||
# Each step derives what it needs from the tag, so no value has to travel between
|
||||
# jobs. The separator after the version is never read, so the heading format's
|
||||
# separator stays free.
|
||||
# Each step derives what it needs from the tag, so no value has to travel
|
||||
# between steps.
|
||||
perl -e '
|
||||
my $v = $ENV{VERSION} // q{};
|
||||
$v =~ s{^v}{};
|
||||
@@ -150,8 +78,8 @@ jobs:
|
||||
open(my $in, q{<:raw}, q{release-body.md}) or die qq{release-body.md: $!};
|
||||
my $body = do { local $/; <$in> };
|
||||
close($in);
|
||||
# Byte-oriented escaping: JSON is UTF-8, so non-ASCII passes through and only the
|
||||
# characters JSON forbids are rewritten.
|
||||
# Byte-oriented escaping: JSON is UTF-8, so non-ASCII passes through and
|
||||
# only the characters JSON forbids are rewritten.
|
||||
$body =~ s/([\\"])/\\$1/g;
|
||||
$body =~ s/\t/\\t/g;
|
||||
$body =~ s/\r//g;
|
||||
@@ -188,5 +116,5 @@ jobs:
|
||||
close($r);
|
||||
$code eq q{201} or die qq{ERROR: the release was not created, HTTP $code: $body\n};
|
||||
$body =~ m{"id"\s*:\s*([0-9]+)} or die qq{ERROR: no release id in the response: $body\n};
|
||||
print qq{release id $1\n};
|
||||
print qq{release v$ENV{VERSION} is live (id $1)\n};
|
||||
'
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
# 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);
|
||||
'
|
||||
+23
-54
@@ -1,23 +1,19 @@
|
||||
# Test, Go. Push and pull request to development. Never on main.
|
||||
#
|
||||
# The gates are the ones the justfile's `gates` recipe runs, minus race: the shared
|
||||
# runner box cannot afford the race detector on every push. Race has its own
|
||||
# pipeline, dispatched by hand, and the local `just gates` runs it once per
|
||||
# task. The box is one core and 2 GB beside Gitea, so
|
||||
# parallelism is bounded on purpose and everything runs in one job. Extra jobs would
|
||||
# duplicate the checkout, the Go setup and the dependency download three times without
|
||||
# buying any parallelism.
|
||||
# The push path owns a two-minute budget end to end, so it carries exactly the
|
||||
# gates that fit it: the format check, `go vet`, the suite's short layer and the
|
||||
# coverage floor. There is no build step (`go test` compiles what it runs) and
|
||||
# no install step: the fedora job image carries git, perl and node (verified on
|
||||
# the runner, 2026-10-04), and no pipeline ever installs gcc or runs the race
|
||||
# detector. The modernisation gate (`go fix -diff`) and the full suite live in
|
||||
# the suite workflow.
|
||||
#
|
||||
# Every step is one command, so the step that fails is the gate that failed, and no shell
|
||||
# option has to be trusted for the run to stop. The scripted steps are Perl, not shell and
|
||||
# not Python: Perl behaves the same on both runner images, there is no bashism to trip over
|
||||
# on ash, and it is one language instead of two. The Perl uses builtins only, because
|
||||
# Fedora packages the Perl modules separately and nothing beyond `perl` itself may be
|
||||
# assumed present.
|
||||
# A test too slow for the push budget marks itself with `testing.Short` and the
|
||||
# suite workflow runs it; the push path runs what fits its budget.
|
||||
#
|
||||
# After the gates runs the toml-test compliance suite, which is this library's conformance
|
||||
# record rather than a gate. It is fixed cases, not exploration, and it fits the box, so it
|
||||
# is none of the three burdens the push pipeline refuses: no fuzz, no race, no heavy sweep.
|
||||
# Every step is one command, so the step that fails is the gate that failed,
|
||||
# and no shell option has to be trusted for the run to stop. The scripted
|
||||
# steps are Perl with builtins only.
|
||||
name: Test
|
||||
|
||||
on:
|
||||
@@ -31,10 +27,10 @@ env:
|
||||
GOFLAGS: -p=1
|
||||
GOMAXPROCS: "2"
|
||||
|
||||
# A superseded run of the same ref is cancelled instead of queueing behind one
|
||||
# that no longer matters. Verified on this Gitea on 2026-09-17: a queued run
|
||||
# whose ref moved on is cancelled before it ever reaches the runner, while a
|
||||
# run already dispatched there runs to completion.
|
||||
# A superseded run of the same ref is cancelled instead of queueing behind one that
|
||||
# no longer matters. Verified on Gitea 1.27.1 on 2026-09-17: a queued run whose ref
|
||||
# moved on is cancelled before it ever reaches the runner, while a run already
|
||||
# dispatched there runs to completion.
|
||||
concurrency:
|
||||
group: ${{ gitea.workflow }}-${{ gitea.ref }}
|
||||
cancel-in-progress: true
|
||||
@@ -42,7 +38,6 @@ concurrency:
|
||||
jobs:
|
||||
test:
|
||||
runs-on: fedora
|
||||
timeout-minutes: 10
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
|
||||
@@ -52,11 +47,6 @@ jobs:
|
||||
go-version-file: go.mod
|
||||
cache: true
|
||||
|
||||
- name: Install Perl
|
||||
# The runner images are minimal and Perl is not guaranteed. The install is a
|
||||
# no-op where it is already present; drop this step once verified on the box.
|
||||
run: dnf install -y perl
|
||||
|
||||
- name: Format
|
||||
run: |
|
||||
perl -e '
|
||||
@@ -70,17 +60,14 @@ jobs:
|
||||
- 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: Build
|
||||
run: go build ./...
|
||||
|
||||
- name: Tests
|
||||
# Scope the pattern to the packages that hold the logic when a thin cmd/ drags the
|
||||
# total under the floor, and keep it equal to `packages` in the project's justfile.
|
||||
run: go test -count=1 -timeout 10m -coverprofile=coverage.out ./...
|
||||
# Equal to `packages` in the project's justfile, so the floor is the same
|
||||
# number the local gate reports. The short layer is what runs; the
|
||||
# persistent build cache on the runner makes a warm run seconds, not
|
||||
# minutes. No timeout anywhere: `-timeout 0` disables go test's own
|
||||
# ten-minute default, because a run that does not finish is a defect to
|
||||
# find and a timeout only hides it.
|
||||
run: go test -short -count=1 -timeout 0 -coverprofile=coverage.out ./...
|
||||
|
||||
- name: Coverage floor
|
||||
run: |
|
||||
@@ -93,21 +80,3 @@ jobs:
|
||||
printf qq{Total coverage: %s%%\n}, $total;
|
||||
exit($total < 80 ? 1 : 0);
|
||||
'
|
||||
|
||||
- name: Install toml-test
|
||||
# A dev and CI tool only; it is not a module dependency of interpres. GOBIN pins
|
||||
# the destination, so the later step invokes the tool by path and no command
|
||||
# output has to be captured into a variable.
|
||||
env:
|
||||
GOBIN: ${{ gitea.workspace }}/bin
|
||||
run: go install github.com/toml-lang/toml-test/v2/cmd/toml-test@v2.2.0
|
||||
|
||||
- name: Build the decoder
|
||||
run: go build -o bin/interpres-decode ./cmd/interpres-decode
|
||||
|
||||
- name: Compliance suite
|
||||
# interpres implements TOML 1.1, and the suite runs both directions: the decoder
|
||||
# on the valid and invalid corpora, the encoder on the tagged JSON of the valid
|
||||
# one. The mode is pinned so an upstream default change cannot silently move the
|
||||
# corpus.
|
||||
run: bin/toml-test test -decoder=bin/interpres-decode -encoder='bin/interpres-decode -encode' -toml=1.1
|
||||
|
||||
Reference in New Issue
Block a user