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@v3 31 - uses: dtolnay/rust-toolchain@master 32 with: 33 toolchain: ${{matrix.rust}} 34 components: rust-src 35 - name: Enable type layout randomization 36 run: echo RUSTFLAGS=${RUSTFLAGS}\ -Zrandomize-layout >> $GITHUB_ENV 37 if: matrix.rust == 'nightly' 38 - name: Enable nightly-only tests 39 run: echo RUSTFLAGS=${RUSTFLAGS}\ --cfg=thiserror_nightly_testing >> $GITHUB_ENV 40 if: matrix.rust == 'nightly' 41 - run: cargo test --all 42 43 clippy: 44 name: Clippy 45 runs-on: ubuntu-latest 46 if: github.event_name != 'pull_request' 47 timeout-minutes: 45 48 steps: 49 - uses: actions/checkout@v3 50 - uses: dtolnay/rust-toolchain@nightly 51 with: 52 components: clippy, rust-src 53 - run: cargo clippy --tests -- -Dclippy::all -Dclippy::pedantic 54 55 miri: 56 name: Miri 57 needs: pre_ci 58 if: needs.pre_ci.outputs.continue 59 runs-on: ubuntu-latest 60 timeout-minutes: 45 61 steps: 62 - uses: actions/checkout@v3 63 - uses: dtolnay/rust-toolchain@miri 64 - run: cargo miri test 65 env: 66 MIRIFLAGS: -Zmiri-strict-provenance 67 68 outdated: 69 name: Outdated 70 runs-on: ubuntu-latest 71 if: github.event_name != 'pull_request' 72 timeout-minutes: 45 73 steps: 74 - uses: actions/checkout@v3 75 - uses: dtolnay/install@cargo-outdated 76 - run: cargo outdated --workspace --exit-code 1 77