`Install Trunk` has never run to completion here, because the two steps
before it always failed first. With those cleared it becomes reachable,
and on this runner v0.5.0 would fetch the wrong binary.
v0.5.0 switches on PLATFORM alone and never consults the architecture:
case 'linux': arch = 'x86_64-unknown-linux-gnu'; break;
v0.5.1 reads it and maps it, failing loudly rather than wrongly:
const arch = process.env['ARCH'] || process.arch;
case 'x64': targetArch = 'x86_64'; break;
case 'arm64': targetArch = 'aarch64'; break;
default: core.setFailed(`Unsupported architecture: ${arch}`); return;
Node reports `arm64` here, so it resolves to `aarch64`, and upstream does
publish trunk-aarch64-unknown-linux-gnu.tar.gz. There is also an `ARCH`
env override if the mapping is ever wrong.
Read out of the two bundled dist/index.js files, not the release notes.
Counts moved as predicted: `x86_64-unknown-linux-gnu` 1 -> 0, `aarch64`
0 -> 1, `os.arch()` 5 -> 5. Confirmed independently on both machines.
Two further changes the bump carries, neither of them about architecture:
* the download host moves thedodd/trunk -> trunk-rs/trunk. Trunk moved
repositories and v0.5.0 still points at the old one -- arguably the
more durable half of the fix.
* `io.mv` 1 -> 0 and `io.cp` 2 -> 3. A cross-filesystem move throws
EXDEV; a copy does not. This is the fix for self-hosted runners whose
/tmp is a separate filesystem, which is ours. NOTE: the string EXDEV
appears zero times in either bundle, so this cannot be found by
grepping for the error it prevents -- it is visible only as the
primitive swap.
STILL UNVERIFIED: whether `trunk build --release` then succeeds. Everything
above concerns selecting and fetching the binary. The step after it has
never run in this repository's history, on any architecture, so there is no
basis to predict it. Expect to read that log fresh.
Refs #11
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
151 lines
6.0 KiB
YAML
151 lines
6.0 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
|
|
|
|
# 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
|
|
|
|
- name: Upload WASM dist artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: web-dist
|
|
path: dist/
|
|
|
|
# ── 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
|