Skip to content

clean up unused assigned vars and add test #44

clean up unused assigned vars and add test

clean up unused assigned vars and add test #44

Workflow file for this run

name: GerryDB metadata server tests
on: [push, pull_request]
jobs:
run:
runs-on: ${{ matrix.os }}
# Postgres configuration: see
# https://docs.github.com/en/actions/using-containerized-services/creating-postgresql-service-containers#running-jobs-in-containers
services:
# Label used to access the service container
postgres:
# Docker Hub image
image: postgis/postgis
# 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
strategy:
matrix:
python-version: ['3.11']
os: [ubuntu-latest]
env:
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python-version }}
steps:
- uses: actions/checkout@main
- name: Set up Python
uses: actions/setup-python@master
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install poetry
pip install .
pip install black isort
pip install pytest pytest-cov
- name: Check formatting
run: |
python -m black . --check
python -m isort . --diff
- name: Run tests and generate coverage report
run: |
pytest -v --cov=./ --cov-report=xml
env:
GERRYDB_DATABASE_URI: postgresql://postgres:postgres@localhost:5432/postgres
GERRYDB_TEST_DATABASE_URI: postgresql://postgres:postgres@localhost:5432/postgres
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: .
env_vars: OS,PYTHON
fail_ci_if_error: true
files: ./coverage.xml
flags: unittests
name: codecov-umbrella
verbose: true