-
Notifications
You must be signed in to change notification settings - Fork 5
83 lines (71 loc) · 2.13 KB
/
basic.yml
File metadata and controls
83 lines (71 loc) · 2.13 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
on:
push:
branches:
- main
pull_request:
schedule:
# Run monthly to keep Rust toolchain changes fresh
- cron: '0 0 1 * *'
name: "Build, Test, Format, and Lint"
env:
CARGO_TERM_COLOR: always
RUSTFLAGS: "--deny warnings"
jobs:
multiple_toolchains:
name: Multiple toolchain tasks
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- stable
- beta
steps:
- uses: actions/checkout@v4
- name: Install ${{ matrix.rust }} toolchain
run: |
rustup toolchain install ${{ matrix.rust }} --profile minimal --component clippy,rustfmt
rustup default ${{ matrix.rust }}
- name: Cache
uses: Swatinem/rust-cache@v2
# Uses `--all-targets` here to make sure that things like benchmarks
# still compile
- name: Check formatting
run: |
cargo fmt --all -- --check
- name: Build all targets
run: |
cargo build --all-targets --all-features
- name: Run the test suite
run: |
cargo test --all-features
cargo bench -- --test
- name: Check clippy lints
run: |
cargo clippy
- name: Check docs
env:
RUSTDOCFLAGS: -D warnings
run: cargo doc
fuzz:
name:
runs-on: ubuntu-latest
strategy:
matrix:
fuzzer:
- '--fuzz-dir=keyvalues-parser/fuzz parse'
- '--fuzz-dir=keyvalues-serde/fuzz serde'
steps:
- uses: actions/checkout@v4
# Pin to a specific nightly version since we only want it for being able
# to use unstable features, not because we _need_ the newest version.
# This makes caching actually viable for more than just a day
- name: Install nightly toolchain
run: |
rustup toolchain install --profile minimal nightly-2025-01-01
rustup default nightly-2025-01-01
- name: Cache
uses: Swatinem/rust-cache@v2
- name: Run fuzzer
run: |
cargo --locked install cargo-fuzz
cargo --locked fuzz run --jobs=4 ${{ matrix.fuzzer }} -- -max_total_time=120 -timeout=30