|
| 1 | +# SPDX-License-Identifier: MPL-2.0 |
| 2 | +# Weekly verification of the heavier self-proof corpora that are too slow and too |
| 3 | +# network-heavy to gate on every PR: Isabelle/HOL (proofs/isabelle) and Mizar |
| 4 | +# (proofs/mizar). Both toolchains are large, non-apt downloads -- Isabelle is a |
| 5 | +# ~500MB tarball and additionally builds the HOL-Algebra image; Mizar ships only |
| 6 | +# from mizar.org (Tier-4 in this project, see live-provers.yml) with its full MML. |
| 7 | +# So this runs on a weekly schedule plus manual dispatch, mirroring container-ci. |
| 8 | +# `just` stays the single source of truth for the commands (RSR-H14): CI installs |
| 9 | +# the toolchains, then calls the same recipes a developer runs locally. |
| 10 | +name: Verification Proof Corpora (weekly) |
| 11 | + |
| 12 | +on: |
| 13 | + schedule: |
| 14 | + - cron: '17 4 * * 1' # Mondays 04:17 UTC |
| 15 | + workflow_dispatch: |
| 16 | + # Tightly path-filtered: a PR that actually touches these proof corpora (or this |
| 17 | + # workflow) gets one confirmation run, but unrelated PRs never trigger the heavy |
| 18 | + # toolchains. The weekly schedule above is the primary gate; this just catches |
| 19 | + # direct edits to the .thy/.miz sources before they land. |
| 20 | + pull_request: |
| 21 | + paths: |
| 22 | + - 'proofs/isabelle/**' |
| 23 | + - 'proofs/mizar/**' |
| 24 | + - '.github/workflows/verification-proofs-cron.yml' |
| 25 | + |
| 26 | +concurrency: |
| 27 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 28 | + cancel-in-progress: true |
| 29 | + |
| 30 | +permissions: |
| 31 | + contents: read |
| 32 | + |
| 33 | +jobs: |
| 34 | + isabelle: |
| 35 | + name: Isabelle/HOL |
| 36 | + runs-on: ubuntu-latest |
| 37 | + timeout-minutes: 60 |
| 38 | + steps: |
| 39 | + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 |
| 40 | + |
| 41 | + - name: Install Isabelle |
| 42 | + run: | |
| 43 | + set -euo pipefail |
| 44 | + # Resolve the current Isabelle linux x86_64 tarball from the website. A |
| 45 | + # pinned /dist/IsabelleYYYY URL 404s once a newer release supersedes it |
| 46 | + # (live-provers.yml's Isabelle2024 pin has rotted), so discover the link |
| 47 | + # from the homepage, then fall back to the dist/ directory listing. |
| 48 | + url="" |
| 49 | + for src in "https://isabelle.in.tum.de/" "https://isabelle.in.tum.de/dist/"; do |
| 50 | + page="$(curl -fsSL --max-time 120 --retry 3 "$src" || true)" |
| 51 | + echo "--- candidates from $src ---" |
| 52 | + printf '%s\n' "$page" | grep -oE '(dist/)?Isabelle[0-9][0-9-]*_linux\.tar\.gz' | sort -V | uniq | tail -5 || true |
| 53 | + rel="$(printf '%s\n' "$page" | grep -oE '(dist/)?Isabelle[0-9][0-9-]*_linux\.tar\.gz' | sort -V | uniq | tail -1)" |
| 54 | + if [ -n "$rel" ]; then |
| 55 | + case "$rel" in dist/*) url="https://isabelle.in.tum.de/$rel" ;; *) url="https://isabelle.in.tum.de/dist/$rel" ;; esac |
| 56 | + break |
| 57 | + fi |
| 58 | + done |
| 59 | + [ -n "$url" ] || { echo "could not resolve Isabelle linux tarball URL" >&2; exit 1; } |
| 60 | + echo "Resolved Isabelle URL: $url" |
| 61 | + curl -fsSL --max-time 900 --retry 3 --retry-delay 15 -o /tmp/isabelle.tar.gz "$url" |
| 62 | + sudo mkdir -p /opt/isabelle |
| 63 | + sudo tar xzf /tmp/isabelle.tar.gz -C /opt/isabelle |
| 64 | + ISABELLE_BIN="$(find /opt/isabelle -type f -name isabelle | head -n 1)" |
| 65 | + [ -n "$ISABELLE_BIN" ] || { echo "isabelle launcher not found after extract" >&2; exit 1; } |
| 66 | + sudo ln -sf "$ISABELLE_BIN" /usr/local/bin/isabelle |
| 67 | + isabelle version |
| 68 | +
|
| 69 | + - name: Install just |
| 70 | + run: | |
| 71 | + set -euo pipefail |
| 72 | + curl -fsSL --retry 3 \ |
| 73 | + "https://github.com/casey/just/releases/download/1.51.0/just-1.51.0-x86_64-unknown-linux-musl.tar.gz" \ |
| 74 | + -o /tmp/just.tar.gz |
| 75 | + mkdir -p "$HOME/.local/bin" |
| 76 | + tar xzf /tmp/just.tar.gz -C "$HOME/.local/bin" just |
| 77 | + echo "$HOME/.local/bin" >> "$GITHUB_PATH" |
| 78 | +
|
| 79 | + - name: Verify Isabelle corpus |
| 80 | + run: just proofs-isabelle |
| 81 | + |
| 82 | + mizar: |
| 83 | + name: Mizar |
| 84 | + runs-on: ubuntu-latest |
| 85 | + timeout-minutes: 60 |
| 86 | + steps: |
| 87 | + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 |
| 88 | + |
| 89 | + - name: Install Mizar (system + MML) |
| 90 | + run: | |
| 91 | + set -euo pipefail |
| 92 | + # Mizar ships only from mizar.org with no stable, documented path (the |
| 93 | + # /system/i386-linux/ guess 404s). Discover the linux tarball by scraping |
| 94 | + # the system index; dump candidate hrefs so one run reveals the layout if |
| 95 | + # discovery misses. |
| 96 | + # Two-stage discovery: mizar.org/system/ only links to per-arch *directories* |
| 97 | + # on the upstream host (http://mizar.uwb.edu.pl/.../i386-linux/); the actual |
| 98 | + # tarball lives inside that directory. |
| 99 | + sys="$(curl -fsSL --max-time 120 --retry 3 "http://mizar.org/system/" || true)" |
| 100 | + dir="$(printf '%s\n' "$sys" | grep -oiE 'href="http://[^"]*i386-linux/?"' \ |
| 101 | + | sed -E 's/^href="//I; s/"$//' | head -1)" |
| 102 | + [ -n "$dir" ] || dir="http://mizar.uwb.edu.pl/~softadm/pub/system/i386-linux/" |
| 103 | + dir="${dir%/}/" |
| 104 | + echo "Mizar i386-linux dir: $dir" |
| 105 | + idx="$(curl -fsSL --max-time 120 --retry 3 "$dir" || true)" |
| 106 | + echo "=== .tar candidates in $dir ===" |
| 107 | + printf '%s\n' "$idx" | grep -oiE 'href="[^"]+"' | grep -iE '\.tar' | head -40 || true |
| 108 | + rel="$(printf '%s\n' "$idx" | grep -oiE 'href="[^"]*mizar-[^"]*i386-linux\.tar"' \ |
| 109 | + | sed -E 's/^href="//I; s/"$//' | sort -V | uniq | tail -1)" |
| 110 | + [ -n "$rel" ] || rel="$(printf '%s\n' "$idx" | grep -oiE 'href="[^"]*\.tar"' \ |
| 111 | + | sed -E 's/^href="//I; s/"$//' | sort -V | uniq | tail -1)" |
| 112 | + [ -n "$rel" ] || { echo "no Mizar .tar found in $dir" >&2; exit 1; } |
| 113 | + case "$rel" in http*) found="$rel" ;; /*) found="http://mizar.uwb.edu.pl$rel" ;; *) found="$dir$rel" ;; esac |
| 114 | + echo "Resolved Mizar URL: $found" |
| 115 | + curl -fsSL --max-time 600 --retry 3 -o /tmp/mizar.tar "$found" |
| 116 | + mkdir -p "$HOME/mizar" |
| 117 | + tar xf /tmp/mizar.tar -C "$HOME/mizar" |
| 118 | + echo "=== outer archive contents ==="; ls -la "$HOME/mizar" | head -30 |
| 119 | + cd "$HOME/mizar" |
| 120 | + for inner in mizbin mizshare mizdoc; do |
| 121 | + for ext in tar.gz tgz tar; do |
| 122 | + [ -f "$inner.$ext" ] && { echo "extracting $inner.$ext"; tar xf "$inner.$ext"; } |
| 123 | + done |
| 124 | + done |
| 125 | + echo "=== after inner extraction ==="; ls -la "$HOME/mizar" | head -40 |
| 126 | + # mizbin.tar.gz extracts the binaries (makeenv, accom, verifier, ...) flat |
| 127 | + # into $HOME/mizar alongside the MML share, so both PATH and MIZFILES point |
| 128 | + # at $HOME/mizar -- there is no bin/ subdir. |
| 129 | + echo "MIZFILES=$HOME/mizar" >> "$GITHUB_ENV" |
| 130 | + echo "$HOME/mizar" >> "$GITHUB_PATH" |
| 131 | + ls -l "$HOME/mizar/makeenv" "$HOME/mizar/verifier" "$HOME/mizar/accom" |
| 132 | +
|
| 133 | + - name: Install just |
| 134 | + run: | |
| 135 | + set -euo pipefail |
| 136 | + curl -fsSL --retry 3 \ |
| 137 | + "https://github.com/casey/just/releases/download/1.51.0/just-1.51.0-x86_64-unknown-linux-musl.tar.gz" \ |
| 138 | + -o /tmp/just.tar.gz |
| 139 | + mkdir -p "$HOME/.local/bin" |
| 140 | + tar xzf /tmp/just.tar.gz -C "$HOME/.local/bin" just |
| 141 | + echo "$HOME/.local/bin" >> "$GITHUB_PATH" |
| 142 | +
|
| 143 | + - name: Verify Mizar corpus |
| 144 | + run: just proofs-mizar |
0 commit comments