-
Notifications
You must be signed in to change notification settings - Fork 3
52 lines (51 loc) · 1.58 KB
/
coverage.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
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
pushgateway:
image: prom/pushgateway
options: >-
--health-cmd="wget --spider --quiet http://localhost:9091/metrics || exit 1"
--health-interval=10s
--health-timeout=5s
--health-retries=5
ports:
- 9091:9091
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: Install poetry
run: pip install poetry
- name: Install Requirements
run: POETRY_VIRTUALENVS_CREATE=false python -m poetry install
- name: Run tests with coverage
run: pytest --cov=src --cov-report=html --cov-fail-under=96
# Environment variables used by the `pg_client.py`
env:
DB_URL: postgresql://postgres:postgres@localhost:5432/postgres
PROMETHEUS_PUSHGATEWAY_URL: http://localhost:9091
- name: Upload coverage report
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: htmlcov