name: CI

on: [push]

jobs:
  check:
    name: Check
    runs-on: ubuntu-latest
    strategy:
      matrix:
        toolchain: [stable, beta, nightly]
    steps:
      - name: Checkout sources
        uses: actions/checkout@v6
      - run: rustup update ${{ matrix.toolchain }}
      - run: rustup default ${{ matrix.toolchain }}
      - run: cargo check --all

  test:
    name: Test Suite
    runs-on: ubuntu-latest
    strategy:
      matrix:
        toolchain: [stable, beta, nightly]
    steps:
      - name: Checkout sources
        uses: actions/checkout@v6
      - run: rustup update ${{ matrix.toolchain }}
      - run: rustup default ${{ matrix.toolchain }}
      - run: cargo test --all

  lints:
    name: Lints
    runs-on: ubuntu-latest
    strategy:
      matrix:
        toolchain: [stable]
    steps:
      - name: Checkout sources
        uses: actions/checkout@v6
      - run: rustup update ${{ matrix.toolchain }}
      - run: rustup default ${{ matrix.toolchain }}
      - run: rustup component add rustfmt clippy
      - run: cargo fmt --all -- --check
      - run: cargo clippy --all -- -D warnings
