Skip to content

Merge pull request #30 from City-of-Turku/dependabot/pip/django-4.2.10 #103

Merge pull request #30 from City-of-Turku/dependabot/pip/django-4.2.10

Merge pull request #30 from City-of-Turku/dependabot/pip/django-4.2.10 #103

Workflow file for this run

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: postgres://postgres:postgres@localhost/mobilityprofile
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
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@v4
# 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