name: CI

on:
  push:
    branches:
      - main
  pull_request:
    branches:
      - main

jobs:
  rust:
    name: ${{ matrix.os }}
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        os:
          - ubuntu-latest
          - macos-latest

    steps:
      - name: Check out repository
        uses: actions/checkout@v4

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

      - name: Run cargo check
        run: cargo check --workspace

      - name: Run cargo test
        run: cargo test --workspace

      - name: Run release build
        run: cargo build --release
