build(ci): run pytest in CI as GitHub action #11
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: pytest | |
on: | |
pull_request: | |
push: | |
branches: [main] | |
jobs: | |
pytest: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install gdal freetype and zbar | |
run: sudo apt-get install -y libgdal-dev libfreetype6-dev libzbar0 | |
- name: Install poetry | |
run: pipx install poetry | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
cache: 'poetry' | |
- name: Install dependencies | |
run: | | |
poetry install | |
- name: Install gdal python package | |
run: | | |
poetry run pip install gdal=="$(gdal-config --version).*" | |
- name: Run tests | |
run: | | |
poetry run pytest tests/unit |