1name: CI 2 3on: 4 push: 5 pull_request: 6 workflow_dispatch: 7 schedule: [cron: "40 1 * * *"] 8 9permissions: 10 contents: read 11 12env: 13 RUSTFLAGS: -Dwarnings 14 15jobs: 16 pre_ci: 17 uses: dtolnay/.github/.github/workflows/pre_ci.yml@master 18 19 test: 20 name: Rust ${{matrix.rust}} 21 needs: pre_ci 22 if: needs.pre_ci.outputs.continue 23 runs-on: ubuntu-latest 24 strategy: 25 fail-fast: false 26 matrix: 27 rust: [nightly, beta, stable, 1.36.0] 28 timeout-minutes: 45 29 steps: 30 - uses: actions/checkout@v4 31 - uses: dtolnay/rust-toolchain@master 32 with: 33 toolchain: ${{matrix.rust}} 34 - name: Enable type layout randomization 35 run: echo RUSTFLAGS=${RUSTFLAGS}\ -Zrandomize-layout >> $GITHUB_ENV 36 if: matrix.rust == 'nightly' 37 - run: cargo build 38 - run: cargo test 39 - run: cargo test --release 40 - run: cargo build --no-default-features 41 - run: cargo test --tests --no-default-features 42 - run: cargo test --tests --no-default-features --release 43 - run: cargo build --tests --features no-panic --release 44 if: matrix.rust == 'nightly' 45 - run: cargo bench --no-run 46 if: matrix.rust == 'nightly' 47 48 doc: 49 name: Documentation 50 needs: pre_ci 51 if: needs.pre_ci.outputs.continue 52 runs-on: ubuntu-latest 53 timeout-minutes: 45 54 env: 55 RUSTDOCFLAGS: -Dwarnings 56 steps: 57 - uses: actions/checkout@v4 58 - uses: dtolnay/rust-toolchain@nightly 59 - uses: dtolnay/install@cargo-docs-rs 60 - run: cargo docs-rs 61 62 miri: 63 name: Miri 64 needs: pre_ci 65 if: needs.pre_ci.outputs.continue 66 runs-on: ubuntu-latest 67 timeout-minutes: 45 68 steps: 69 - uses: actions/checkout@v4 70 - uses: dtolnay/rust-toolchain@miri 71 - run: cargo miri setup 72 - run: cargo miri test 73 env: 74 MIRIFLAGS: -Zmiri-strict-provenance 75 76 clippy: 77 name: Clippy 78 runs-on: ubuntu-latest 79 if: github.event_name != 'pull_request' 80 timeout-minutes: 45 81 steps: 82 - uses: actions/checkout@v4 83 - uses: dtolnay/rust-toolchain@clippy 84 - run: cargo clippy --tests --benches -- -Dclippy::all -Dclippy::pedantic 85 86 fuzz: 87 name: Fuzz 88 needs: pre_ci 89 if: needs.pre_ci.outputs.continue 90 runs-on: ubuntu-latest 91 timeout-minutes: 45 92 steps: 93 - uses: actions/checkout@v4 94 - uses: dtolnay/rust-toolchain@nightly 95 - uses: dtolnay/install@cargo-fuzz 96 - run: cargo fuzz check 97 98 outdated: 99 name: Outdated 100 runs-on: ubuntu-latest 101 if: github.event_name != 'pull_request' 102 timeout-minutes: 45 103 steps: 104 - uses: actions/checkout@v4 105 - uses: dtolnay/install@cargo-outdated 106 - run: cargo outdated --workspace --exit-code 1 107 - run: cargo outdated --manifest-path fuzz/Cargo.toml --exit-code 1 108