name: CI
on:
pull_request:
types:
- opened
- reopened
- synchronize
- ready_for_review
- labeled
- unlabeled
push:
branches: ["main"]
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
jobs:
basic_checks:
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
profile: ["dev", "release"]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
- name: Check formatting
run: cargo fmt --all --check
- name: Check clippy
run: cargo clippy --all-targets --profile ${{ matrix.profile }} -- -D warnings
- name: Build targets
run: cargo build --profile ${{ matrix.profile }} --all-targets
- name: Run unit tests
run: cargo test --profile ${{ matrix.profile }}
miri:
runs-on: ubuntu-24.04
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: Install Miri
run: |
rustup toolchain install nightly \
--allow-downgrade \
--profile minimal \
--component miri
cargo +nightly miri setup
- name: Run Miri
run: cargo +nightly miri test --lib
- name: Run concurrent queue test with multiple schedules
env:
MIRIFLAGS: -Zmiri-many-seeds=0..16
run: >
cargo +nightly miri test --lib
queue::test::concurrent_enqueues_work
loom:
runs-on: ubuntu-24.04
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Run Loom model
env:
RUSTFLAGS: --cfg loom
run: >
cargo test --release --lib
queue::test::loom_concurrent_enqueues_work