name: CI

on: [push, pull_request]

jobs:
  ci:
    name: ${{ matrix.os }} - ${{ matrix.rust }}
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-latest, macos-latest, windows-latest]
        rust: [stable, beta, nightly]
    steps:
      - uses: actions/checkout@v3
      - uses: dtolnay/rust-toolchain@master
        with:
          toolchain: ${{ matrix.rust }}
          components: clippy, rustfmt
      - run: cargo build
      - run: cargo test
      - run: cargo fmt -- --check
      - run: cargo clippy
