Skip to content

release-docs: the TL;DR still asked for one PLAN.md stamp #263

release-docs: the TL;DR still asked for one PLAN.md stamp

release-docs: the TL;DR still asked for one PLAN.md stamp #263

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
CARGO_INCREMENTAL: 0
# Debug info is the bulk of a Rust target dir (locally: 17 GB of the
# 25 GB `target/debug`) and nothing in CI reads a full DWARF tree.
# `line-tables-only` keeps file/line in panic backtraces — the one
# part we do want when a test fails — at a fraction of the size.
# A smaller target dir means a cache that fits, uploads, and restores.
CARGO_PROFILE_DEV_DEBUG: line-tables-only
CARGO_PROFILE_TEST_DEBUG: line-tables-only
CARGO_NET_RETRY: 10
RUSTUP_MAX_RETRIES: 10
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
fmt:
name: cargo fmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- run: cargo fmt --all -- --check
# File organization and the platform split — CONTRIBUTING states
# both, and until this ran nothing checked either. Cheap: it reads
# the sources, it does not build the workspace.
- run: cargo xtask style
# Lint + build + test in one job per OS. Splitting `check` and `test`
# across two runners bought nothing: the second runner recompiled the
# entire workspace from scratch and kept a second multi-gigabyte cache
# entry alive, which is exactly what the 10 GB repo cache budget
# cannot afford.
check:
name: check (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- uses: Swatinem/rust-cache@v2
with:
# Only `main` writes caches. Every PR branch gets its own cache
# scope, so with saving left on, a couple of open PRs push the
# repo past the 10 GB budget, GitHub evicts least-recently-used
# entries, and every job is back to "Downloading crates …".
# PRs still *restore* from main's cache — reads cross from the
# base branch, writes do not.
save-if: ${{ github.ref == 'refs/heads/main' }}
# Without this, a job that fails lint saves nothing — so a
# broken build also means the next run recompiles every
# dependency from zero, right when the feedback loop matters.
cache-on-failure: true
- name: Install Linux native deps
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y \
pkg-config \
libdbus-1-dev \
libudev-dev \
libxkbcommon-dev \
libxkbcommon-x11-dev \
libwayland-dev \
libx11-dev \
libxi-dev \
libxtst-dev \
libxdo-dev \
libgtk-3-dev \
libayatana-appindicator3-dev \
libasound2-dev
# `clippy --all-targets` type-checks everything `cargo check` would,
# so a separate `cargo check` was pure duplicate work. `--locked`
# makes a stale Cargo.lock a build failure instead of a silent
# re-resolve (which also drops the "Updating crates.io index" hit).
- run: cargo clippy --workspace --all-targets --locked -- -D warnings
- run: cargo test --workspace --locked
# The release installers compile the AI subsystem in
# (`--features ai,poltertype-ai/remote` in release.yml). Lint and
# test that feature set here too, or a change main CI never saw
# can break the next release build.
- run: cargo clippy -p poltertype-ai --features remote --all-targets --locked -- -D warnings
- run: cargo clippy -p poltertype-app --features ai,poltertype-ai/remote --all-targets --locked -- -D warnings
- run: cargo test -p poltertype-ai --features remote --locked