| 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.79.0, 1.61.0, 1.34.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 check |
| 38 | - run: cargo test |
| 39 | if: matrix.rust != '1.61.0' && matrix.rust != '1.34.0' |
| 40 | |
| 41 | doc: |
| 42 | name: Documentation |
| 43 | needs: pre_ci |
| 44 | if: needs.pre_ci.outputs.continue |
| 45 | runs-on: ubuntu-latest |
| 46 | env: |
| 47 | RUSTDOCFLAGS: -Dwarnings |
| 48 | timeout-minutes: 45 |
| 49 | steps: |
| 50 | - uses: actions/checkout@v4 |
| 51 | - uses: dtolnay/rust-toolchain@nightly |
| 52 | - uses: dtolnay/install@cargo-docs-rs |
| 53 | - run: cargo docs-rs |
| 54 | |
| 55 | clippy: |
| 56 | name: Clippy |
| 57 | runs-on: ubuntu-latest |
| 58 | if: github.event_name != 'pull_request' |
| 59 | timeout-minutes: 45 |
| 60 | steps: |
| 61 | - uses: actions/checkout@v4 |
| 62 | - uses: dtolnay/rust-toolchain@clippy |
| 63 | - run: cargo clippy -- -Dclippy::all -Dclippy::pedantic |
| 64 | |
| 65 | miri: |
| 66 | name: Miri |
| 67 | needs: pre_ci |
| 68 | if: needs.pre_ci.outputs.continue |
| 69 | runs-on: ubuntu-latest |
| 70 | timeout-minutes: 45 |
| 71 | steps: |
| 72 | - uses: actions/checkout@v4 |
| 73 | - uses: dtolnay/rust-toolchain@miri |
| 74 | - run: cargo miri setup |
| 75 | - run: cargo miri test |
| 76 | env: |
| 77 | MIRIFLAGS: -Zmiri-strict-provenance |