M44: harden release integrity and assurance
This commit is contained in:
+34
-5
@@ -4,6 +4,8 @@ on:
|
||||
push:
|
||||
branches: [master]
|
||||
pull_request:
|
||||
schedule:
|
||||
- cron: "17 3 * * 1"
|
||||
|
||||
jobs:
|
||||
backend:
|
||||
@@ -21,8 +23,15 @@ jobs:
|
||||
run: |
|
||||
docker compose -p mobilityops-ci -f compose.yaml -f compose.test.yaml run --build --rm api ruff check app tests
|
||||
docker compose -p mobilityops-ci -f compose.yaml -f compose.test.yaml run --rm api mypy app
|
||||
- name: Contract drift gate
|
||||
run: |
|
||||
docker compose -p mobilityops-ci -f compose.yaml -f compose.test.yaml run --rm \
|
||||
-v "$PWD:/repo:ro" api python /repo/scripts/check-contracts.py
|
||||
python scripts/check-source-budgets.py
|
||||
- name: Build production API image for vulnerability scan
|
||||
run: docker build --target runtime --tag mobilityops-api-ci --file backend/Dockerfile .
|
||||
run: |
|
||||
docker build --target runtime --build-arg VCS_REF="$GITHUB_SHA" \
|
||||
--tag mobilityops-api-ci --file backend/Dockerfile .
|
||||
- name: Production API image vulnerability scan (HIGH/CRITICAL)
|
||||
uses: aquasecurity/trivy-action@6c175e9c4083a92bbca2f9724c8a5e33bc2d97a5 # v0.30.0
|
||||
with:
|
||||
@@ -32,6 +41,19 @@ jobs:
|
||||
severity: HIGH,CRITICAL
|
||||
exit-code: "1"
|
||||
ignore-unfixed: true
|
||||
- name: Build production web image for vulnerability scan
|
||||
run: |
|
||||
docker build --build-arg VCS_REF="$GITHUB_SHA" \
|
||||
--tag mobilityops-web-ci frontend
|
||||
- name: Production web image vulnerability scan (HIGH/CRITICAL)
|
||||
uses: aquasecurity/trivy-action@6c175e9c4083a92bbca2f9724c8a5e33bc2d97a5 # v0.30.0
|
||||
with:
|
||||
scan-type: image
|
||||
image-ref: mobilityops-web-ci
|
||||
format: table
|
||||
severity: HIGH,CRITICAL
|
||||
exit-code: "1"
|
||||
ignore-unfixed: true
|
||||
- name: Remove CI stack
|
||||
if: always()
|
||||
run: docker compose -p mobilityops-ci -f compose.yaml -f compose.test.yaml down -v --remove-orphans
|
||||
@@ -53,7 +75,7 @@ jobs:
|
||||
run: npm run lint
|
||||
- name: Typecheck and production build
|
||||
working-directory: frontend
|
||||
run: npm run build
|
||||
run: npm run build && npm run budget
|
||||
- name: Dependency audit
|
||||
working-directory: frontend
|
||||
run: npm audit --audit-level=high
|
||||
@@ -74,7 +96,7 @@ jobs:
|
||||
run: |
|
||||
cp .env.example .env
|
||||
docker compose -p mobilityops-e2e up --build -d db api web
|
||||
for attempt in $(seq 1 60); do
|
||||
for _attempt in $(seq 1 60); do
|
||||
if curl -fsS http://localhost:1228/health/ready >/dev/null 2>&1; then break; fi
|
||||
sleep 2
|
||||
done
|
||||
@@ -84,18 +106,25 @@ jobs:
|
||||
working-directory: frontend
|
||||
run: |
|
||||
npm ci --no-audit --no-fund
|
||||
npx playwright install --with-deps chromium
|
||||
npx playwright install --with-deps chromium firefox
|
||||
- name: Run browser acceptance suite
|
||||
working-directory: frontend
|
||||
env:
|
||||
MOBILITYOPS_PUBLIC_URL: http://localhost:1228
|
||||
run: npx playwright test
|
||||
- name: Run non-destructive Chromium and Firefox smoke suite
|
||||
working-directory: frontend
|
||||
env:
|
||||
MOBILITYOPS_PUBLIC_URL: http://localhost:1228
|
||||
run: npx playwright test --config=playwright.live.config.ts
|
||||
- name: Upload Playwright report
|
||||
if: failure()
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
|
||||
with:
|
||||
name: playwright-report
|
||||
path: frontend/playwright-report
|
||||
path: |
|
||||
frontend/playwright-report
|
||||
frontend/playwright-live-report
|
||||
- name: Stack logs on failure
|
||||
if: failure()
|
||||
run: docker compose -p mobilityops-e2e logs --tail=200 api web
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
name: MobilityOps release evidence
|
||||
|
||||
on:
|
||||
push:
|
||||
tags: ["v*"]
|
||||
|
||||
jobs:
|
||||
release-evidence:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
|
||||
- name: Build commit-labelled release images
|
||||
run: |
|
||||
docker build --target runtime --build-arg VCS_REF="$GITHUB_SHA" --tag mobilityops-api-release --file backend/Dockerfile .
|
||||
docker build --build-arg VCS_REF="$GITHUB_SHA" --tag mobilityops-web-release frontend
|
||||
- name: Generate API CycloneDX SBOM
|
||||
uses: aquasecurity/trivy-action@6c175e9c4083a92bbca2f9724c8a5e33bc2d97a5 # v0.30.0
|
||||
with:
|
||||
scan-type: image
|
||||
image-ref: mobilityops-api-release
|
||||
format: cyclonedx
|
||||
output: mobilityops-api-sbom.cdx.json
|
||||
- name: Generate web CycloneDX SBOM
|
||||
uses: aquasecurity/trivy-action@6c175e9c4083a92bbca2f9724c8a5e33bc2d97a5 # v0.30.0
|
||||
with:
|
||||
scan-type: image
|
||||
image-ref: mobilityops-web-release
|
||||
format: cyclonedx
|
||||
output: mobilityops-web-sbom.cdx.json
|
||||
- name: Record immutable image metadata
|
||||
run: |
|
||||
docker image inspect mobilityops-api-release > mobilityops-api-image.json
|
||||
docker image inspect mobilityops-web-release > mobilityops-web-image.json
|
||||
sha256sum mobilityops-*-sbom.cdx.json mobilityops-*-image.json > SHA256SUMS
|
||||
- name: Upload release evidence
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
|
||||
with:
|
||||
name: mobilityops-${{ github.ref_name }}-evidence
|
||||
path: |
|
||||
mobilityops-*-sbom.cdx.json
|
||||
mobilityops-*-image.json
|
||||
SHA256SUMS
|
||||
Reference in New Issue
Block a user