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 # 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