-
Notifications
You must be signed in to change notification settings - Fork 0
89 lines (79 loc) · 2.15 KB
/
Copy pathrust.yml
File metadata and controls
89 lines (79 loc) · 2.15 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
name: Rust
on:
push:
branches: [ "**" ]
pull_request:
branches: [ "main" ]
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
components: rustfmt, clippy
- name: Fmt Check
run: cargo fmt --check
- name: Clippy Check
run: cargo clippy --all
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
- name: Run doc tests
run: cargo test --doc
benchmark:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
- name: Run benchmarks
run: cargo bench --verbose
fuzzer:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: nightly
- name: Install cargo-fuzz
run: cargo install cargo-fuzz
- name: Run fuzzer
run: |
cd fuzz
if [ "${{ github.ref }}" == "refs/heads/main" ]; then
FUZZ_TIME=300
else
FUZZ_TIME=60
fi
echo "Running fuzzer for ${FUZZ_TIME} seconds"
for target in $(cargo fuzz list); do
echo "Running fuzzer: $target"
cargo fuzz run $target -- -max_total_time=${FUZZ_TIME} || true
done
security:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
- name: Install cargo-deny
run: cargo-deny --version || cargo install cargo-deny --locked
- name: Run cargo deny check
run: cargo deny check
- 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"