Compare commits
2 Commits
3e317abda8
...
8d47c0c378
| Author | SHA1 | Date | |
|---|---|---|---|
| 8d47c0c378 | |||
| 7f7cf9179f |
@@ -55,50 +55,6 @@ jobs:
|
||||
provenance: false
|
||||
sbom: false
|
||||
|
||||
- name: Trivy scan (backend)
|
||||
uses: aquasecurity/trivy-action@0.24.0
|
||||
with:
|
||||
image-ref: nexapg-backend:dev-scan
|
||||
format: json
|
||||
output: trivy-backend.json
|
||||
severity: UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL
|
||||
ignore-unfixed: false
|
||||
exit-code: 0
|
||||
|
||||
- name: Trivy scan (frontend)
|
||||
uses: aquasecurity/trivy-action@0.24.0
|
||||
with:
|
||||
image-ref: nexapg-frontend:dev-scan
|
||||
format: json
|
||||
output: trivy-frontend.json
|
||||
severity: UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL
|
||||
ignore-unfixed: false
|
||||
exit-code: 0
|
||||
|
||||
- name: Summarize Trivy severities
|
||||
run: |
|
||||
python - <<'PY'
|
||||
import json
|
||||
from collections import Counter
|
||||
|
||||
def summarize(path):
|
||||
c = Counter()
|
||||
with open(path, "r", encoding="utf-8") as f:
|
||||
data = json.load(f)
|
||||
for result in data.get("Results", []):
|
||||
for v in result.get("Vulnerabilities", []) or []:
|
||||
c[v.get("Severity", "UNKNOWN")] += 1
|
||||
for sev in ["CRITICAL", "HIGH", "MEDIUM", "LOW", "UNKNOWN"]:
|
||||
c.setdefault(sev, 0)
|
||||
return c
|
||||
|
||||
for label, path in [("backend", "trivy-backend.json"), ("frontend", "trivy-frontend.json")]:
|
||||
s = summarize(path)
|
||||
print(f"===== Trivy {label} =====")
|
||||
print(f"CRITICAL={s['CRITICAL']} HIGH={s['HIGH']} MEDIUM={s['MEDIUM']} LOW={s['LOW']} UNKNOWN={s['UNKNOWN']}")
|
||||
print()
|
||||
PY
|
||||
|
||||
- name: Docker Scout scan (backend)
|
||||
continue-on-error: true
|
||||
run: |
|
||||
@@ -152,7 +108,5 @@ jobs:
|
||||
with:
|
||||
name: container-cve-scan-reports
|
||||
path: |
|
||||
trivy-backend.json
|
||||
trivy-frontend.json
|
||||
scout-backend.txt
|
||||
scout-frontend.txt
|
||||
|
||||
26
.github/workflows/e2e-api-smoke.yml
vendored
26
.github/workflows/e2e-api-smoke.yml
vendored
@@ -68,6 +68,32 @@ jobs:
|
||||
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: Run Alembic migrations
|
||||
working-directory: backend
|
||||
run: alembic upgrade head
|
||||
|
||||
Reference in New Issue
Block a user