| 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.70.0, 1.61.0] |
| 28 | timeout-minutes: 45 |
| 29 | steps: |
| 30 | - uses: actions/checkout@v5 |
| 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 check |
| 38 | - run: cargo test |
| 39 | if: matrix.rust != '1.61.0' |
| 40 | - uses: actions/upload-artifact@v4 |
| 41 | if: matrix.rust == 'nightly' && always() |
| 42 | with: |
| 43 | name: Cargo.lock |
| 44 | path: Cargo.lock |
| 45 | continue-on-error: true |
| 46 | |
| 47 | minimal: |
| 48 | name: Minimal versions |
| 49 | needs: pre_ci |
| 50 | if: needs.pre_ci.outputs.continue |
| 51 | runs-on: ubuntu-latest |
| 52 | timeout-minutes: 45 |
| 53 | steps: |
| 54 | - uses: actions/checkout@v5 |
| 55 | - uses: dtolnay/rust-toolchain@nightly |
| 56 | - run: cargo generate-lockfile -Z minimal-versions |
| 57 | - run: cargo check --locked |
| 58 | |
| 59 | doc: |
| 60 | name: Documentation |
| 61 | needs: pre_ci |
| 62 | if: needs.pre_ci.outputs.continue |
| 63 | runs-on: ubuntu-latest |
| 64 | timeout-minutes: 45 |
| 65 | env: |
| 66 | RUSTDOCFLAGS: -Dwarnings |
| 67 | steps: |
| 68 | - uses: actions/checkout@v5 |
| 69 | - uses: dtolnay/rust-toolchain@nightly |
| 70 | - uses: dtolnay/install@cargo-docs-rs |
| 71 | - run: cargo docs-rs |
| 72 | |
| 73 | clippy: |
| 74 | name: Clippy |
| 75 | runs-on: ubuntu-latest |
| 76 | if: github.event_name != 'pull_request' |
| 77 | timeout-minutes: 45 |
| 78 | steps: |
| 79 | - uses: actions/checkout@v5 |
| 80 | - uses: dtolnay/rust-toolchain@clippy |
| 81 | - run: cargo clippy --tests -- -Dclippy::all -Dclippy::pedantic |
| 82 | |
| 83 | miri: |
| 84 | name: Miri |
| 85 | needs: pre_ci |
| 86 | if: needs.pre_ci.outputs.continue |
| 87 | runs-on: ubuntu-latest |
| 88 | timeout-minutes: 45 |
| 89 | steps: |
| 90 | - uses: actions/checkout@v5 |
| 91 | - uses: dtolnay/rust-toolchain@miri |
| 92 | - run: cargo miri setup |
| 93 | - run: cargo miri test |
| 94 | env: |
| 95 | MIRIFLAGS: -Zmiri-strict-provenance |
| 96 | |
| 97 | outdated: |
| 98 | name: Outdated |
| 99 | runs-on: ubuntu-latest |
| 100 | if: github.event_name != 'pull_request' |
| 101 | timeout-minutes: 45 |
| 102 | steps: |
| 103 | - uses: actions/checkout@v5 |
| 104 | - uses: dtolnay/rust-toolchain@stable |
| 105 | - uses: dtolnay/install@cargo-outdated |
| 106 | - run: cargo outdated --workspace --exit-code 1 |