name: Run tests

on:
  push:
    branches:
    - main

  pull_request:
    branches:
    - main

jobs:
  test:
    runs-on: macos-latest

    steps:
    - uses: actions/checkout@v4

    - name: Set up Python
      uses: actions/setup-python@v5
      with:
        python-version: "3.12"
        cache: 'pip'
        cache-dependency-path: 'dev_requirements.txt'

    - name: Install dependencies
      run: pip install -r dev_requirements.txt

    - name: Run tests
      run: python3 -m pytest -n 5 tests
