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
name: rust
on:
push:
branches:
pull_request:
env:
CARGO_TERM_COLOR: always
permissions:
contents: read
jobs:
# homelab-1 has one repository-scoped runner, so separate Linux jobs would only
# serialize while repeating checkout, cache and toolchain setup. Keep the
# complete Linux gate in one allocation; macOS remains independent below.
linux:
name: validate (homelab-1)
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository
runs-on:
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: dtolnay/rust-toolchain@4360b52568e2003a75bf9bc1d59f33a8e3fc893c # stable
with:
toolchain: stable
components: rustfmt, clippy
- uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2
with:
# Its default save cleanup deletes every Cargo binary present when
# the action starts. These runners own pinned publisher tools.
cache-bin: false
- name: Format
run: cargo fmt --all --check
# Lint levels come from [lints] in Cargo.toml, not from flags here.
- name: Clippy
run: cargo clippy --all-targets --all-features
- name: Test
run: cargo test --all-targets --all-features
# If this breaks, the MSRV in Cargo.toml is wrong - do not paper over it
# by bumping the toolchain here. It has moved once already: `ignore`
# 0.4.30 raised the real floor to 1.88 while open-agent-sdk still asks
# for 1.85, and declares no `rust-version`, so the first sign was a
# compile error in a dependency.
- uses: dtolnay/rust-toolchain@4360b52568e2003a75bf9bc1d59f33a8e3fc893c # stable
with:
toolchain: 1.88.0
# No --all-targets: MSRV is a property of [dependencies]. Whether the dev
# dependencies build on 1.88 has no consumer.
- name: MSRV
run: cargo +1.88.0 check
test-macos:
name: test (Mac mini)
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository
runs-on:
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: dtolnay/rust-toolchain@4360b52568e2003a75bf9bc1d59f33a8e3fc893c # stable
with:
toolchain: stable
components: clippy
- uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2
with:
cache-bin: false
- run: cargo test --all-targets --all-features