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 nightly: 20 name: Rust nightly 21 needs: pre_ci 22 if: needs.pre_ci.outputs.continue 23 runs-on: ubuntu-latest 24 timeout-minutes: 45 25 steps: 26 - uses: actions/checkout@v4 27 - uses: dtolnay/rust-toolchain@nightly 28 - name: Enable type layout randomization 29 run: echo RUSTFLAGS=${RUSTFLAGS}\ -Zrandomize-layout >> $GITHUB_ENV 30 - run: cargo test 31 32 test: 33 name: Rust ${{matrix.rust}} 34 needs: pre_ci 35 if: needs.pre_ci.outputs.continue 36 runs-on: ubuntu-latest 37 strategy: 38 fail-fast: false 39 matrix: 40 rust: [beta, stable, 1.56.0] 41 timeout-minutes: 45 42 steps: 43 - uses: actions/checkout@v4 44 - uses: dtolnay/rust-toolchain@master 45 with: 46 toolchain: ${{matrix.rust}} 47 - run: cargo test 48 env: 49 RUSTFLAGS: --cfg remain_stable_testing ${{env.RUSTFLAGS}} 50 51 minimal: 52 name: Minimal versions 53 needs: pre_ci 54 if: needs.pre_ci.outputs.continue 55 runs-on: ubuntu-latest 56 timeout-minutes: 45 57 steps: 58 - uses: actions/checkout@v4 59 - uses: dtolnay/rust-toolchain@nightly 60 - run: cargo generate-lockfile -Z minimal-versions 61 - run: cargo check --locked 62 63 doc: 64 name: Documentation 65 needs: pre_ci 66 if: needs.pre_ci.outputs.continue 67 runs-on: ubuntu-latest 68 timeout-minutes: 45 69 env: 70 RUSTDOCFLAGS: -Dwarnings 71 steps: 72 - uses: actions/checkout@v4 73 - uses: dtolnay/rust-toolchain@nightly 74 - uses: dtolnay/install@cargo-docs-rs 75 - run: cargo docs-rs 76 77 clippy: 78 name: Clippy 79 runs-on: ubuntu-latest 80 if: github.event_name != 'pull_request' 81 timeout-minutes: 45 82 steps: 83 - uses: actions/checkout@v4 84 - uses: dtolnay/rust-toolchain@clippy 85 - run: cargo clippy --tests -- -Dclippy::all -Dclippy::pedantic 86 87 miri: 88 name: Miri 89 needs: pre_ci 90 if: needs.pre_ci.outputs.continue 91 runs-on: ubuntu-latest 92 timeout-minutes: 45 93 steps: 94 - uses: actions/checkout@v4 95 - uses: dtolnay/rust-toolchain@miri 96 - run: cargo miri setup 97 - run: cargo miri test 98 env: 99 MIRIFLAGS: -Zmiri-strict-provenance 100 101 outdated: 102 name: Outdated 103 runs-on: ubuntu-latest 104 if: github.event_name != 'pull_request' 105 timeout-minutes: 45 106 steps: 107 - uses: actions/checkout@v4 108 - uses: dtolnay/install@cargo-outdated 109 - run: cargo outdated --workspace --exit-code 1 110