Download this file
| 1 | #!/bin/sh |
| 2 | # The race gate, as its own reported step. It is not part of `make ci`, |
| 3 | # which AGENTS.md keeps cgo-free; `-race` refuses to build without cgo, |
| 4 | # so this is the one step that sets CGO_ENABLED=1. It builds a test |
| 5 | # binary and never a release. |
| 6 | # |
| 7 | # The guard: `-race` needs a C compiler, and the cloud runner's |
| 8 | # provisioning (amadan/docs/ci-cloud-runner.md) installs the Go |
| 9 | # toolchain and Node and never names one. A step that failed on every |
| 10 | # push would be worse than no step, so this skips loudly instead. |
| 11 | # When somebody confirms cc on the runner, delete the guard — a race |
| 12 | # gate that can silently skip is half a gate. |
| 13 | set -e |
| 14 | if ! command -v cc >/dev/null 2>&1 && ! command -v gcc >/dev/null 2>&1; then |
| 15 | echo "race: SKIPPED — no C compiler on this runner, and -race requires cgo." |
| 16 | echo "race: install one (apt-get install -y gcc) and delete the guard in .amadan/ci.d/50-race." |
| 17 | exit 0 |
| 18 | fi |
| 19 | exec make race |
| 20 | |