Skip to content

Setup Coverage Report & Test config.py #1

Setup Coverage Report & Test config.py

Setup Coverage Report & Test config.py #1

Workflow file for this run

name: End to End Test
on: push
jobs:
db-job:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:17
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:
- 5432:5432
# Copy repo contents into container (needed to populate DB)
volumes:
- ${{ github.workspace }}:/repo
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install Requirements
run: pip install -r requirements/dev.txt
- name: Run tests with coverage
run: pytest --cov=src --cov-report=xml --cov-fail-under=80
# Environment variables used by the `pg_client.py`
env:
DB_URL: postgresql://postgres:postgres@localhost:5432/postgres
- name: Upload coverage report
uses: actions/upload-artifact@v2
with:
name: coverage-report
path: coverage.xml