-
Notifications
You must be signed in to change notification settings - Fork 0
148 lines (140 loc) · 5.35 KB
/
Copy pathci.yml
File metadata and controls
148 lines (140 loc) · 5.35 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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
name: CI
on:
push:
branches: [main]
pull_request:
env:
CARGO_TERM_COLOR: always
RUSTFLAGS: -D warnings
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock', '**/Cargo.toml') }}
- name: Build
run: cargo build --all-targets --all-features
- name: Test (debug)
run: cargo test --all-features
- name: Test (release)
run: cargo test --release --all-features
- name: Doctests
run: cargo test --doc --all-features
fmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: cargo fmt --all -- --check
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: cargo clippy --all-targets --all-features -- -D warnings
deny:
name: cargo-deny
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: EmbarkStudios/cargo-deny-action@v2
with:
command: check
# Windows build (PLAN_v3_windows.md §0.3). Until §3 lifts the
# `#[cfg(unix)]` gates on the coordinator / download / extractor
# modules, the public chain that reaches
# `http::response::BodyReader::{empty,streaming}` (and the
# `BodyState::{Empty,Streaming}` variants / `BodyCommand::NextFrame`
# field) is dead on Windows — the items compile, but no pub-from-here
# caller exists yet, so `#[warn(unused)]` fires. AGENTS.md forbids
# `#[allow(dead_code)]` to silence warnings, so the honest workaround
# is to disable the workflow-wide `-D warnings` for the Windows job
# only until §3 promotes this gate. At that point the consumers light
# up, the dead-code goes away, and the env override below is removed.
#
# This job runs `fmt --check` and `cargo build` (default features and
# `--no-default-features`). Clippy is added in §3, `cargo test` in
# §2/§4 per the plan. `system-libs` stays off because the Windows
# runners don't ship pkg-config / vcpkg-installed libzstd.
windows-build:
name: Windows build
runs-on: windows-2022
env:
RUSTFLAGS: ""
steps:
- uses: actions/checkout@v4
- name: Cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock', '**/Cargo.toml') }}
# `decode::bzip2_native::tests` shell out to the `bzip2`
# reference encoder to generate round-trip fixtures (the
# decoder itself is hand-rolled, so the test exercises the
# decoder against a real-world producer). Linux runners ship
# `bzip2` in their base image; Windows ones do not, so install
# it explicitly. Chocolatey is pre-installed on `windows-2022`.
- name: Install bzip2 (test dependency)
run: choco install bzip2 --no-progress --yes
- name: Rustfmt check
run: cargo fmt --all -- --check
# `src/main.rs` is `#![cfg(unix)]` for the heavy lift, with a
# stub Windows `fn main` (per `PLAN_v3_windows.md` §3) that
# prints a "not yet wired" message and exits non-zero. §5
# replaces the stub with a `SetConsoleCtrlHandler`-based
# parity path.
- name: Build lib (no default features)
run: cargo build --lib --no-default-features
- name: Build (default features, bin + lib)
run: cargo build
# Promoted in §3 (gate lift). With `coordinator`,
# `download/*`, `extractor`, `multivolume`, and `cli` ungated
# on Windows, the lint surface matches what Linux/macOS sees.
# `--all-targets` covers the integration tests under
# `tests/`. The job stays on default features because
# `--all-features` enables `system-libs`, which makes
# `zstd-sys` shell out to `pkg-config` (absent on Windows CI
# without custom vcpkg setup — filed as `O.WIN.PKGCFG`
# round-two follow-on).
- name: Clippy
run: cargo clippy --all-targets -- -D warnings
# Promoted in §4 (real NTFS puncher). With the
# `WindowsPuncher` in place every integration test that exercises
# the full extraction pipeline (sparse file → workers → decoder
# → sink → puncher) runs on Windows.
- name: Test (default features)
run: cargo test
# MSRV check. The declared floor lives in `Cargo.toml` (`rust-version`);
# rationale and the audit that picked 1.85 are in
# `internal/PLAN_packaging.md` §0.6. `RUSTUP_TOOLCHAIN` overrides the
# `rust-toolchain.toml` pin so we actually exercise 1.85 here.
msrv:
name: MSRV (1.85)
runs-on: ubuntu-latest
env:
RUSTUP_TOOLCHAIN: 1.85.0
steps:
- uses: actions/checkout@v4
- name: Install rustc 1.85.0
run: rustup toolchain install 1.85.0 --profile minimal --no-self-update
- name: Cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-msrv-${{ hashFiles('**/Cargo.lock', '**/Cargo.toml') }}
- name: Check at MSRV
run: cargo check --all-targets --all-features --locked