-
Notifications
You must be signed in to change notification settings - Fork 31
60 lines (55 loc) · 2.14 KB
/
rust.yml
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
name: Rust
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Setup nightly Rust Toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
- uses: actions/checkout@v3
- name: Ensure no_std compiles
run: cargo build --no-default-features
- name: Ensure no_std compiles for safe-decode
run: cargo build --no-default-features --features safe-decode
- name: Ensure no_std compiles for safe-encode
run: cargo build --no-default-features --features safe-encode
- name: Ensure no_std compiles for safe-encode and safe-decode
run: cargo build --no-default-features --features safe-encode --features safe-decode
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test
- name: Run tests with nightly
run: cargo +nightly test --features nightly
- name: Run tests safe-encode
run: cargo test --features safe-encode
- name: Run tests safe-decode
run: cargo test --features safe-decode
- name: Run tests --no-default-features with frame
run: cargo test --no-default-features --features frame
- name: Run tests --no-default-features with frame, with nightly features
run: cargo +nightly test --no-default-features --features frame --features nightly
- name: Run tests unsafe with checked-decode and frame
run: cargo test --no-default-features --features frame
- name: Install cargo fuzz
run: cargo install cargo-fuzz
- name: Run fuzz tests (safe)
run: for fuzz_test in `cargo fuzz list`; do cargo +nightly fuzz run $fuzz_test -- -max_total_time=30 || exit 1; done
- name: Run fuzz tests (unsafe)
run: for fuzz_test in `cargo fuzz list`; do cargo +nightly fuzz run $fuzz_test --no-default-features -- -max_total_time=30 || exit 1; done
semver:
name: semver
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Check semver
uses: obi1kenobi/cargo-semver-checks-action@v2
with:
rust-toolchain: ${{ env.rust_stable }}
release-type: minor