Skip to content

ecuador draft

ecuador draft #61

Workflow file for this run

# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Python application
on:
push:
branches:
- main
- master
- main
- '*'
pull_request:
branches:
- main
- master
- main
- '*'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
services:
# Label used to access the service container
postgres:
# Docker Hub image
image: postgis/postgis:latest
# Provide the password for postgres
env:
POSTGRES_PASSWORD: postgres
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Maps tcp port 5432 on service container to the host
- 5432:5432
steps:
- uses: actions/checkout@v2
- name: Set up Postgres Usage
run: |
echo "localhost:5432:*:postgres:postgres" >> $HOME/.pgpass
chmod 0600 $HOME/.pgpass
sudo apt-get install -y postgresql-client
psql -c 'create database test_gis_fillers;' -U postgres --host localhost
psql -U postgres --host localhost -c "create extension if not exists postgis;"
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
# - name: Install R
# run: |
# sudo apt-get -qq update
# sudo apt-get -y --allow-unauthenticated install r-base r-base-dev
# sudo su - -c "R -q -e \"install.packages('optparse')\""
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
pip install -e git+https://github.com/wschuell/db_fillers.git@main#egg=db_fillers
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
sudo apt-get install -y libsqlite3-dev
pip install codecov pytest-cov
python setup.py develop
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
pytest --cov=./
- name: Upload codecov info
run: |
codecov