name: CI

on:
  push:
    branches: [ '*' ]
  pull_request:
    branches: [ '*' ]

env:
  CARGO_TERM_COLOR: always

jobs:
  build:
    name: Rust CI
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6
      - name: Install stable
        uses: dtolnay/rust-toolchain@stable
        with:
          components: rustfmt, clippy
      - name: Check code formatting
        run: cargo fmt --all -- --check
      - name: Build
        run: cargo build --verbose
      - name: Run tests
        run: cargo test --verbose
      - name: Check cargo clippy warnings
        run: cargo clippy --workspace --all-targets --all-features -- -D warnings
