Repository navigation
112 lines (89 loc) · 3.65 KB
/
Copy pathci.yml
File metadata and controls
112 lines (89 loc) · 3.65 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
name: CI
on:
pull_request:
push:
branches: [main]
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref == 'refs/heads/main' && github.run_id || github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
check:
name: Test, lint and document
runs-on: ubuntu-26.04
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Format
run: cargo fmt --all -- --check
- name: Clippy
run: cargo clippy --all-targets --all-features -- -D warnings
- name: Test
run: cargo test --release --all-features
# Requirement D. The suite runs against the crate built without its std
# feature, and the crate is built for a target where std does not exist
# at all, so an accidental dependency on it cannot compile.
- name: Test without std
run: cargo test --release --no-default-features --features body-parse
- name: Build for a target without std
run: |
rustup target add thumbv7em-none-eabihf
cargo build --no-default-features --features body-parse \
--target thumbv7em-none-eabihf
- name: Document
run: cargo doc --no-deps
fuzz-corpus:
name: Fuzz corpus regression
runs-on: ubuntu-26.04
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install nightly
run: rustup toolchain install nightly --profile minimal
- uses: taiki-e/install-action@8cca0918f8471c33515202b73f56ab27f2bed283 # v2
with:
tool: cargo-fuzz
# -runs=0 executes every stored input once and exits. Fuzzing for a fixed
# time instead would let an unrelated new find turn a pull request red.
# The target is pinned because a musl-built cargo-fuzz otherwise defaults
# to musl, whose static libc cannot link the sanitizer.
- name: Replay corpora
run: |
cargo +nightly fuzz run --target x86_64-unknown-linux-gnu \
fuzz_scanner_regions fuzz/corpus/fuzz_scanner_regions/ -- -runs=0
cargo +nightly fuzz run --target x86_64-unknown-linux-gnu \
fuzz_preprocessor_preprocess fuzz/corpus/fuzz_preprocessor_preprocess/ -- -runs=0
cargo +nightly fuzz run --target x86_64-unknown-linux-gnu \
fuzz_parse_body fuzz/corpus/fuzz_parse_body/ -- -runs=0
coverage:
name: Coverage
runs-on: ubuntu-26.04
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install Rust
uses: dtolnay/rust-toolchain@nightly
with:
components: llvm-tools-preview
- uses: taiki-e/install-action@cargo-llvm-cov
- name: Generate coverage
run: cargo llvm-cov --all-features --lcov --output-path lcov.info
- name: Upload coverage to Codecov
uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: lcov.info
fail_ci_if_error: true
msrv:
name: Minimum supported Rust version
runs-on: ubuntu-26.04
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
# Must track `rust-version` in Cargo.toml. A floor nothing builds against
# is a claim, not a guarantee.
- name: Install the declared floor
uses: dtolnay/rust-toolchain@master
with:
toolchain: "1.88"
- name: Test
run: cargo test --all-targets --all-features
- name: Test without std
run: cargo test --all-targets --no-default-features --features body-parse