Skip to content

---

--- #628

Workflow file for this run

name: Unit tests
on: [push]
jobs:
run:
runs-on: ubuntu-20.04
env:
OS: ubuntu-20.04
PYTHON: '3.8'
# Service containers to run with `container-job`
services:
# Label used to access the service container
postgres:
image: postgres:10.8
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
ports:
- 5432:5432
# needed because the postgres container does not provide a healthcheck
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel coverage
- name: Generate Report
env:
# The hostname used to communicate with the PostgreSQL service container
POSTGRES_HOST: localhost
POSTGRES_PORT: ${{ job.services.postgres.ports[5432] }}
# The default PostgreSQL port
COVIGATOR_DB_NAME: postgres
COVIGATOR_DB_USER: postgres
COVIGATOR_DB_PASSWORD: postgres
COVIGATOR_DB_PORT: ${{ job.services.postgres.ports[5432] }}
COVIGATOR_DB_HOST: localhost
run: |
python setup.py bdist_wheel
pip install numpy==1.21.0
pip install dist/covigator*.whl
coverage run -m unittest discover covigator.tests.unit_tests
- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v3