name: CI

on:
  push:
  pull_request:

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

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

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

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

      - name: test
        run: cargo test

