name: Run Tests

on:
  push:
    branches:
      - main
  pull_request:
    branches:
      - main

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
    - name: Checkout repository
      uses: actions/checkout@v3

    - name: Set up Python
      uses: actions/setup-python@v4
      with:
        python-version: '3.10'

    - name: Install Poetry
      run: |
        curl -sSL https://install.python-poetry.org | python3 -

    - name: Configure Poetry
      run: |
        poetry config virtualenvs.in-project true

    - name: Install dependencies
      run: |
        poetry install -vvv

    - name: Run tests
      run: poetry run python -m unittest discover