Skip to content
Open
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
9 changes: 5 additions & 4 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
Documents the various GitHub Actions workflows, the role they fulfill and 3rd party (i.e. outside of https://github.com/actions/) dependencies if any.

All jobs run on 1ES hosted pools targeted by pool name only, for example `runs-on: [gha-vmss-d16av7-ci]`.
Jobs that build or run CCF use 1ES hosted pools targeted by pool name only, for example `runs-on: [gha-vmss-d16av7-ci]`.
Lightweight jobs that do not, such as the Lean package checks and trace replays, use GitHub-hosted runners.

# Shared actions

Expand Down Expand Up @@ -139,8 +140,8 @@ File: `codeql-analysis.yml`

Runs Lean verification for the repository, with each package checked in an isolated reusable-workflow job.
All five packages (consensus, common, consistency, disaster-recovery, and kv) run in one matrix.
Package checks use the `gha-vmss-d16av7-ci` pool and trace replays use `gha-vmss-d16av7-ci-b`, both in Ubuntu 26.04 containers.
Native trace captures remain on `gha-vmss-d16av7-ci-c` with Azure Linux containers, and the lightweight final gate uses GitHub-hosted Ubuntu.
Package checks and trace replays run directly on GitHub-hosted Ubuntu 26.04 runners, as does the lightweight final gate.
Native trace captures build CCF, so they remain on `gha-vmss-d16av7-ci-c` with Azure Linux containers.
Each matrix job caches its third-party dependency checkouts and build outputs, leanfmt and (for disaster-recovery and kv) Batteries, using GitHub Actions caching.
Caches are isolated by package and runner architecture and invalidated by changes to the Ubuntu version, Lean toolchain, package and common dependency manifests/configuration, or reusable workflow.
CCF package and common build outputs are not cached, and all verification steps still run.
Expand Down Expand Up @@ -186,7 +187,7 @@ File: `lean.yml`

Proves that the local replacements for Mathlib definitions in `lean/common` (`CCF.Seq`, `CCF.Finset` and `CCF.Function`) and the consensus successor ranking are equivalent to the Mathlib definitions they replaced.
The proofs live in the separate `lean/mathlib-equivalence` package, which is the only Lean package that depends on Mathlib; the main Lean workflow does not schedule it.
The job restores Mathlib's upstream build cache, runs `lake check --inadvisably-no-sandbox` to build the proofs and replay them through the kernel with only the standard axioms, and checks the package's formatting.
The job runs on a GitHub-hosted Ubuntu 26.04 runner, restores Mathlib's upstream build cache, runs `lake check --inadvisably-no-sandbox` to build the proofs and replay them through the kernel with only the standard axioms, and checks the package's formatting.
It caches third-party dependency checkouts and build outputs like the main Lean package jobs.
The workflow runs only on pull requests that change the replacement definitions, the equivalence package, the Lean toolchain, the formatter script, or the workflow, and can be run manually.

Expand Down
16 changes: 5 additions & 11 deletions .github/workflows/lean-mathlib-equivalence.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,38 +25,32 @@ permissions:
jobs:
equivalence:
name: Prove equivalence with Mathlib
runs-on: [gha-vmss-d16av7-ci]
container:
image: ubuntu:26.04
options: --user root
runs-on: ubuntu-26.04
timeout-minutes: 90
defaults:
run:
shell: bash

steps:
- name: Install container prerequisites
- name: Install prerequisites
run: |
set -euo pipefail
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get install -y \
ca-certificates git curl tar zstd build-essential libgmp-dev elan
echo "ELAN_HOME=$RUNNER_TEMP/elan" >> "$GITHUB_ENV"
sudo apt-get update
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y elan

- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- name: Install Lean
run: |
set -euo pipefail
git config --global --add safe.directory "$GITHUB_WORKSPACE"
echo "TMPDIR=$RUNNER_TEMP" >> "$GITHUB_ENV"
elan run --install "$(cat lean/lean-toolchain)" lean --version

- name: Restore dependency builds
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: lean/mathlib-equivalence/.lake/packages
key: lean-deps-v2-vmss-ubuntu-26.04-${{ runner.arch }}-mathlib-equivalence-${{ hashFiles('lean/lean-toolchain', 'lean/mathlib-equivalence/lake-manifest.json', 'lean/mathlib-equivalence/lakefile.toml', 'lean/common/lake-manifest.json', 'lean/common/lakefile.toml', 'lean/consensus/lake-manifest.json', 'lean/consensus/lakefile.toml', '.github/workflows/lean-mathlib-equivalence.yml') }}
key: lean-deps-v3-ubuntu-26.04-${{ runner.arch }}-mathlib-equivalence-${{ hashFiles('lean/lean-toolchain', 'lean/mathlib-equivalence/lake-manifest.json', 'lean/mathlib-equivalence/lakefile.toml', 'lean/common/lake-manifest.json', 'lean/common/lakefile.toml', 'lean/consensus/lake-manifest.json', 'lean/consensus/lakefile.toml', '.github/workflows/lean-mathlib-equivalence.yml') }}

- name: Restore Mathlib cache
working-directory: lean/mathlib-equivalence
Expand Down
17 changes: 5 additions & 12 deletions .github/workflows/lean-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@ permissions:
jobs:
check:
name: Check ${{ inputs.package }}
runs-on: [gha-vmss-d16av7-ci]
container:
image: ubuntu:26.04
options: --user root
runs-on: ubuntu-26.04
timeout-minutes: 90
defaults:
run:
Expand All @@ -26,14 +23,11 @@ jobs:
PACKAGE: ${{ inputs.package }}

steps:
- name: Install container prerequisites
- name: Install prerequisites
run: |
set -euo pipefail
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get install -y \
ca-certificates git curl tar zstd build-essential libgmp-dev \
elan python3-jsonschema jq
echo "ELAN_HOME=$RUNNER_TEMP/elan" >> "$GITHUB_ENV"
sudo apt-get update
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y elan python3-jsonschema

- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

Expand All @@ -48,7 +42,6 @@ jobs:
;;
esac
test -f "lean/$PACKAGE/lakefile.toml"
git config --global --add safe.directory "$GITHUB_WORKSPACE"
echo "TMPDIR=$RUNNER_TEMP" >> "$GITHUB_ENV"

- name: Install Lean and check prerequisites
Expand All @@ -60,7 +53,7 @@ jobs:
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: lean/${{ inputs.package }}/.lake/packages
key: lean-deps-v2-vmss-ubuntu-26.04-${{ runner.arch }}-${{ inputs.package }}-${{ hashFiles('lean/lean-toolchain', format('lean/{0}/lake-manifest.json', inputs.package), format('lean/{0}/lakefile.toml', inputs.package), 'lean/common/lake-manifest.json', 'lean/common/lakefile.toml', '.github/workflows/lean-package.yml') }}
key: lean-deps-v3-ubuntu-26.04-${{ runner.arch }}-${{ inputs.package }}-${{ hashFiles('lean/lean-toolchain', format('lean/{0}/lake-manifest.json', inputs.package), format('lean/{0}/lakefile.toml', inputs.package), 'lean/common/lake-manifest.json', 'lean/common/lakefile.toml', '.github/workflows/lean-package.yml') }}

- name: Build, kernel and axiom check
working-directory: lean/${{ inputs.package }}
Expand Down
42 changes: 12 additions & 30 deletions .github/workflows/lean.yml
Original file line number Diff line number Diff line change
Expand Up @@ -214,10 +214,7 @@ jobs:
cft_replay:
name: Replay native CCF consensus traces
needs: [cft_traces]
runs-on: [gha-vmss-d16av7-ci-b]
container:
image: ubuntu:26.04
options: --user root
runs-on: ubuntu-26.04
timeout-minutes: 30
permissions:
contents: read
Expand All @@ -226,20 +223,17 @@ jobs:
shell: bash

steps:
- name: Install container prerequisites
- name: Install prerequisites
run: |
set -euo pipefail
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get install -y \
ca-certificates git curl tar zstd build-essential libgmp-dev elan
echo "ELAN_HOME=$RUNNER_TEMP/elan" >> "$GITHUB_ENV"
sudo apt-get update
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y elan

- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- name: Install Lean
run: |
set -euo pipefail
git config --global --add safe.directory "$GITHUB_WORKSPACE"
elan run --install "$(cat lean/lean-toolchain)" lean --version

- name: Build CCF consensus replay
Expand Down Expand Up @@ -332,10 +326,7 @@ jobs:
kv_replay:
name: Replay KV traces
needs: [kv_traces]
runs-on: [gha-vmss-d16av7-ci-b]
container:
image: ubuntu:26.04
options: --user root
runs-on: ubuntu-26.04
timeout-minutes: 30
permissions:
contents: read
Expand All @@ -344,20 +335,17 @@ jobs:
shell: bash

steps:
- name: Install container prerequisites
- name: Install prerequisites
run: |
set -euo pipefail
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get install -y \
ca-certificates git curl tar zstd build-essential libgmp-dev elan
echo "ELAN_HOME=$RUNNER_TEMP/elan" >> "$GITHUB_ENV"
sudo apt-get update
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y elan

- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- name: Install Lean
run: |
set -euo pipefail
git config --global --add safe.directory "$GITHUB_WORKSPACE"
elan run --install "$(cat lean/lean-toolchain)" lean --version

- name: Build KV replay
Expand Down Expand Up @@ -385,10 +373,7 @@ jobs:
consistency_replay:
name: Replay consistency traces
needs: [consistency_traces]
runs-on: [gha-vmss-d16av7-ci-b]
container:
image: ubuntu:26.04
options: --user root
runs-on: ubuntu-26.04
timeout-minutes: 30
permissions:
contents: read
Expand All @@ -397,20 +382,17 @@ jobs:
shell: bash

steps:
- name: Install container prerequisites
- name: Install prerequisites
run: |
set -euo pipefail
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get install -y \
ca-certificates git curl tar zstd build-essential libgmp-dev elan
echo "ELAN_HOME=$RUNNER_TEMP/elan" >> "$GITHUB_ENV"
sudo apt-get update
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y elan

- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- name: Install Lean
run: |
set -euo pipefail
git config --global --add safe.directory "$GITHUB_WORKSPACE"
elan run --install "$(cat lean/lean-toolchain)" lean --version

- name: Build consistency replay
Expand Down