The check job took 72 minutes on one runner for 0ef1ef2c2 (56 of them
tests, one binary at a time: the viewer's read_only.rs 901 s, its unit
tests 759 s, hostile_args.rs 294 s), so a red test was more than an hour
away and a morning of pushes queued behind each other.
`just check` is now a list of parts (lint, gui-unit, gui-tests, cli,
rest), each one `just check-shard <part>`. A laptop runs them in order;
CI runs each on its own runner. One definition serves both, so what CI
checks is what `just check` checks. Nothing can fall out of it:
- `rest` is the workspace less the crates another part names, so a new
crate is tested without being added to a list;
- the viewer's two parts are every target `cargo test -p ledger-gui`
runs (library, executable, each tests/ file, doc tests);
- the lint part fails unless check.yml's list of parts is the justfile's.
The parity floor's comparison runs once, in the lint part.
Co-Authored-By: Claude <noreply@anthropic.com>
81 lines
3.6 KiB
YAML
81 lines
3.6 KiB
YAML
# Every change: format, clippy and rustdoc with zero warnings, every test.
|
|
# Tools come from mise.toml, the same as on a laptop.
|
|
#
|
|
# `just check` is cut into parts (the justfile's check_shards), one runner
|
|
# each, side by side: on one runner the job took 72 minutes on 2026-11-09,
|
|
# and a red test was an hour away. The list below must be the justfile's
|
|
# (the lint part checks that), so no part can be left out here unseen.
|
|
name: check
|
|
on:
|
|
push:
|
|
pull_request:
|
|
# On a pull request a newer push makes an older check pointless: it is
|
|
# cancelled, so only the newest reports. On main a running check finishes:
|
|
# the job takes about fifty minutes, and on 2026-11-09 a morning of pushes
|
|
# cancelled every run, so nothing on main was checked for hours. A newer
|
|
# push waits its turn (GitHub keeps only the newest waiting run), so the
|
|
# tip is always checked next and no half-run check is thrown away.
|
|
concurrency:
|
|
group: check-${{ github.ref }}
|
|
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
|
|
jobs:
|
|
check:
|
|
name: check (${{ matrix.shard }})
|
|
runs-on: ubuntu-24.04
|
|
timeout-minutes: 75
|
|
strategy:
|
|
# One red part does not stop the others: the run lists every failure.
|
|
fail-fast: false
|
|
matrix:
|
|
shard: [lint, gui-unit, gui-tests, cli, rest]
|
|
# 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: matrix.shard == 'lint' && 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
|
|
if: matrix.shard == 'lint'
|
|
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-shard ${{ matrix.shard }}
|
|
- name: What the build used
|
|
if: always()
|
|
run: df -h / | tail -1
|