-
-
Notifications
You must be signed in to change notification settings - Fork 10
130 lines (112 loc) · 3.53 KB
/
Copy pathrust.yml
File metadata and controls
130 lines (112 loc) · 3.53 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
name: Rust
on:
push:
branches: [ "**" ] # Run on all branches
pull_request:
branches: [ "main" ]
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: 1.94.0
components: rustfmt, clippy
- name: Fmt Check
run: cargo fmt --check
- name: Clippy Check
run: cargo clippy --all --all-features -- -D warnings
- name: Build
run: cargo build --verbose
- name: Build examples
run: cargo build --examples --all-features
- name: Run tests
run: cargo test --all-features --verbose
- name: Test with no default features
run: cargo test --no-default-features --verbose
- name: Check README sync
run: chmod +x scripts/check-readme-sync.sh && ./scripts/check-readme-sync.sh
msrv:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Setup Rust MSRV
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: 1.88.0
- name: Check MSRV
run: cargo check --all-features
netflow_common:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: 1.94.0
- name: Build with netflow_common feature
run: cargo build --features netflow_common --verbose
- name: Test with netflow_common feature
run: cargo test --features netflow_common --verbose
- name: Run netflow_common benchmarks
run: cargo bench --bench netflow_common_bench --features netflow_common --verbose
benchmark:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main' || github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v7
- name: Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: 1.94.0
- name: Run benchmarks
run: cargo bench --verbose
fuzzer:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: nightly # cargo-fuzz requires nightly
- name: Install cargo-fuzz
run: cargo install cargo-fuzz
- name: Run fuzzer
run: |
cd fuzz
# Run for 5 minutes on main branch, 60 seconds otherwise
if [ "${{ github.ref }}" == "refs/heads/main" ]; then
FUZZ_TIME=300
else
FUZZ_TIME=60
fi
echo "Running fuzzer for ${FUZZ_TIME} seconds"
# Run each fuzz target
for target in $(cargo fuzz list); do
echo "Running fuzzer: $target"
cargo fuzz run $target -- -max_total_time=${FUZZ_TIME}
done
security:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: 1.94.0
# Primary: cargo-deny (reliable and comprehensive)
- name: Install cargo-deny
run: cargo-deny --version || cargo install cargo-deny --locked
- name: Run cargo deny check
run: cargo deny check
# Optional: cargo-audit (can have database issues)
- name: Install cargo-audit
continue-on-error: true
run: cargo-audit --version || cargo install cargo-audit --locked
- name: Run cargo-audit
continue-on-error: true
run: cargo audit || echo "::warning::cargo-audit skipped due to database error"