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.63.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 test 38 39 msrv: 40 name: Rust 1.56.0 41 needs: pre_ci 42 if: needs.pre_ci.outputs.continue 43 runs-on: ubuntu-latest 44 timeout-minutes: 45 45 steps: 46 - uses: actions/checkout@v4 47 - uses: dtolnay/rust-toolchain@1.56.0 48 - run: cargo check --lib 49 50 doc: 51 name: Documentation 52 needs: pre_ci 53 if: needs.pre_ci.outputs.continue 54 runs-on: ubuntu-latest 55 timeout-minutes: 45 56 env: 57 RUSTDOCFLAGS: -Dwarnings 58 steps: 59 - uses: actions/checkout@v4 60 - uses: dtolnay/rust-toolchain@nightly 61 - uses: dtolnay/install@cargo-docs-rs 62 - run: cargo docs-rs 63 64 clippy: 65 name: Clippy 66 runs-on: ubuntu-latest 67 if: github.event_name != 'pull_request' 68 timeout-minutes: 45 69 steps: 70 - uses: actions/checkout@v4 71 - uses: dtolnay/rust-toolchain@clippy 72 - run: cargo clippy --tests -- -Dclippy::all -Dclippy::pedantic 73 74 miri: 75 name: Miri 76 needs: pre_ci 77 if: needs.pre_ci.outputs.continue 78 runs-on: ubuntu-latest 79 timeout-minutes: 45 80 steps: 81 - uses: actions/checkout@v4 82 - uses: dtolnay/rust-toolchain@miri 83 - run: cargo miri setup 84 - run: cargo miri test 85 env: 86 MIRIFLAGS: -Zmiri-disable-isolation -Zmiri-strict-provenance 87 88 fuzz: 89 name: Fuzz 90 needs: pre_ci 91 if: needs.pre_ci.outputs.continue 92 runs-on: ubuntu-latest 93 timeout-minutes: 45 94 steps: 95 - uses: actions/checkout@v4 96 - uses: dtolnay/rust-toolchain@nightly 97 - uses: dtolnay/install@cargo-fuzz 98 - run: cargo fuzz check 99 100 outdated: 101 name: Outdated 102 runs-on: ubuntu-latest 103 if: github.event_name != 'pull_request' 104 timeout-minutes: 45 105 steps: 106 - uses: actions/checkout@v4 107 - uses: dtolnay/install@cargo-outdated 108 - run: cargo outdated --workspace --exit-code 1 109 - run: cargo outdated --manifest-path fuzz/Cargo.toml --exit-code 1 110