name: CI

on:
  push:
    branches: [main]
  pull_request:

env:
  FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true

jobs:
  test:
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-latest, macos-latest]
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
      - uses: Swatinem/rust-cache@v2.8.0
      - run: cargo build
      - run: cargo clippy -- -D warnings
      - run: cargo fmt --check
      - run: cargo test
