name: CI

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

jobs:
  rust:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Install Rust toolchain
        uses: dtolnay/rust-toolchain@stable

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

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

      - name: Test
        run: cargo test --all-targets
