Skip to content

packaging: build CLI as portable binary too #220

packaging: build CLI as portable binary too

packaging: build CLI as portable binary too #220

Workflow file for this run

name: "Tester 🎳"
on:
push:
branches:
- master
paths:
- ".github/workflows/tester_ubuntu.yml"
- "**/*.py"
- "requirements/base.txt"
- "requirements/testing.txt"
pull_request:
branches:
- master
- feature/*
paths:
- ".github/workflows/tester_ubuntu.yml"
- "**/*.py"
- "requirements/base.txt"
- "requirements/testing.txt"
env:
GDAL_VERSION: 3.*
PROJECT_FOLDER: "dicogis"
PYTHON_VERSION: "3.10"
jobs:
test-ubuntu:
runs-on: ubuntu-22.04
permissions:
packages: read
services:
postgis:
image: postgis/postgis:15-3.4-alpine
env:
POSTGRES_DB: sample_gisdata
POSTGRES_PASSWORD: dicogis_tests
POSTGRES_USER: dicogis_admin
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5555:5432
steps:
- name: Get source code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: "pip"
cache-dependency-path: "requirements/testing.txt"
- name: Install GDAL binaries
run: |
sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable && sudo apt-get update
sudo apt install gdal-bin=${{ env.GDAL_VERSION }}
sudo apt install libgdal-dev=${{ env.GDAL_VERSION }}
export CPLUS_INCLUDE_PATH=/usr/include/gdal
export C_INCLUDE_PATH=/usr/include/gdal
gdal-config --version
- name: Install complementary tools
run: |
sudo apt install python3-tk
- name: Install project requirements
run: |
python -m pip install -U pip setuptools wheel
# Install GDAL first
python -m pip install GDAL=="`gdal-config --version`.*"
# then other dependencies
python -m pip install -U -r requirements/base.txt
python -m pip install -U -r requirements/testing.txt
- name: Install project as a package
run: python -m pip install -e .
- name: Install tests fixtures
run: python -m pip install -U gisdata -t ./tests/fixtures
- name: Unit tests
run: pytest
- name: Upload coverage to Codecov
uses: codecov/[email protected]
with:
env_vars: PYTHON
flags: unittests
name: Code Coverage for unittests on Ubuntu (Python-${{ env.PYTHON_VERSION }}]
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}