diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 96d98ba..7d6aa1c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,7 +26,21 @@ jobs: # The file list is printed so under-coverage shows up in the log, and # the comm below turns under-coverage into a failure rather than a # thing someone has to notice: every tracked `.sh` must be in the set. + # + # Install shellcheck when missing (#144). rig's default Forgejo label + # maps ubuntu-latest to catthehacker's act-22.04 (slim), which does not + # ship shellcheck; GitHub-hosted ubuntu-latest does. The conditional + # keeps each forge from paying for the other. + # + # sudo: load-bearing on GitHub (job runs as `runner` with passwordless + # sudo) and a no-op on act-22.04 (jobs run as uid 0; the image has no + # `runner` account). Do not delete it as "dead weight" — that breaks + # the GitHub half the day that image stops preinstalling shellcheck. run: | + if ! command -v shellcheck >/dev/null 2>&1; then + sudo apt-get update + sudo apt-get install -y shellcheck + fi shopt -s globstar dotglob files=(bin/* **/*.sh) printf 'shellcheck: %s\n' "${files[@]}" diff --git a/changelog.d/144.md b/changelog.d/144.md new file mode 100644 index 0000000..6912bdc --- /dev/null +++ b/changelog.d/144.md @@ -0,0 +1,8 @@ +### Added + +- Default Forgejo runner labels include opt-in `ubuntu-latest-full` for the GitHub-parity image (#144) + +### Fixed + +- `ci.yml` installs `shellcheck` when the runner image lacks it, so Forgejo's slim `ubuntu-latest` can run `check` (#144) +- Plain `rig forgejo-runner install` warns when recorded labels are a retired rig default, without nagging custom `--labels` (#144) diff --git a/commands/forgejo-runner-install.sh b/commands/forgejo-runner-install.sh index 902bff6..d80d44a 100755 --- a/commands/forgejo-runner-install.sh +++ b/commands/forgejo-runner-install.sh @@ -31,7 +31,32 @@ die() { printf 'rig-forgejo-runner: ERROR: %s\n' "$1" >&2; exit "${2:-1}"; } # on the box itself. No docker-in-docker: the guide this came from stacks a # privileged dind sidecar with a plaintext tcp://…:2375 daemon to isolate jobs # from a shared CI server, and inside a box that boundary is already paid for. -DEFAULT_LABELS='ubuntu-latest:docker://ghcr.io/catthehacker/ubuntu:act-22.04,docker:docker://node:22-bookworm' +# +# WHY act-22.04 (slim) for ubuntu-latest, not full-22.04 — measured 2026-08-01 +# against ghcr manifests (#144): +# act-22.04: ~0.55 GB compressed / ~2.2 GB on disk — no shellcheck +# full-22.04: ~18.67 GB compressed / ~54.5 GB on disk — has shellcheck 0.8.0 +# A normal box-class ci tenant cannot hold 54.5 GB (typical free space ~34 GB). +# So ubuntu-latest stays slim, and workflows must not assume GitHub-image tools +# (rig's own ci.yml installs shellcheck when missing). Operators who need the +# full tool surface opt in with runs-on: ubuntu-latest-full — that label is +# inert until matched, so boxes that never ask pay nothing. +DEFAULT_LABELS='ubuntu-latest:docker://ghcr.io/catthehacker/ubuntu:act-22.04,ubuntu-latest-full:docker://ghcr.io/catthehacker/ubuntu:full-22.04,docker:docker://node:22-bookworm' + +# labels_are_a_retired_default +# +# True when is a past DEFAULT_LABELS value rig has shipped — the +# only plain-converge case that should warn about re-registration (#144). +# Custom operator maps (drill's Leg 3, any --labels) must return false so a +# bare re-run stays quiet. One pattern per past default; add when the string +# changes. Extracted and driven by test/cli.sh — a grep pin alone cannot prove +# the match is exact. +labels_are_a_retired_default() { + case "${1:-}" in + 'ubuntu-latest:docker://ghcr.io/catthehacker/ubuntu:act-22.04,docker:docker://node:22-bookworm') return 0 ;; + *) return 1 ;; + esac +} # fetch_and_verify_sha256