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@v3 31 - uses: dtolnay/rust-toolchain@master 32 with: 33 toolchain: ${{matrix.rust}} 34 - name: Enable deny(non_exhaustive_omitted_patterns) 35 run: echo RUSTFLAGS=$(RUSTFLAGS)\ --cfg=exhaustive >> $GITHUB_ENV 36 if: matrix.rust == 'nightly' 37 - name: Enable type layout randomization 38 run: echo RUSTFLAGS=${RUSTFLAGS}\ -Zrandomize-layout >> $GITHUB_ENV 39 if: matrix.rust == 'nightly' 40 - run: cargo test 41 42 xplat: 43 name: ${{matrix.name}} 44 needs: pre_ci 45 if: needs.pre_ci.outputs.continue 46 runs-on: ${{matrix.os}}-latest 47 strategy: 48 fail-fast: false 49 matrix: 50 include: 51 - name: macOS 52 os: macos 53 - name: Windows 54 os: windows 55 timeout-minutes: 45 56 steps: 57 - uses: actions/checkout@v3 58 - uses: dtolnay/rust-toolchain@nightly 59 - name: Enable type layout randomization 60 run: echo RUSTFLAGS=${RUSTFLAGS}\ -Zrandomize-layout >> $GITHUB_ENV 61 - run: cargo test 62 63 msrv: 64 name: Rust 1.56.0 65 needs: pre_ci 66 if: needs.pre_ci.outputs.continue 67 runs-on: ubuntu-latest 68 timeout-minutes: 45 69 steps: 70 - uses: actions/checkout@v3 71 - uses: dtolnay/rust-toolchain@1.56.0 72 - run: cargo build 73 74 minimal: 75 name: Minimal versions 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@v3 82 - uses: dtolnay/rust-toolchain@nightly 83 - run: cargo generate-lockfile -Z minimal-versions 84 - run: cargo check --locked 85 86 clippy: 87 name: Clippy 88 runs-on: ubuntu-latest 89 if: github.event_name != 'pull_request' 90 timeout-minutes: 45 91 steps: 92 - uses: actions/checkout@v3 93 - uses: dtolnay/rust-toolchain@clippy 94 - run: cargo clippy --tests -- -Dclippy::all -Dclippy::pedantic 95 96 outdated: 97 name: Outdated 98 runs-on: ubuntu-latest 99 if: github.event_name != 'pull_request' 100 timeout-minutes: 45 101 steps: 102 - uses: actions/checkout@v3 103 - uses: dtolnay/install@cargo-outdated 104 - run: cargo outdated --exit-code 1 105