Skip to content

Commit

Permalink
Create python-tests.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Aareon authored Sep 21, 2024
1 parent 959fa36 commit 0111015
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/python-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Python tests

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

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11"] # Adjusted based on pyproject.toml

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 1.5.1
virtualenvs-create: true
virtualenvs-in-project: true
- name: Install dependencies
run: |
poetry install --no-interaction --with test,develop
- name: Run tests with pytest
run: |
poetry run pytest --cov=geonames tests/ --cov-report=xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
fail_ci_if_error: true

0 comments on commit 0111015

Please sign in to comment.