|
| 1 | +# SPDX-License-Identifier: MPL-2.0 |
| 2 | +# Gates the ECHIDNA dogfood proof corpus: every theorem under proofs/{coq,lean,agda} |
| 3 | +# must type-check. These proofs had no CI coverage before this workflow -- the other |
| 4 | +# proof workflows are path-filtered to meta-checker/** (agda-meta-checker) and |
| 5 | +# src/abi/** (idris2-abi-ci), and there was no Coq or Lean workflow at all, so |
| 6 | +# regressions in proofs/ landed silently. |
| 7 | +# |
| 8 | +# Toolchains are installed with plain `run:` steps (apt / curl tarballs, matching the |
| 9 | +# idris2 + chapel workflows) rather than marketplace setup actions: a third-party |
| 10 | +# setup action (taiki-e/install-action) reproducibly tripped a startup_failure in this |
| 11 | +# workflow's context, so this workflow uses only actions/checkout plus run steps. |
| 12 | +# `just` stays the single source of truth for the commands (RSR-H14) -- CI installs it |
| 13 | +# and calls the same recipes a developer runs locally. |
| 14 | +name: Dogfood Proof Corpus |
| 15 | + |
| 16 | +on: |
| 17 | + push: |
| 18 | + branches: [main] |
| 19 | + paths: |
| 20 | + - 'proofs/**' |
| 21 | + - 'Justfile' |
| 22 | + - '.github/workflows/dogfood-proofs-ci.yml' |
| 23 | + pull_request: |
| 24 | + branches: [main] |
| 25 | + paths: |
| 26 | + - 'proofs/**' |
| 27 | + - 'Justfile' |
| 28 | + - '.github/workflows/dogfood-proofs-ci.yml' |
| 29 | + workflow_dispatch: |
| 30 | + |
| 31 | +concurrency: |
| 32 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 33 | + cancel-in-progress: true |
| 34 | + |
| 35 | +permissions: |
| 36 | + contents: read |
| 37 | + |
| 38 | +jobs: |
| 39 | + coq: |
| 40 | + name: Coq |
| 41 | + runs-on: ubuntu-latest |
| 42 | + steps: |
| 43 | + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 44 | + |
| 45 | + - name: Install Coq |
| 46 | + run: | |
| 47 | + set -euo pipefail |
| 48 | + sudo apt-get update -qq || sudo apt-get update -qq --fix-missing |
| 49 | + sudo apt-get install -y --fix-missing coq |
| 50 | + coqc --version |
| 51 | +
|
| 52 | + - name: Install just |
| 53 | + run: | |
| 54 | + set -euo pipefail |
| 55 | + curl -fsSL --retry 3 \ |
| 56 | + "https://github.com/casey/just/releases/download/1.51.0/just-1.51.0-x86_64-unknown-linux-musl.tar.gz" \ |
| 57 | + -o /tmp/just.tar.gz |
| 58 | + mkdir -p "$HOME/.local/bin" |
| 59 | + tar xzf /tmp/just.tar.gz -C "$HOME/.local/bin" just |
| 60 | + echo "$HOME/.local/bin" >> "$GITHUB_PATH" |
| 61 | +
|
| 62 | + - name: Type-check Coq corpus |
| 63 | + run: just proofs-coq |
| 64 | + |
| 65 | + lean: |
| 66 | + name: Lean 4 |
| 67 | + runs-on: ubuntu-latest |
| 68 | + steps: |
| 69 | + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 70 | + |
| 71 | + - name: Install elan + Lean toolchain |
| 72 | + run: | |
| 73 | + set -euo pipefail |
| 74 | + # The toolchain version is pinned by proofs/lean/lean-toolchain; lake reads |
| 75 | + # it and fetches that exact Lean on first invocation. |
| 76 | + curl -fsSL --retry 3 \ |
| 77 | + https://raw.githubusercontent.com/leanprover/elan/master/elan-init.sh \ |
| 78 | + -o /tmp/elan-init.sh |
| 79 | + sh /tmp/elan-init.sh -y --default-toolchain none |
| 80 | + echo "$HOME/.elan/bin" >> "$GITHUB_PATH" |
| 81 | +
|
| 82 | + - name: Install just |
| 83 | + run: | |
| 84 | + set -euo pipefail |
| 85 | + curl -fsSL --retry 3 \ |
| 86 | + "https://github.com/casey/just/releases/download/1.51.0/just-1.51.0-x86_64-unknown-linux-musl.tar.gz" \ |
| 87 | + -o /tmp/just.tar.gz |
| 88 | + mkdir -p "$HOME/.local/bin" |
| 89 | + tar xzf /tmp/just.tar.gz -C "$HOME/.local/bin" just |
| 90 | + echo "$HOME/.local/bin" >> "$GITHUB_PATH" |
| 91 | +
|
| 92 | + - name: Build Lean corpus |
| 93 | + run: just proofs-lean |
| 94 | + |
| 95 | + agda: |
| 96 | + name: Agda |
| 97 | + runs-on: ubuntu-latest |
| 98 | + steps: |
| 99 | + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 100 | + |
| 101 | + - name: Install Agda + standard library |
| 102 | + run: | |
| 103 | + set -euo pipefail |
| 104 | + sudo apt-get update -qq |
| 105 | + sudo apt-get install -y agda |
| 106 | + agda --version |
| 107 | + # stdlib from GitHub, pinned to v1.7.3 (the version apt ships for the |
| 108 | + # agda 2.6.3 the corpus is verified against). apt's agda-stdlib is NOT |
| 109 | + # used: `apt --fix-missing` can silently drop it, leaving the library |
| 110 | + # unregistered ("Installed libraries: (none)"). The corpus .agda-lib in |
| 111 | + # proofs/agda is auto-detected from the working dir; this registration |
| 112 | + # resolves its `depend: standard-library`. |
| 113 | + cd /tmp |
| 114 | + curl -fsSL --retry 3 -o agda-stdlib.tar.gz \ |
| 115 | + https://github.com/agda/agda-stdlib/archive/refs/tags/v1.7.3.tar.gz |
| 116 | + tar xzf agda-stdlib.tar.gz |
| 117 | + mkdir -p ~/.agda |
| 118 | + echo "/tmp/agda-stdlib-1.7.3/standard-library.agda-lib" > ~/.agda/libraries |
| 119 | + echo "standard-library" > ~/.agda/defaults |
| 120 | +
|
| 121 | + - name: Install just |
| 122 | + run: | |
| 123 | + set -euo pipefail |
| 124 | + curl -fsSL --retry 3 \ |
| 125 | + "https://github.com/casey/just/releases/download/1.51.0/just-1.51.0-x86_64-unknown-linux-musl.tar.gz" \ |
| 126 | + -o /tmp/just.tar.gz |
| 127 | + mkdir -p "$HOME/.local/bin" |
| 128 | + tar xzf /tmp/just.tar.gz -C "$HOME/.local/bin" just |
| 129 | + echo "$HOME/.local/bin" >> "$GITHUB_PATH" |
| 130 | +
|
| 131 | + - name: Type-check Agda corpus |
| 132 | + run: just proofs-agda |
0 commit comments