1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: CI
on:
push:
branches:
pull_request:
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
# Warnings are now errors everywhere. The tree is rustc-clean, clippy-clean and
# rustfmt-clean as of this commit, so the ratchet starts here: the cost of
# keeping it that way is one lint at a time, and the cost of not doing so is
# the 21-lint backlog this just cleared.
#
# Note the trade-off this accepts: `dtolnay/rust-toolchain@stable` floats, so a
# new stable release that adds or widens a lint will fail CI on a commit that
# changed nothing. That is the intended alarm, not a malfunction — fix the lint,
# or pin the toolchain here if the interruptions outweigh the discipline.
RUSTFLAGS: -D warnings
jobs:
# Portability is a product claim, so prove it on every push. There is no
# assembly and no build.rs here, so one build configuration covers all three.
test:
name: test (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Build
run: cargo build --locked --all-targets
- name: Test
run: cargo test --locked
# The library must stay usable without the CLI/TUI stack — this is what the
# `cli` feature gate exists to guarantee, and what the hosted backend consumes.
lib-only:
name: lib-only (no default features)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: cargo check --locked --no-default-features
- run: cargo test --locked --no-default-features
# Catch metadata problems here rather than at `cargo publish` time.
package:
name: package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: cargo package --locked
# Blocking since the formatting and lint backlog inherited from the monorepo
# was cleared. It was advisory until then because reformatting during the
# extraction would have destroyed the verbatim-move property that made the
# port reviewable; that constraint is spent, so the job enforces now.
style:
name: style
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
- name: rustfmt
run: cargo fmt --check
- name: clippy
run: cargo clippy --locked --all-targets