Skip to content

Lean Action CI

Lean Action CI #13718

Workflow file for this run

name: Lean Action CI
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
merge_group:
jobs:
check-orphan-modules:
name: Check orphan Lean modules
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up Python 3.13
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: 3.13
- name: Check that every Lean module is built
run: ./Tools/check-orphan-modules
build:
runs-on: ubuntu-latest
strategy:
# A debug failure should not cancel the release run, and vice versa:
# knowing which of the two broke is the point of running both.
fail-fast: false
matrix:
buildType: [release, debug]
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
# `buildType` is a lakefile field with no command-line override, so the
# debug run edits it in place. The `grep` is not redundant: if the field
# is ever reworded the substitution would quietly match nothing and this
# job would silently become a second release build.
- name: Select the debug build type
if: matrix.buildType == 'debug'
run: |
sed -i 's/^buildType = "release"$/buildType = "debug"/' lakefile.toml
grep -qx 'buildType = "debug"' lakefile.toml
- name: Source environment variables
run: source .envrc
- name: Add LLVM apt repository
uses: gerlero/add-apt-repository@397d907a67c29d276af289f5e9574375b8fc7481 # v1.1.0
with:
uri: http://apt.llvm.org/noble/
key: https://apt.llvm.org/llvm-snapshot.gpg.key
component: main
suite: llvm-toolchain-noble-23
- name: Install mlir-opt
uses: gerlero/apt-install@c0fa73fe5c4a22deecf6d629565be92a15dd2026 # v1.3.12
with:
packages: mlir-23-tools
- name: Rename MLIR-opt
run: |
sudo ln -s /usr/bin/mlir-opt-23 /usr/bin/mlir-opt
- name: Build the project
uses: leanprover/lean-action@50fcf42d2e460296f1a34b402e990d1b24f8b596 # v1.6.0
with:
build-args: "--iofail"
test: false
- name: Run unit tests
uses: leanprover/lean-action@50fcf42d2e460296f1a34b402e990d1b24f8b596 # v1.6.0
with:
test-args: "--iofail"
test: true
- name: Install uv
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Set up Python 3.13
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: 3.13
- name: Install Python dependencies
run: uv sync
- name: Run filecheck tests
run: uv run lit Test/ -v
- name: Build the ExArray package
uses: leanprover/lean-action@50fcf42d2e460296f1a34b402e990d1b24f8b596 # v1.6.0
with:
lake-package-directory: "ExArray"
- name: Run the ExArray test binary
run: |
pushd ExArray
lake exe test
popd