name: CI

on:
  push:
    branches: [main]
  pull_request:

env:
  CARGO_TERM_COLOR: always

jobs:
  msrv:
    runs-on: macos-latest

    steps:
      - uses: actions/checkout@v6.0.2
      - uses: dtolnay/rust-toolchain@master
        with:
          toolchain: "1.88.0"
      - run: cargo check --locked

  rust:
    runs-on: macos-latest

    steps:
      - uses: actions/checkout@v6.0.2
      - uses: dtolnay/rust-toolchain@stable
        with:
          components: rustfmt, clippy
      - run: cargo fmt -- --check
      - run: cargo clippy --locked --all-targets --all-features -- -D warnings
      - run: cargo test --locked
      - run: cargo package --locked
