- Correct stale references and headline-path wording in READMEs and Lean docstrings - Document build steps, comparator requirements, sweep scope, and coverage - Unify Apache headers across Lean and C++ sources - Add a bwrap-free axiom audit for the headline theorems - Add a Gitea workflow running lake build, the axiom audit, C++ tests, and coverage - Match LLVM coverage tool versions to the compiler and recreate stale build dirs
79 lines
2.5 KiB
YAML
79 lines
2.5 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: ["main"]
|
|
pull_request:
|
|
branches: ["main"]
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build-and-check:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 120
|
|
steps:
|
|
- name: Check out
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install Lean toolchain
|
|
run: |
|
|
curl -sSfL https://raw.githubusercontent.com/leanprover/elan/master/elan-init.sh \
|
|
| sh -s -- -y --default-toolchain none
|
|
echo "$HOME/.elan/bin" >> "$GITHUB_PATH"
|
|
|
|
# Mathlib is pinned in `lake-manifest.json`; the cache supplies its
|
|
# prebuilt `.olean` files so the job only compiles this project.
|
|
- name: Cache Lake packages and build artifacts
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
.lake
|
|
~/.elan
|
|
key: lake-${{ runner.os }}-${{ hashFiles('lean-toolchain', 'lake-manifest.json', 'lakefile.toml') }}
|
|
restore-keys: |
|
|
lake-${{ runner.os }}-
|
|
|
|
- name: Fetch Mathlib cache
|
|
run: lake exe cache get
|
|
|
|
- name: Build Lean
|
|
run: lake build
|
|
|
|
# bwrap-free replacement for the comparator's axiom check; catches
|
|
# `sorryAx` and any newly introduced axiom in the headline theorems.
|
|
- name: Check axioms
|
|
run: ./scripts/check-axioms.sh
|
|
|
|
- name: Install C++ toolchain
|
|
run: |
|
|
if command -v sudo >/dev/null 2>&1; then SUDO=sudo; else SUDO=; fi
|
|
$SUDO apt-get update
|
|
$SUDO apt-get install -y clang cmake ninja-build
|
|
clang_major="$(clang++ -dumpversion | cut -d. -f1)"
|
|
$SUDO apt-get install -y "llvm-${clang_major}"
|
|
|
|
- name: Configure and build C++
|
|
run: |
|
|
cmake -S cpp -B cpp/build -G Ninja \
|
|
-DCMAKE_CXX_COMPILER=clang++ \
|
|
-DCR_BUILD_FUZZERS=OFF \
|
|
-DCR_BUILD_BENCH=OFF
|
|
cmake --build cpp/build
|
|
|
|
# `golden_test` and `diff_corpus` read vectors generated by the actual
|
|
# Lean `Statement.closedForm`; the file is gitignored.
|
|
- name: Generate golden vectors
|
|
run: lake env lean --run cpp/oracle/gen.lean > cpp/oracle/golden.txt
|
|
|
|
- name: Run C++ tests
|
|
run: |
|
|
cpp/build/golden_test cpp/oracle/golden.txt
|
|
cpp/build/diff_corpus cpp/oracle/golden.txt
|
|
cpp/build/extreme_test
|
|
cpp/build/exhaustive_test
|
|
|
|
- name: Check C++ coverage
|
|
run: |
|
|
CXX="clang++-$(clang++ -dumpversion | cut -d. -f1)" \
|
|
./cpp/run-coverage.sh
|