`cargo test --workspace` reports the same tally whether the disc corpus was
exercised or entirely absent. Measured: the disc suites RAN on a developer
desktop (1936 s, mesh_consistency_disc alone 1220 s) and SKIPPED on CI
(2.4 s total) -- and both reported 207 passed / 0 failed / 14 ignored across
30 suites.
Two mechanisms compound:
* a skip is a PASSING test. The gated suites `eprintln!("SKIP: ...")` and
return early from a test that still passes, so a skipped suite and a
fully exercised one both score 1 passed. The totals are invariant.
* the message is invisible. `cargo test` captures a passing test's output,
so NEITHER log contains a `SKIP:` line. The absence of one proves
nothing, which makes the obvious check useless too.
And `14 ignored` cannot help: `#[ignore]` is static, so that column is the
literal count of attributes in the source and cannot move at runtime. Ask
what this check would still report if the corpus were entirely absent, and
the answer is 207/0/14.
This is #16's remedy (2) -- the only one that touches the REPORT, which is
the defect. Remedies (1) and (3) improve the control and are left open.
Adds `tests/corpus_report.rs`: always runs, never fails, resolves all three
corpora exactly as the per-suite helpers do, and records what was available.
It writes to a FILE rather than relying on stdout, because a passing test's
stdout is captured and would be invisible in exactly the CI log that needs
it; the workflow then prints that file. It also appends to
GITHUB_STEP_SUMMARY when set.
Run here, it immediately shows the thing the issue is about -- all three
corpora resolve through the HARDCODED fallback, so SYLPHEED_DISC is not
controlling anything on this machine:
SYLPHEED_DISC PRESENT via the HARDCODED fallback, NOT $SYLPHEED_DISC
SYLPHEED_RES3D PRESENT via the HARDCODED fallback, NOT $SYLPHEED_RES3D
SYLPHEED_ISO PRESENT via the HARDCODED fallback, NOT $SYLPHEED_ISO
The ABSENT branch is the one CI takes and cannot be reached on a machine
that has the corpora, so `resolve_renders_every_branch` exercises it
directly rather than shipping it unrun -- along with "set but does not
resolve", which is what a typo in the env var produces and which is
deliberately reported as a DIFFERENT state from absent, since the two want
different fixes.
Verified: `cargo fmt --all -- --check` clean. Clippy is unchanged by this
(a test target; CI's `cargo clippy --workspace` does not build test cfg) --
it fails identically on unmodified main here with
`only_used_in_recursion` at vfs.rs:85, which is the rustc 1.90.0 vs the
runner's 1.98.1 divergence, i.e. #15, not this.
Refs #16
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
168 lines
7.3 KiB
YAML
168 lines
7.3 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [ main, develop ]
|
|
pull_request:
|
|
branches: [ main ]
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
RUST_BACKTRACE: 1
|
|
|
|
# ── What this file may assume about where it runs ────────────────────────────
|
|
#
|
|
# It runs on ONE self-hosted runner: `rpi5-runner`, aarch64, advertising
|
|
# ["ubuntu-latest", "ubuntu-24.04", "ubuntu-22.04"]. Nothing else exists.
|
|
#
|
|
# This file was written for GitHub's hosted fleet — three operating systems and
|
|
# x86_64 throughout — and had never once gone green here: 23 runs cancelled, 2
|
|
# waiting, zero successes. Two separate reasons, and both are configuration
|
|
# describing a world that is not this one:
|
|
#
|
|
# * `windows-latest` / `macos-latest` match no runner label, so those jobs sit
|
|
# in WAITING for ever. The run therefore never reaches a terminal state, and
|
|
# a pull request's checks never resolve either way — not red, just never
|
|
# finished. That is worse than a failure: a red check tells you something.
|
|
# * `--target x86_64-unknown-linux-gnu` on an aarch64 host makes every build a
|
|
# cross-compile, and `wayland-sys`'s build script dies on it —
|
|
# "pkg-config has not been configured to support cross-compilation".
|
|
#
|
|
# So: one job, on the machine that exists, building for the machine that exists.
|
|
# If a second architecture is ever wanted here it needs a second RUNNER, not a
|
|
# second matrix row.
|
|
|
|
jobs:
|
|
# ── Native build, on the one runner there is ────────────────────────────────
|
|
native:
|
|
name: Native — linux
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Install Rust toolchain
|
|
# `stable` installs a MINIMAL profile: rustc, cargo, rust-std and no
|
|
# more. Components have to be named. Without this line the Clippy step
|
|
# below dies on "'cargo-clippy' is not installed for the toolchain
|
|
# 'stable-aarch64-unknown-linux-gnu'" — which is not a lint result, it
|
|
# is the step never having run. The `fmt` job below always got this
|
|
# right; this one never did.
|
|
uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
components: clippy
|
|
|
|
- name: Cache Cargo registry and build
|
|
uses: Swatinem/rust-cache@v2
|
|
|
|
# Linux: install Bevy's system dependencies (X11, Wayland, audio)
|
|
- name: Install Linux system dependencies
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y \
|
|
libasound2-dev \
|
|
libudev-dev \
|
|
libwayland-dev \
|
|
libxkbcommon-dev \
|
|
libx11-dev \
|
|
libxi-dev \
|
|
pkg-config
|
|
|
|
- name: Check (fast compile check)
|
|
run: cargo check --workspace
|
|
|
|
- name: Build (debug)
|
|
run: cargo build --workspace
|
|
|
|
- name: Run tests
|
|
run: cargo test --workspace
|
|
|
|
# The tally above cannot tell you what it verified. `cargo test` reports
|
|
# the same 207/0/14 whether the disc corpus was exercised or entirely
|
|
# absent -- a gated suite that skips still counts as passed, and the
|
|
# `ignored` column is a static count of `#[ignore]` attributes that cannot
|
|
# move at runtime. Issue #16. This prints what the run ACTUALLY had, from
|
|
# a file, because a passing test's stdout is captured and would be
|
|
# invisible in exactly this log.
|
|
- name: Report which corpora the tests actually had
|
|
if: always()
|
|
run: cat target/sylpheed-corpus-report.txt || echo "(no corpus report produced -- did corpus_report run?)"
|
|
|
|
# This step has never once executed on this codebase: the toolchain above
|
|
# shipped without the component, so every run died on "not installed"
|
|
# before clippy saw a line of source. Its result was never pass or fail,
|
|
# only unmeasured. With the component installed it becomes a real check,
|
|
# and the first honest thing it will report is that the workspace is not
|
|
# clean — the build already emits ~13 plain rustc warnings (unused
|
|
# imports, unused variables, needless `mut`, dead fields) that
|
|
# `-D warnings` promotes to errors, before clippy's own lints are counted.
|
|
#
|
|
# Left gating on purpose. A red check that measures something is worth
|
|
# more than a green one that measures nothing, and the alternative —
|
|
# `continue-on-error`, or dropping `-D warnings` — cannot tell "debt not
|
|
# yet paid" from "debt paid", which is the shape PROTOCOL.md forbids.
|
|
# The debt is scoped in #13, as the rustfmt debt is in #12.
|
|
- name: Clippy
|
|
run: cargo clippy --workspace -- -D warnings
|
|
|
|
# ── WASM / Web build ─────────────────────────────────────────────────────────
|
|
wasm:
|
|
name: WASM — Web
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Install Rust toolchain + WASM target
|
|
uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
targets: wasm32-unknown-unknown
|
|
|
|
- name: Cache Cargo
|
|
uses: Swatinem/rust-cache@v2
|
|
|
|
- name: Install Trunk
|
|
# v0.5.0 selects the download by PLATFORM ONLY and never consults the
|
|
# architecture -- `case 'linux': arch = 'x86_64-unknown-linux-gnu'` --
|
|
# so on this aarch64 runner it fetches an x86_64 binary. v0.5.1 adds
|
|
# `process.arch` with 'x64' -> 'x86_64', 'arm64' -> 'aarch64' and
|
|
# core.setFailed otherwise, so a wrong arch now fails loudly instead of
|
|
# silently. It also moves the download host thedodd/trunk ->
|
|
# trunk-rs/trunk (trunk moved repositories; v0.5.0 still points at the
|
|
# old one), and swaps io.mv for io.cp, which is what avoids EXDEV on a
|
|
# self-hosted runner whose /tmp is a separate filesystem -- ours.
|
|
uses: jetli/trunk-action@v0.5.1
|
|
|
|
- name: Check WASM compile
|
|
run: >
|
|
cargo check
|
|
--target wasm32-unknown-unknown
|
|
-p sylpheed-viewer
|
|
-p sylpheed-formats
|
|
|
|
- name: Build WASM release with Trunk
|
|
run: trunk build --release
|
|
|
|
# No artifact upload. actions/upload-artifact@v4 hard-refuses on Gitea --
|
|
# Gitea presents as GHES and @actions/artifact v2+ aborts there
|
|
# (go-gitea/gitea#31256, #36024). Nothing consumes `web-dist`: it had
|
|
# exactly one reference in this repository, the line that produced it,
|
|
# and there is no download-artifact and no second workflow. The job's
|
|
# purpose -- proving the web build compiles -- is met by the step above.
|
|
# Add it back when something consumes the bundle, and decide then between
|
|
# actions/upload-artifact@v3 (the GHES guidance names v3.2.2 / the
|
|
# -node20 tag, so check the runner's node first) and the Gitea-specific
|
|
# christopherHX/gitea-upload-artifact@v4, which is a third-party
|
|
# dependency and therefore a decision, not a swap.
|
|
|
|
# ── Format check ─────────────────────────────────────────────────────────────
|
|
fmt:
|
|
name: Formatting
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
components: rustfmt
|
|
- run: cargo fmt --all -- --check
|