Skip to content

feat (commands) : activate/deactivate areas #117

feat (commands) : activate/deactivate areas

feat (commands) : activate/deactivate areas #117

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: [ '11', '12' ]
sqlalchemy-version: [ '1.4' ]
include:
- debian-version: "11"
python-version: "3.9"
postgres-version: "13"
postgis-version: "3.2"
- debian-version: "12"
python-version: "3.11"
postgres-version: "15"
postgis-version: "3.3"
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 database extensions
run: |
psql -h localhost -U geouser -d refgeo -tc 'CREATE EXTENSION "postgis_raster";'
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
run: |
python -m pip install --upgrade pip
python -m pip install \
-e .[tests] \
-e dependencies/Utils-Flask-SQLAlchemy \
-e dependencies/Utils-Flask-SQLAlchemy-Geo
- 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 == '12' && matrix.sqlalchemy-version == '1.4' }}
uses: codecov/codecov-action@v3
with:
flags: pytest