---
name: Test

"on":
  push:
    branches: [master, rust]
  pull_request:
    branches: [master, rust]

jobs:
  test:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v4

      - name: Install Breezy
        run: |
          pip install 'breezy>=3.3.6'

      - name: Install Rust toolchain
        uses: dtolnay/rust-toolchain@stable
        with:
          components: rustfmt, clippy

      - uses: Swatinem/rust-cache@v2

      - name: Check formatting
        run: cargo fmt --all -- --check

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

      - name: Build
        run: cargo build --all-targets --verbose

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