Skip to content

Tooling: CI on GitHub Actions via cargo xtask ci #6

Closed

Description

@samitbasu

Set up CI on GitHub Actions as a thin wrapper around cargo xtask ci (#4).

Current state

M0 (#2) adds an interim .github/workflows/ci.yml that calls cargo directly (fmt, clippy, test, doctests, doc). This issue replaces those steps with the xtask command, so CI and local runs share a single definition.

Workflow

  • Triggers: pull requests, and pushes to main. M0's interim workflow also runs on every branch push, which doubles the runs on a PR. Cancel superseded runs on the same branch (concurrency).
  • Job ci (ubuntu-latest):
    • checkout
    • dtolnay/rust-toolchain@stable with rustfmt and clippy
    • Swatinem/rust-cache@v2 (caches the xtask build too)
    • cargo xtask ci
    • No other logic in YAML. Anything more than installing tools and invoking xtask belongs in xtask.
  • MSRV job: cargo +1.96 check --all-targets, matching rust-version in Cargo.toml.
  • Coverage job: cargo xtask coverage --lcov, uploaded as a workflow artifact. Publishing to an external service (Codecov or similar) is a separate decision, because the repo is private.
  • Snapshots (Tooling: cargo xtask snapshots for reference screenshots #5): install Mesa lavapipe on the runner and run cargo xtask snapshots. If the goldens prove stable there, fold the check into cargo xtask ci; if not, document why it stays local-only.

Branch protection on main (decided)

  • Agents work through a separate bot account with write access but not admin. They push branches and open PRs as the bot.
  • Rules on main:
    • changes only through a PR; no direct pushes, force pushes or deletion
    • the CI check must pass, and the branch must be up to date with main
    • 1 approving review from the code owner (CODEOWNERS: * @samitbasu), with stale approvals dismissed when new commits are pushed
    • the rules apply to admins too
  • Ordering: protection is turned on after the bot exists and after M0: scaffold and spikes #2 (authored as the owner, so it can't be approved by the owner) is merged. CODEOWNERS lands in its own PR.
  • When this issue renames the CI job, update the required status check name to match.

Done when

  • A PR shows the ci check running cargo xtask ci, and it passes.
  • A deliberately broken PR (a clippy warning, a failing test) fails CI with the failing step named.
  • The workflow YAML contains no build logic beyond tool setup and cargo xtask … calls.

Part of #1 (project tooling). Depends on #3 and #4. Snapshot handling is coordinated with #5.

Activity

  1. samitbasu commented on Nov 14, 2026

    @samitbasu
    OwnerAuthor

    Done: CI runs cargo xtask ci (with the goldens on lavapipe), plus msrv and coverage jobs (#7, #136, #151). Branch protection requires ci, coverage and msrv. The code-owner review was dropped along with the bot-account plan.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions