Trigger test suite on pushes to forks. #245
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: End to End Test | |
on: | |
- push | |
- pull_request | |
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=90 | |
# 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 |