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