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 - 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.31.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.31.0 72 - run: cargo build 73 74 clippy: 75 name: Clippy 76 runs-on: ubuntu-latest 77 if: github.event_name != 'pull_request' 78 timeout-minutes: 45 79 steps: 80 - uses: actions/checkout@v3 81 - uses: dtolnay/rust-toolchain@clippy 82 - run: cargo clippy --tests -- -Dclippy::all -Dclippy::pedantic 83 84 outdated: 85 name: Outdated 86 runs-on: ubuntu-latest 87 if: github.event_name != 'pull_request' 88 timeout-minutes: 45 89 steps: 90 - uses: actions/checkout@v3 91 - uses: dtolnay/install@cargo-outdated 92 - run: cargo outdated --exit-code 1 93