jobs:
  audit:
    name: Security Audit
    runs-on: ubuntu-latest
    steps:
    - name: Checkout
      uses: actions/checkout@v4
    - name: Install Rust
      uses: dtolnay/rust-toolchain@stable
    - name: Audit
      run: cargo audit --deny warnings
    - name: Deny Check
      run: cargo deny check licenses advisories
  check:
    name: Check + Test + Lint
    runs-on: ubuntu-latest
    steps:
    - name: Checkout
      uses: actions/checkout@v4
    - name: Install Rust
      uses: dtolnay/rust-toolchain@master
      with:
        toolchain: ${{ matrix.rust-version }}
    - name: Cache
      uses: Swatinem/rust-cache@v2
    - name: Check
      run: cargo check --all-targets
    - name: Format Check
      run: cargo fmt --all -- --check
    - name: Clippy
      run: cargo clippy --all-targets -- -D warnings
    - name: Tests
      run: cargo test --workspace
    strategy:
      matrix:
        rust-version:
        - stable
        - nightly
name: Rust CI
on:
  pull_request:
    branches:
    - main
  push:
    branches:
    - main
    - develop
