# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: 'ci'

on:
  push:
    branches: [ "main" ]
  pull_request:
    branches: [ "main" ]

permissions:
  contents: read

jobs:
  test_and_format:
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v4
    - name: Set up Python 3.12
      uses: actions/setup-python@v4
      with:
        python-version: "3.12"
    - name: 'Install dependencies'
      run: |
        pip install uv
        make install

    - name: 'Check formatting'
      run: | 
        uv run -- black --check .
        uv run -- isort --profile black --check --diff .

    - name: 'Test with Pytest'
      run: |
        make test

    
