Some checks failed
Container CVE Scan (development) / Scan backend/frontend images for CVEs (push) Successful in 2m41s
E2E API Smoke / Core API E2E Smoke (push) Failing after 2m8s
PostgreSQL Compatibility Matrix / PG14 smoke (push) Successful in 7s
PostgreSQL Compatibility Matrix / PG15 smoke (push) Successful in 8s
PostgreSQL Compatibility Matrix / PG16 smoke (push) Successful in 8s
PostgreSQL Compatibility Matrix / PG17 smoke (push) Successful in 8s
PostgreSQL Compatibility Matrix / PG18 smoke (push) Successful in 8s
Python Dependency Security / pip-audit (block high/critical) (push) Successful in 26s
The PostgreSQL service in the GitHub Actions workflow was replaced by a Docker container for better control and flexibility. Additional steps were added to manage the container lifecycle, including starting, logging, and cleaning up. Also, updated the app version from 0.2.4 to 0.2.5.
111 lines
3.2 KiB
YAML
111 lines
3.2 KiB
YAML
name: E2E API Smoke
|
|
|
|
on:
|
|
push:
|
|
branches: ["main", "master", "development"]
|
|
paths:
|
|
- "backend/**"
|
|
- ".github/workflows/e2e-api-smoke.yml"
|
|
pull_request:
|
|
paths:
|
|
- "backend/**"
|
|
- ".github/workflows/e2e-api-smoke.yml"
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
e2e-smoke:
|
|
name: Core API E2E Smoke
|
|
runs-on: ubuntu-latest
|
|
|
|
env:
|
|
APP_NAME: NexaPG Monitor
|
|
ENVIRONMENT: test
|
|
LOG_LEVEL: INFO
|
|
DB_HOST: 127.0.0.1
|
|
DB_PORT: 5432
|
|
DB_NAME: nexapg
|
|
DB_USER: nexapg
|
|
DB_PASSWORD: nexapg
|
|
JWT_SECRET_KEY: smoke_jwt_secret_for_ci_only
|
|
JWT_ALGORITHM: HS256
|
|
JWT_ACCESS_TOKEN_MINUTES: 15
|
|
JWT_REFRESH_TOKEN_MINUTES: 10080
|
|
ENCRYPTION_KEY: 5fLf8HSTbEUeo1c4DnWnvkXxU6v8XJ8iW58wNw5vJ8s=
|
|
CORS_ORIGINS: http://localhost:5173
|
|
POLL_INTERVAL_SECONDS: 30
|
|
INIT_ADMIN_EMAIL: admin@example.com
|
|
INIT_ADMIN_PASSWORD: ChangeMe123!
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 1
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: "3.13"
|
|
|
|
- name: Start PostgreSQL container
|
|
run: |
|
|
docker rm -f nexapg-e2e-pg >/dev/null 2>&1 || true
|
|
docker run -d \
|
|
--name nexapg-e2e-pg \
|
|
-e POSTGRES_DB=nexapg \
|
|
-e POSTGRES_USER=nexapg \
|
|
-e POSTGRES_PASSWORD=nexapg \
|
|
-p 5432:5432 \
|
|
postgres:16
|
|
|
|
- name: Install backend dependencies + test tooling
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install -r backend/requirements.txt
|
|
pip install pytest
|
|
|
|
- name: Wait for PostgreSQL service
|
|
run: |
|
|
python - <<'PY'
|
|
import asyncio
|
|
import asyncpg
|
|
|
|
async def wait_for_db():
|
|
dsn = "postgresql://nexapg:nexapg@127.0.0.1:5432/nexapg?sslmode=disable"
|
|
last_err = None
|
|
for attempt in range(1, 61):
|
|
try:
|
|
conn = await asyncpg.connect(dsn=dsn, timeout=3)
|
|
try:
|
|
await conn.execute("SELECT 1")
|
|
finally:
|
|
await conn.close()
|
|
print(f"PostgreSQL ready after {attempt} attempt(s).")
|
|
return
|
|
except Exception as exc:
|
|
last_err = exc
|
|
await asyncio.sleep(2)
|
|
raise RuntimeError(f"PostgreSQL not ready after retries: {last_err}")
|
|
|
|
asyncio.run(wait_for_db())
|
|
PY
|
|
|
|
- name: Show PostgreSQL container status
|
|
if: ${{ always() }}
|
|
run: |
|
|
docker ps -a --filter "name=nexapg-e2e-pg"
|
|
docker logs --tail=80 nexapg-e2e-pg || true
|
|
|
|
- name: Run Alembic migrations
|
|
working-directory: backend
|
|
run: alembic upgrade head
|
|
|
|
- name: Run core API smoke suite
|
|
env:
|
|
PYTHONPATH: backend
|
|
run: pytest -q backend/tests/e2e/test_api_smoke.py
|
|
|
|
- name: Cleanup PostgreSQL container
|
|
if: ${{ always() }}
|
|
run: docker rm -f nexapg-e2e-pg >/dev/null 2>&1 || true
|