Files
wanderbooks/.github/workflows/check.yml
T
swaitsandClaude Opus 5.5 9ed94347ae ci: the parity floor compares a push against the branch's tip before it
HEAD^1 is only the new tip's parent: a push of several commits could lower
the floor in an earlier one and pass. github.event.before is what main was
before the push; a new branch (all zeros) falls back to HEAD^1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-06 16:46:56 -07:00

64 lines
2.7 KiB
YAML

# Every change: format, clippy and rustdoc with zero warnings, every test.
# Tools come from mise.toml, the same as on a laptop.
name: check
on:
push:
pull_request:
# A newer push to the same branch makes an older check pointless: it is
# cancelled, so only the newest reports.
concurrency:
group: check-${{ github.ref }}
cancel-in-progress: true
jobs:
check:
runs-on: ubuntu-24.04
# The runner's disk is small (the first run after P6 landed died in
# the linker: "No space left on device", ld killed by SIGBUS). A fresh
# runner gains nothing from incremental caches, and line tables keep
# file:line in a panic's backtrace at a fraction of full debug info.
env:
CARGO_INCREMENTAL: "0"
CARGO_PROFILE_DEV_DEBUG: line-tables-only
CARGO_PROFILE_TEST_DEBUG: line-tables-only
steps:
# The parity floor compares against the commit before this one, so
# the checkout needs one more commit than the default.
- uses: actions/checkout@v4
with:
fetch-depth: 2
- name: The base branch, for the parity floor
if: github.event_name == 'pull_request'
run: |
git fetch --no-tags --depth=1 origin \
"+refs/heads/${{ github.base_ref }}:refs/remotes/origin/${{ github.base_ref }}"
- name: Room for the build (the image ships toolchains we never use)
run: |
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc \
/opt/hostedtoolcache/CodeQL /usr/local/.ghcup
df -h / | tail -1
- uses: jdx/mise-action@v2
- name: GUI build dependencies
run: sudo apt-get update && sudo apt-get install -y libxkbcommon-dev libgtk-3-dev
# docs/parity.md's floor never decreases (AGENTS.md, "Parity
# tracking"); a test checks it inside `just check`, this checks the
# commit's floor against its base.
# A push compares against the branch's tip before the push, not the
# new tip's parent: a push of several commits could otherwise lower
# the floor in an earlier one unseen.
- name: The parity floor holds
env:
BEFORE: ${{ github.event.before }}
run: |
if [ "${{ github.event_name }}" = "pull_request" ]; then
scripts/parity-floor.sh "origin/${{ github.base_ref }}"
elif [ -n "$BEFORE" ] && [ "$BEFORE" != 0000000000000000000000000000000000000000 ] \
&& git fetch --no-tags --depth=1 origin "$BEFORE"; then
scripts/parity-floor.sh "$BEFORE"
else
scripts/parity-floor.sh HEAD^1
fi
- run: just check
- name: What the build used
if: always()
run: df -h / | tail -1