mod-events 0.2.0

A high-performance, zero-overhead event dispatcher library for Rust
Documentation
name: CI

on:
  push:
    branches: [main]
  pull_request:

env:
  CARGO_TERM_COLOR: always

jobs:
  check:
    name: check / ${{ matrix.os }}
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-latest, macos-latest, windows-latest]
    steps:
      - uses: actions/checkout@v4

      # rust-toolchain.toml drives the channel + components.
      - uses: dtolnay/rust-toolchain@stable
        id: toolchain
      - uses: Swatinem/rust-cache@v2

      - name: format
        run: cargo fmt --all -- --check

      - name: clippy
        run: cargo clippy --all-targets --all-features -- -D warnings

      - name: build
        run: cargo build --all-features --verbose

      - name: test
        run: cargo test --all-features --verbose

      - name: doc
        env:
          RUSTDOCFLAGS: -D warnings
        run: cargo doc --no-deps --all-features

  msrv:
    name: msrv (1.75)
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      # Pin to declared MSRV; ignore rust-toolchain.toml override.
      - uses: dtolnay/rust-toolchain@1.75.0
      - uses: Swatinem/rust-cache@v2
      - name: build
        # Skip rust-toolchain.toml so the MSRV toolchain is used.
        run: RUSTUP_TOOLCHAIN=1.75.0 cargo build --all-features --verbose

  audit:
    name: cargo audit
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: rustsec/audit-check@v2
        with:
          token: ${{ secrets.GITHUB_TOKEN }}

  deny:
    name: cargo deny
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: EmbarkStudios/cargo-deny-action@v2
        with:
          command: check all

  loom:
    name: loom (concurrency model check)
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
      - uses: Swatinem/rust-cache@v2
      - name: loom model check
        env:
          # `--cfg loom` activates `tests/loom_concurrent.rs`; release
          # mode keeps loom's exhaustive interleaving exploration
          # tractable.
          RUSTFLAGS: --cfg loom
        run: cargo test --release --test loom_concurrent