diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..0c36a28 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,44 @@ +name: Python CI + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +permissions: + contents: read + +jobs: + test: + name: Run Tests + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ['3.11', '3.13'] # the one we have in the Codespace + the latest supported one by PyO3. + fail-fast: false # Continue testing other version(s) if one fails + + steps: + - name: Checkout repository + uses: actions/checkout@v5 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v6 + with: + python-version: ${{ matrix.python-version }} + cache: 'pip' + + - name: Install dependencies + run: | + python -m venv .venv + source .venv/bin/activate + python -m pip install --upgrade pip + python -m pip install -r requirements.txt + python -m pip install -r requirements-test.txt + + - name: Run tests with pytest + run: | + source .venv/bin/activate + pytest tests/ -v + env: + PYTHONPATH: ${{ github.workspace }}