name: Test

on:
  push:
    paths:
      - "src/**"
      - "tests/**"
      - "www/**"
      - "CMakeLists.txt"
      - "scripts/**"
  pull_request:
    paths:
      - "src/**"
      - "tests/**"
      - "www/**"
      - "CMakeLists.txt"
      - "scripts/**"

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

      - name: Install dependencies
        run: |
          sudo apt-get update
          sudo apt-get install -y --no-install-recommends build-essential cmake curl python3 python3-pip

      - name: Run test suite
        run: |
          chmod +x scripts/lm.sh scripts/test/*.sh scripts/lib/*.sh
          ./scripts/lm.sh test run
