# Race, Go. Dispatched by hand and swept nightly on a schedule. # # 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. The nightly # schedule runs on the repository's default branch, so it sweeps the released # line; development carries its race gate on every push through `just gates` # and the hand dispatch when a change asks for one. # # Every step is one command, so the step that fails is the gate that failed. name: Race on: workflow_dispatch: schedule: # Nightly at 03:00 UTC, the quietest hours of the shared box. - cron: "0 3 * * *" 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@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 - uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # 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 30m ./...