name: CI

on:
  push:
    branches:
      - master
  pull_request:
    branches:
      - "**"

env:
  FORCE_COLOR: 2
  NODE: 24
  PYTHON_VERSION: "3.14"

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - name: Clone repository
        uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd #v6.0.2
        with:
          persist-credentials: false
          fetch-depth: 0

      - name: Set up Python
        uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 #v6.2.0
        with:
          python-version: "${{ env.PYTHON_VERSION }}"
          architecture: "x64"
          cache: pip

      - name: Set up Node.js
        uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 #v6.2.0
        with:
          node-version: "${{ env.NODE }}"
          cache: npm

      - name: Install Python dependencies
        run: pip install -r requirements.txt

      - name: Install npm dependencies
        run: npm ci

      - name: Build and test
        run: npm test
