name: test

on:
  push:
    branches: [main]
    tags: ['v*']
  pull_request:

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - uses: actions/setup-node@v4
        with:
          node-version: '22'

      - uses: actions/setup-python@v5
        with:
          python-version: '3.12'

      - name: Install Python deps for correctness checks
        run: pip install pandas

      - name: Check rule copies
        run: node scripts/check-rule-copies.js

      - name: Check version consistency
        run: node scripts/check-versions.js

      - name: Run tests
        run: npm test
