59 lines
2.3 KiB
YAML
59 lines
2.3 KiB
YAML
name: Rebuild V2 candidate verification
|
|
on:
|
|
push:
|
|
branches: [codex/videoreg-rebuild-v2]
|
|
workflow_dispatch:
|
|
jobs:
|
|
candidate:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: "22"
|
|
- run: npm ci --no-audit --no-fund
|
|
- name: Types, tests and complete static build
|
|
env:
|
|
COMMIT_SHA: ${{ github.sha }}
|
|
NEXT_TELEMETRY_DISABLED: "1"
|
|
run: npm run ci:quality
|
|
- name: Install pinned recovery verification dependencies
|
|
run: |
|
|
python3 -m venv .local-run/recovery-env
|
|
.local-run/recovery-env/bin/python -m pip install --disable-pip-version-check -r scripts/rebuild-v2/requirements.txt
|
|
- name: Validate complete export and safe preview
|
|
shell: bash
|
|
run: |
|
|
set -euo pipefail
|
|
py=.local-run/recovery-env/bin/python
|
|
"$py" scripts/rebuild-v2/check-preview.py
|
|
"$py" deploy/serve-local.py > "${RUNNER_TEMP}/videoreg-v2-preview.log" 2>&1 &
|
|
preview_pid=$!
|
|
trap 'kill "$preview_pid" 2>/dev/null || true' EXIT
|
|
base=$("$py" - "$preview_pid" <<'PYREADY'
|
|
import json, pathlib, sys, time, urllib.request
|
|
expected_pid = int(sys.argv[1])
|
|
for attempt in range(50):
|
|
try:
|
|
state = json.loads(pathlib.Path('.local-run/server.json').read_text())
|
|
if state['pid'] == expected_pid:
|
|
with urllib.request.urlopen(state['url'] + '/health/ready', timeout=1) as response:
|
|
if response.status == 200:
|
|
print(state['url'])
|
|
break
|
|
except (OSError, ValueError, KeyError):
|
|
pass
|
|
time.sleep(0.1)
|
|
else:
|
|
raise SystemExit('Candidate preview did not become ready')
|
|
PYREADY
|
|
)
|
|
"$py" scripts/rebuild-v2/check-built.py --base "$base"
|
|
- name: Upload complete-candidate verification evidence
|
|
if: always()
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: videoreg-v2-built-crawl-${{ github.sha }}
|
|
path: docs/rebuild-v2/evidence/built-crawl.json
|
|
if-no-files-found: warn
|