Skip to content

ref_geo point & cor area linear #35

ref_geo point & cor area linear

ref_geo point & cor area linear #35

Workflow file for this run

name: pytest
on:
push:
branches:
- master
- develop
pull_request:
branches:
- master
- develop
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
debian-version: [ '10', '11' ]
sqlalchemy-version: [ '1.3', '1.4' ]
exclude:
- sqlalchemy-version: '1.3'
debian-version: '10'
include:
- debian-version: '10'
python-version: '3.7'
postgres-version: '11'
postgis-version: '2.5'
- debian-version: '11'
python-version: '3.9'
postgres-version: '13'
postgis-version: '3.2'
name: Debian ${{ matrix.debian-version}} - SQLAlchemy ${{ matrix.sqlalchemy-version }}
env:
REF_GEO_SQLALCHEMY_DATABASE_URI: "postgresql://geouser:geopasswd@127.0.0.1:5432/refgeo"
services:
postgres:
image: postgis/postgis:${{ matrix.postgres-version }}-${{ matrix.postgis-version }}
env:
POSTGRES_DB: refgeo
POSTGRES_USER: geouser
POSTGRES_PASSWORD: geopasswd
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Add postgis_raster database extension
if: ${{ matrix.postgis-version >= 3 }}
run: |
psql -h localhost -U geouser -d refgeo -tc 'CREATE EXTENSION "postgis_raster";'
env:
PGPASSWORD: geopasswd
- name: Add database extensions
run: |
psql -h localhost -U geouser -d refgeo -tc 'CREATE EXTENSION "hstore";'
psql -h localhost -U geouser -d refgeo -tc 'CREATE EXTENSION "uuid-ossp";'
psql -h localhost -U geouser -d refgeo -tc 'CREATE EXTENSION "pg_trgm";'
psql -h localhost -U geouser -d refgeo -tc 'CREATE EXTENSION "unaccent";'
env:
PGPASSWORD: geopasswd
- uses: actions/checkout@v3
with:
submodules: true
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install GDAL
run: |
sudo apt update
sudo apt install -y libgdal-dev
- name: Install dependencies
if: ${{ matrix.sqlalchemy-version == '1.3' }}
run: |
python -m pip install --upgrade pip
python -m pip install \
-e .[tests] \
-e dependencies/Utils-Flask-SQLAlchemy \
-e dependencies/Utils-Flask-SQLAlchemy-Geo \
'sqlalchemy>=1.3,<1.4' \
'flask-sqlalchemy<3'
- name: Install dependencies
if: ${{ matrix.sqlalchemy-version == '1.4' }}
run: |
python -m pip install --upgrade pip
python -m pip install \
-e .[tests] \
-e dependencies/Utils-Flask-SQLAlchemy \
-e dependencies/Utils-Flask-SQLAlchemy-Geo \
'sqlalchemy>=1.4,<2'
- name: Show database branches and dependencies
run: |
flask db status --dependencies
- name: Install database
run: |
flask db upgrade ref_geo@head -x local-srid=2154
flask db upgrade ref_geo_fr_municipalities@head
flask db upgrade ref_geo_inpn_grids_5@head
- name: Show database status
run: |
flask db status
- name: Test with pytest
run: |
pytest -v --cov --cov-report xml
- name: Upload coverage to Codecov
if: ${{ matrix.debian-version == '11' && matrix.sqlalchemy-version == '1.4' }}
uses: codecov/codecov-action@v3
with:
flags: pytest