name: CI

on:
  pull_request:
    branches:
      - main
    paths:
      # - .github/workflows/**
      - src/**
      - web/**

permissions:
  contents: read

jobs:
  build-test:
    name: build-test (${{ matrix.os }})
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        os:
          - ubuntu-latest
          - macos-latest
          - windows-latest

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

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

      - name: Install Node.js
        uses: actions/setup-node@v4
        with:
          node-version: 22

      - name: Test
        run: cargo test

      - name: Build Release
        run: cargo build --release
