Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 75 additions & 0 deletions .github/workflows/hosted-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Hosted review

on:
pull_request:
paths:
- '.github/workflows/hosted-review.yml'
- 'verification/hosted_math/**'

permissions:
contents: read

jobs:
capture:
if: github.event.pull_request.head.repo.full_name == github.repository
runs-on: ubuntu-24.04
timeout-minutes: 30
env:
CAPTURE_REVISION: ec5ca9f02573aefce54d368f4357caf305b102b7
steps:
- name: Check out the validation helper source
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
with:
ref: ${{ github.event.pull_request.head.sha }}
persist-credentials: false
- name: Check out the pinned scientific source
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
with:
ref: ${{ env.CAPTURE_REVISION }}
path: checked-source
persist-credentials: false
- name: Set up Node
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
with:
node-version: '22'
- name: Install the capture runtime
run: |
npm install --prefix "$RUNNER_TEMP/math-runtime" playwright@1.56.1 mathjax-full@3.2.1
node "$RUNNER_TEMP/math-runtime/node_modules/playwright/cli.js" install chromium
- name: Compare the pinned GitHub pages at both widths
shell: bash
run: |
export NODE_PATH="$RUNNER_TEMP/math-runtime/node_modules"
capture=(node verification/hosted_math/capture_hosted_math.cjs
--root "$GITHUB_WORKSPACE/checked-source"
--repository "$GITHUB_REPOSITORY"
--revision "$CAPTURE_REVISION"
--contract verification/hosted_math/headline-contract.json)
evidence="$RUNNER_TEMP/hosted-review"
previous=()
for attempt in 1 2 3; do
current="$evidence/attempt-$attempt"
if "${capture[@]}" "${previous[@]}" --output "$current"; then
exit 0
fi
python3 - "$current/capture-state.json" <<'PY' || exit 1
import json
from pathlib import Path
import sys

path = Path(sys.argv[1])
failures = json.loads(path.read_text())["failures"] if path.is_file() else []
if not failures or any(item["category"] != "transport_failure" for item in failures):
raise SystemExit(1)
PY
previous=(--resume-from "$current")
done
exit 1
- name: Retain captures and reports
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
with:
name: hosted-review-${{ env.CAPTURE_REVISION }}-${{ github.run_attempt }}
path: ${{ runner.temp }}/hosted-review
if-no-files-found: error
retention-days: 7
Loading
Loading