name: CI
on:
push:
pull_request:
workflow_dispatch:
schedule:
- cron: "40 1 * * *"
permissions:
contents: read
env:
RUSTFLAGS: -Dwarnings
jobs:
pre_ci:
uses: dtolnay/.github/.github/workflows/pre_ci.yml@master
test:
name: Rust ${{ matrix.rust }}
needs: pre_ci
if: needs.pre_ci.outputs.continue
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
rust: [stable, beta, nightly, 1.81.0, 1.76.0]
timeout-minutes: 20
steps:
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
components: rust-src
- name: Enable type layout fuzzing (nightly only)
if: matrix.rust == 'nightly'
run: echo RUSTFLAGS="${RUSTFLAGS} -Zrandomize-layout" >> $GITHUB_ENV
- name: Run default tests (std)
run: cargo test
- name: Test no_std mode
run: cargo test --no-default-features
- name: Test examples
run: cargo test --examples
msrv:
name: MSRV (1.68.0)
needs: pre_ci
if: needs.pre_ci.outputs.continue
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@1.68.0
- run: cargo check
- run: cargo check --no-default-features
doc:
name: Documentation
needs: pre_ci
if: needs.pre_ci.outputs.continue
runs-on: ubuntu-latest
env:
RUSTDOCFLAGS: -Dwarnings
timeout-minutes: 20
steps:
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@nightly
- run: cargo doc --no-deps
clippy:
name: Clippy
runs-on: ubuntu-latest
if: github.event_name != 'pull_request'
timeout-minutes: 20
steps:
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@nightly
with:
components: clippy
- run: cargo clippy --tests --examples -- -Dclippy::all -Dclippy::pedantic
miri:
name: Miri
needs: pre_ci
if: needs.pre_ci.outputs.continue
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@miri
- run: cargo miri setup
- run: cargo miri test