Feature/update questions based on feedback #26
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: Mobility Profile API tests | |
on: | |
push: | |
branches: [ master, develop ] | |
pull_request: | |
branches: [ master, develop ] | |
jobs: | |
build: | |
runs-on: ubuntu-22.04 | |
env: | |
# Database for tests | |
DATABASE_URL: postgis://postgres:postgres@localhost/smbackend | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v3 | |
with: | |
python-version: 3.10.4 | |
- name: Install required Ubuntu packages | |
run: | | |
sudo apt-get update && sudo apt-get install gdal-bin | |
- name: Install PyPI dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: Run Python side code neatness tests | |
run: | | |
flake8 | |
# black --check . | |
isort . -c | |
- name: Run pytest code functionality tests | |
run: | | |
pytest --cov=. | |
- name: Generate Report | |
run: | | |
pip install coverage | |
coverage report -m | |
- name: Upload Coverage to Codecov | |
uses: codecov/codecov-action@v3 | |
# Majority of the tests require database | |
services: | |
# Label used to access the service container | |
postgres: | |
# Docker Hub image | |
image: postgis/postgis:13-3.1 | |
# Provide the password for postgres | |
env: | |
POSTGRES_HOST_AUTH_METHOD: trust | |
# Set health checks to wait until postgres has started | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
ports: | |
- 5432:5432 |