name: CI

on:
  push:
  pull_request:

jobs:
  test:
    name: ${{ matrix.os }}
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-latest, windows-latest]

    steps:
      - name: Checkout
        uses: actions/checkout@v4

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

      - name: Cache cargo artifacts
        uses: Swatinem/rust-cache@v2

      - name: Cargo check
        run: cargo check --all-targets

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

      - name: Cargo package verify
        run: cargo package
