| 1 | name: CI |
| 2 | |
| 3 | on: |
| 4 | push: |
| 5 | pull_request: |
| 6 | workflow_dispatch: |
| 7 | schedule: [cron: "40 1 * * *"] |
| 8 | |
| 9 | permissions: |
| 10 | contents: read |
| 11 | |
| 12 | env: |
| 13 | RUSTFLAGS: -Dwarnings |
| 14 | |
| 15 | jobs: |
| 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 | - run: cargo test |
| 38 | |
| 39 | msrv: |
| 40 | name: Rust 1.31.0 |
| 41 | needs: pre_ci |
| 42 | if: needs.pre_ci.outputs.continue |
| 43 | runs-on: ubuntu-latest |
| 44 | timeout-minutes: 45 |
| 45 | steps: |
| 46 | - uses: actions/checkout@v4 |
| 47 | - uses: dtolnay/[email protected] |
| 48 | - run: cargo check |
| 49 | |
| 50 | doc: |
| 51 | name: Documentation |
| 52 | needs: pre_ci |
| 53 | if: needs.pre_ci.outputs.continue |
| 54 | runs-on: ubuntu-latest |
| 55 | timeout-minutes: 45 |
| 56 | env: |
| 57 | RUSTDOCFLAGS: -Dwarnings |
| 58 | steps: |
| 59 | - uses: actions/checkout@v4 |
| 60 | - uses: dtolnay/rust-toolchain@nightly |
| 61 | - uses: dtolnay/install@cargo-docs-rs |
| 62 | - run: cargo docs-rs |
| 63 | |
| 64 | clippy: |
| 65 | name: Clippy |
| 66 | runs-on: ubuntu-latest |
| 67 | if: github.event_name != 'pull_request' |
| 68 | timeout-minutes: 45 |
| 69 | steps: |
| 70 | - uses: actions/checkout@v4 |
| 71 | - uses: dtolnay/rust-toolchain@clippy |
| 72 | - run: cargo clippy --tests -- -Dclippy::all -Dclippy::pedantic |
| 73 | |
| 74 | miri: |
| 75 | name: Miri |
| 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@v4 |
| 82 | - uses: dtolnay/rust-toolchain@miri |
| 83 | - run: cargo miri setup |
| 84 | - run: cargo miri test |
| 85 | env: |
| 86 | MIRIFLAGS: -Zmiri-strict-provenance |
| 87 | |
| 88 | outdated: |
| 89 | name: Outdated |
| 90 | runs-on: ubuntu-latest |
| 91 | if: github.event_name != 'pull_request' |
| 92 | timeout-minutes: 45 |
| 93 | steps: |
| 94 | - uses: actions/checkout@v4 |
| 95 | - uses: dtolnay/rust-toolchain@stable |
| 96 | - uses: dtolnay/install@cargo-outdated |
| 97 | - run: cargo outdated --workspace --exit-code 1 |