Repository navigation
116 lines (106 loc) · 3.68 KB
/
Copy pathci.yml
File metadata and controls
116 lines (106 loc) · 3.68 KB
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
name: CI
on:
push:
branches: [main]
pull_request:
# Cancel superseded runs on the same ref to keep the queue short.
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
jobs:
# Style gate: rustfmt defaults, no local overrides.
fmt:
name: rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- run: cargo fmt --check
# Clippy is a gate, not advice. It sat advisory long enough to accumulate
# thirty findings, two of which were the MSRV lint telling us the declared
# minimum was false. Lints that are genuinely not worth acting on are
# allowed by name at their site, with a reason, so this stays meaningful.
clippy:
name: clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- uses: Swatinem/rust-cache@v2
- run: cargo clippy --all-targets -- -D warnings
# Build on the version the manifests advertise. Without this the declared
# MSRV is a claim nobody checks, and it drifted by eight minor versions.
msrv:
name: MSRV
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Read rust-version from Cargo.toml
id: msrv
run: |
version="$(sed -n 's/^rust-version = "\(.*\)"/\1/p' Cargo.toml | head -1)"
test -n "$version"
echo "version=$version" >> "$GITHUB_OUTPUT"
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ steps.msrv.outputs.version }}
- uses: Swatinem/rust-cache@v2
# Check, not test: the dev-dependencies are free to want a newer
# toolchain than the published crate does.
- run: cargo check --all-features
# Primary supported platform: full build + test suite.
linux:
name: Linux (build + test)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: cargo build
run: cargo build --all-targets
- name: cargo test
run: cargo test --no-fail-fast
# macOS is the primary development platform, but CI coverage matters for
# contributors and because APFS is case-insensitive by default — closer to
# Windows than Linux for path-identity behavior.
macos:
name: macOS (build + test)
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: cargo build
run: cargo build --all-targets
- name: cargo test
run: cargo test --no-fail-fast
# Gate release packagers: archive, checksum, and metadata tests require
# only stdlib Python, without rebuilding Rust.
packaging:
name: packaging (Homebrew and Linux)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Packaging tests
run: python3 -m unittest discover -s scripts -p '*_test.py' -v
# Windows support status lives in docs/windows.md. The fixtures are
# cross-platform: fake forge CLIs are sh scripts launched through .cmd shims
# (Git for Windows provides sh on the runners), and the GitHub API transport
# is exercised against a local HTTP stub.
windows:
name: Windows (build + test)
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: cargo build
run: cargo build --all-targets
- name: cargo test
run: cargo test --no-fail-fast