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.56.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 - name: Enable nightly-only tests 38 run: echo RUSTFLAGS=${RUSTFLAGS}\ --cfg=async_trait_nightly_testing >> $GITHUB_ENV 39 if: matrix.rust == 'nightly' 40 - run: cargo test 41 42 minimal: 43 name: Minimal versions 44 needs: pre_ci 45 if: needs.pre_ci.outputs.continue 46 runs-on: ubuntu-latest 47 timeout-minutes: 45 48 steps: 49 - uses: actions/checkout@v4 50 - uses: dtolnay/rust-toolchain@nightly 51 - run: cargo generate-lockfile -Z minimal-versions 52 - run: cargo check --locked 53 54 doc: 55 name: Documentation 56 needs: pre_ci 57 if: needs.pre_ci.outputs.continue 58 runs-on: ubuntu-latest 59 timeout-minutes: 45 60 env: 61 RUSTDOCFLAGS: -Dwarnings 62 steps: 63 - uses: actions/checkout@v4 64 - uses: dtolnay/rust-toolchain@nightly 65 - uses: dtolnay/install@cargo-docs-rs 66 - run: cargo docs-rs 67 68 clippy: 69 name: Clippy 70 runs-on: ubuntu-latest 71 if: github.event_name != 'pull_request' 72 timeout-minutes: 45 73 steps: 74 - uses: actions/checkout@v4 75 - uses: dtolnay/rust-toolchain@clippy 76 - run: cargo clippy --tests -- -Dclippy::all -Dclippy::pedantic 77 78 miri: 79 name: Miri 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@miri 87 - run: cargo miri setup 88 - run: cargo miri test 89 env: 90 MIRIFLAGS: -Zmiri-strict-provenance 91 92 outdated: 93 name: Outdated 94 runs-on: ubuntu-latest 95 if: github.event_name != 'pull_request' 96 timeout-minutes: 45 97 steps: 98 - uses: actions/checkout@v4 99 - uses: dtolnay/install@cargo-outdated 100 - run: cargo outdated --workspace --exit-code 1 101