Spracherkennung für: .yml vermutete Sprache: SQL {SQL[45] ABAP[38] VHDL[35]} [Methode: maximale Elemente, drei Dimensionen]
name: Daily CI Workflow
# Run scheduled checks
on master
and the current Mathlib bump branch,
then report
to Zulip.
on:
schedule:
- cron:
'0 0 * * *' # Runs at
00:
00 UTC every day
workflow_dispatch:
env:
TESTED_REPO: leanprover-community/mathlib4
GH_REPO: ${{ github.repository }}
# CI uploads the oleans of a `bump
/*` commit to the `forks` container, under the commit.
# `lake exe cache get` reads `master`, then `forks` at the checked-out commit.
# lean-action sets `MATHLIB_CACHE_GET_URL` to the `master` URL when the variable is unset,
# and that URL overrides `MATHLIB_CACHE_FROM`. An empty value makes lean-action unset it.
MATHLIB_CACHE_GET_URL: ''
MATHLIB_CACHE_FROM: master,forks
permissions:
contents: read
actions: read
jobs:
resolve:
name: Resolve the current Mathlib bump branch
runs-on: ubuntu-latest
if: github.repository == 'leanprover-community/mathlib4'
permissions:
actions: read
checks: read
outputs:
bump_ref: ${{ steps.bump.outputs.ref }}
bump_sha: ${{ steps.bump.outputs.sha }}
branch_types: ${{ steps.bump.outputs.branch_types }}
steps:
- name: Resolve branch and commit
id: bump
env:
GH_TOKEN: ${{ github.token }}
run: |
read -r _ ref < <(
git ls-remote --heads https://github.com/leanprover-community/mathlib4.git \
'refs/heads/bump/v4.*.0' | sort -V -k2 | tail -n 1
)
ref=${ref#refs/heads/}
echo "ref=$ref" >> "$GITHUB_OUTPUT"
# Test the newest pushed commit whose build succeeded, so that the cache has its oleans.
for sha in $(gh run list --workflow build.yml --branch "$ref" --event push --limit 10 \
--json headSha --jq '.[].headSha'); do
conclusions=$(gh api "repos/$GH_REPO/commits/$sha/check-runs?check_name=ci%20%2F%20Build" \
--jq '[.check_runs[].conclusion] | join(",")')
if [ "$conclusions" = success ]; then
echo "Testing $ref@$sha"
{
echo "sha=$sha"
echo 'branch_types=["master","bump"]'
} >> "$GITHUB_OUTPUT"
exit 0
fi
done
echo "::warning::No recent commit on $ref has a successful build."
echo 'branch_types=["master"]' >> "$GITHUB_OUTPUT"
notify-resolve:
runs-on: ubuntu-latest
needs: resolve
if: github.repository == 'leanprover-community/mathlib4' && always() &&span> needs.resolve.outputs.bump_sha == ''
steps:
- name: Post skipped bump branch message on Zulip
uses: zulip/github-actions-zulip/send-message@f675f2b4eb2a95fae974215476dcb7ad8dfeff6b # v2.0.2
with:
api-key: ${{ secrets.ZULIP_API_KEY }}
email: 'github-mathlib4-bot@leanprover.zulipchat.com'
organization-url: 'https://leanprover.zulipchat.com'
to: 'nightly-testing-mathlib'
type: 'stream'
topic: 'bump branch'
content: |
⚠️ The daily checks [skipped the bump branch](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}): no recent `bump/v4.*.0` commit with a successful build.
check-leanchecker:
runs-on: ubuntu-latest
needs: resolve
if: github.repository == 'leanprover-community/mathlib4' && !cancelled()
strategy:
fail-fast: false
matrix:
branch_type: ${{ fromJSON(needs.resolve.outputs.branch_types || '["master"]') }}
env:
BRANCH_REF: ${{ matrix.branch_type == 'master' && 'master' || needs.resolve.outputs.bump_ref }}
TESTED_SHA: ${{ matrix.branch_type == 'master' && github.sha || needs.resolve.outputs.bump_sha }}
steps:
- name: Checkout the tested commit
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ env.TESTED_SHA }}
- name: Configure Lean
uses: leanprover/lean-action@fe408643ea7367d8c0404a8be3975bb145f5fb64 # v1.7.0
with:
auto-config: false
use-github-cache: false
use-mathlib-cache: true
reinstall-transient-toolchain: true
- name: Check environments using leanchecker # make sure this name is consistent with "Get job status and URLs" in the notify job
id: leanchecker
run: |
# `--fresh` is safe and in fact currently faster for projects with many modules
lake env leanchecker --fresh Mathlib
lake env leanchecker --fresh Batteries
notify-leanchecker:
runs-on: ubuntu-latest
needs: [resolve, check-leanchecker]
if: github.repository == 'leanprover-community/mathlib4' && always()
strategy:
fail-fast: false
matrix:
branch_type: ${{ fromJSON(needs.resolve.outputs.branch_types || '["master"]') }}
env:
BRANCH_REF: ${{ matrix.branch_type == 'master' && 'master' || needs.resolve.outputs.bump_ref }}
TESTED_SHA: ${{ matrix.branch_type == 'master' && github.sha || needs.resolve.outputs.bump_sha }}
steps:
- name: Get job status and URLs
id: get-status
env:
GH_TOKEN: ${{ github.token }}
run: |
JOB_NAME="check-leanchecker (${{ matrix.branch_type }})"
# Get URL and conclusion for the specific job
JOB_DATA=$(gh run view ${{ github.run_id }} --json jobs --jq \
".jobs[] | select(.name == \"$JOB_NAME\")")
LEANCHECKER_URL=$(echo "$JOB_DATA" | jq -r \
'(.url + (.steps[] | select(.name == "Check environments using leanchecker")
| "#step:\(.number):1"))')
JOB_CONCLUSION=$(echo "$JOB_DATA" | jq -r '.conclusion')
echo "leanchecker_url=${LEANCHECKER_URL}" | tee -a "$GITHUB_OUTPUT"
echo "job_conclusion=${JOB_CONCLUSION}" | tee -a "$GITHUB_OUTPUT"
- name: Post success message for leanchecker on Zulip
if: steps.get-status.outputs.job_conclusion == 'success'
uses: zulip/github-actions-zulip/send-message@f675f2b4eb2a95fae974215476dcb7ad8dfeff6b # v2.0.2
with:
api-key: ${{ secrets.ZULIP_API_KEY }}
email: 'github-mathlib4-bot@leanprover.zulipchat.com'
organization-url: 'https://leanprover.zulipchat.com'
to: 'nightly-testing-mathlib'
type: 'stream'
topic: 'leanchecker'
content: |
✅ leanchecker [succeeded](${{ steps.get-status.outputs.leanchecker_url }}) on ${{ env.TESTED_REPO }}@${{ env.TESTED_SHA }} (ref: ${{ env.BRANCH_REF }})
- name: Post failure / cancelled message for leanchecker on Zulip
if: steps.get-status.outputs.job_conclusion != 'success'
uses: zulip/github-actions-zulip/send-message@f675f2b4eb2a95fae974215476dcb7ad8dfeff6b # v2.0.2
with:
api-key: ${{ secrets.ZULIP_API_KEY }}
email: 'github-mathlib4-bot@leanprover.zulipchat.com'
organization-url: 'https://leanprover.zulipchat.com'
to: 'nightly-testing-mathlib'
type: 'stream'
topic: 'leanchecker failure'
content: |
❌ leanchecker [${{ steps.get-status.outputs.job_conclusion }}](${{ steps.get-status.outputs.leanchecker_url }}) on ${{ env.TESTED_REPO }}@${{ env.TESTED_SHA }} (ref: ${{ env.BRANCH_REF }})${{ matrix.branch_type == 'bump' && '. Fixes to the bump branch go through [downstream-lean4](https://github.com/leanprover/downstream-lean4).' || '' }}
check-aesop:
runs-on: ubuntu-latest
needs: resolve
if: github.repository == 'leanprover-community/mathlib4' && !cancelled()
strategy:
fail-fast: false
matrix:
branch_type: ${{ fromJSON(needs.resolve.outputs.branch_types || '["master"]') }}
env:
BRANCH_REF: ${{ matrix.branch_type == 'master' && 'master' || needs.resolve.outputs.bump_ref }}
TESTED_SHA: ${{ matrix.branch_type == 'master' && github.sha || needs.resolve.outputs.bump_sha }}
steps:
- name: Checkout the tested commit
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ env.TESTED_SHA }}
- name: Configure Lean
uses: leanprover/lean-action@fe408643ea7367d8c0404a8be3975bb145f5fb64 # v1.7.0
with:
auto-config: false
use-github-cache: false
use-mathlib-cache: true
reinstall-transient-toolchain: true
- name: Build AesopTest # make sure this name is consistent with "Get job status and URLs" in the notify job
id: aesop
run: |
lake build AesopTest
notify-aesop:
runs-on: ubuntu-latest
needs: [resolve, check-aesop]
if: github.repository == 'leanprover-community/mathlib4' && always()
strategy:
fail-fast: false
matrix:
branch_type: ${{ fromJSON(needs.resolve.outputs.branch_types || '["master"]') }}
env:
BRANCH_REF: ${{ matrix.branch_type == 'master' && 'master' || needs.resolve.outputs.bump_ref }}
TESTED_SHA: ${{ matrix.branch_type == 'master' && github.sha || needs.resolve.outputs.bump_sha }}
steps:
- name: Get job status and URLs
id: get-status
env:
GH_TOKEN: ${{ github.token }}
run: |
JOB_NAME="check-aesop (${{ matrix.branch_type }})"
# Get URL and conclusion for the specific job
JOB_DATA=$(gh run view ${{ github.run_id }} --json jobs --jq \
".jobs[] | select(.name == \"$JOB_NAME\")")
AESOP_URL=$(echo "$JOB_DATA" | jq -r \
'(.url + (.steps[] | select(.name == "Build AesopTest")
| "#step:\(.number):1"))')
JOB_CONCLUSION=$(echo "$JOB_DATA" | jq -r '.conclusion')
echo "aesop_url=${AESOP_URL}" | tee -a "$GITHUB_OUTPUT"
echo "job_conclusion=${JOB_CONCLUSION}" | tee -a "$GITHUB_OUTPUT"
- name: Post success message for AesopTest on Zulip
if: steps.get-status.outputs.job_conclusion == 'success'
uses: zulip/github-actions-zulip/send-message@f675f2b4eb2a95fae974215476dcb7ad8dfeff6b # v2.0.2
with:
api-key: ${{ secrets.ZULIP_API_KEY }}
email: 'github-mathlib4-bot@leanprover.zulipchat.com'
organization-url: 'https://leanprover.zulipchat.com'
to: 'nightly-testing-mathlib'
type: 'stream'
topic: 'AesopTest'
content: |
✅ AesopTest [succeeded](${{ steps.get-status.outputs.aesop_url }}) on ${{ env.TESTED_REPO }}@${{ env.TESTED_SHA }} (ref: ${{ env.BRANCH_REF }})
- name: Post failure / cancelled message for AesopTest on Zulip
if: steps.get-status.outputs.job_conclusion != 'success'
uses: zulip/github-actions-zulip/send-message@f675f2b4eb2a95fae974215476dcb7ad8dfeff6b # v2.0.2
with:
api-key: ${{ secrets.ZULIP_API_KEY }}
email: 'github-mathlib4-bot@leanprover.zulipchat.com'
organization-url: 'https://leanprover.zulipchat.com'
to: 'nightly-testing-mathlib'
type: 'stream'
topic: 'AesopTest failure'
content: |
❌ AesopTest [${{ steps.get-status.outputs.job_conclusion }}](${{ steps.get-status.outputs.aesop_url }}) on ${{ env.TESTED_REPO }}@${{ env.TESTED_SHA }} (ref: ${{ env.BRANCH_REF }})${{ matrix.branch_type == 'bump' && '. Fixes to the bump branch go through [downstream-lean4](https://github.com/leanprover/downstream-lean4).' || '' }}
check-mathlib_test_executable:
runs-on: ubuntu-latest
needs: resolve
if: github.repository == 'leanprover-community/mathlib4' && !cancelled()
strategy:
fail-fast: false
matrix:
branch_type: ${{ fromJSON(needs.resolve.outputs.branch_types || '["master"]') }}
env:
BRANCH_REF: ${{ matrix.branch_type == 'master' && 'master' || needs.resolve.outputs.bump_ref }}
TESTED_SHA: ${{ matrix.branch_type == 'master' && github.sha || needs.resolve.outputs.bump_sha }}
steps:
- name: Checkout the tested commit
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ env.TESTED_SHA }}
- name: Configure Lean
uses: leanprover/lean-action@fe408643ea7367d8c0404a8be3975bb145f5fb64 # v1.7.0
with:
auto-config: false
use-github-cache: false
use-mathlib-cache: true
reinstall-transient-toolchain: true
- name: Run mathlib_test_executable # make sure this name is consistent with "Get job status and URLs" in the notify job
id: mathlib-test
run: |
lake exe mathlib_test_executable
notify-mathlib_test_executable:
runs-on: ubuntu-latest
needs: [resolve, check-mathlib_test_executable]
if: github.repository == 'leanprover-community/mathlib4' && always()
strategy:
fail-fast: false
matrix:
branch_type: ${{ fromJSON(needs.resolve.outputs.branch_types || '["master"]') }}
env:
BRANCH_REF: ${{ matrix.branch_type == 'master' && 'master' || needs.resolve.outputs.bump_ref }}
TESTED_SHA: ${{ matrix.branch_type == 'master' && github.sha || needs.resolve.outputs.bump_sha }}
steps:
- name: Get job status and URLs
id: get-status
env:
GH_TOKEN: ${{ github.token }}
run: |
JOB_NAME="check-mathlib_test_executable (${{ matrix.branch_type }})"
# Get URL and conclusion for the specific job
JOB_DATA=$(gh run view ${{ github.run_id }} --json jobs --jq \
".jobs[] | select(.name == \"$JOB_NAME\")")
MATHLIB_TEST_EXECUTABLE_URL=$(echo "$JOB_DATA" | jq -r \
'(.url + (.steps[] | select(.name == "Run mathlib_test_executable")
| "#step:\(.number):1"))')
JOB_CONCLUSION=$(echo "$JOB_DATA" | jq -r '.conclusion')
echo "mathlib_test_executable_url=${MATHLIB_TEST_EXECUTABLE_URL}" | tee -a "$GITHUB_OUTPUT"
echo "job_conclusion=${JOB_CONCLUSION}" | tee -a "$GITHUB_OUTPUT"
- name: Post success message for mathlib_test_executable on Zulip
if: steps.get-status.outputs.job_conclusion == 'success'
uses: zulip/github-actions-zulip/send-message@f675f2b4eb2a95fae974215476dcb7ad8dfeff6b # v2.0.2
with:
api-key: ${{ secrets.ZULIP_API_KEY }}
email: 'github-mathlib4-bot@leanprover.zulipchat.com'
organization-url: 'https://leanprover.zulipchat.com'
to: 'nightly-testing-mathlib'
type: 'stream'
topic: 'mathlib test executable'
content: |
✅ mathlib_test_executable [succeeded](${{ steps.get-status.outputs.mathlib_test_executable_url }}) on ${{ env.TESTED_REPO }}@${{ env.TESTED_SHA }} (ref: ${{ env.BRANCH_REF }})
- name: Post failure / cancelled message for mathlib_test_executable on Zulip
if: steps.get-status.outputs.job_conclusion != 'success'
uses: zulip/github-actions-zulip/send-message@f675f2b4eb2a95fae974215476dcb7ad8dfeff6b # v2.0.2
with:
api-key: ${{ secrets.ZULIP_API_KEY }}
email: 'github-mathlib4-bot@leanprover.zulipchat.com'
organization-url: 'https://leanprover.zulipchat.com'
to: 'nightly-testing-mathlib'
type: 'stream'
topic: 'mathlib test executable failure'
content: |
❌ mathlib_test_executable [${{ steps.get-status.outputs.job_conclusion }}](${{ steps.get-status.outputs.mathlib_test_executable_url }}) on ${{ env.TESTED_REPO }}@${{ env.TESTED_SHA }} (ref: ${{ env.BRANCH_REF }})${{ matrix.branch_type == 'bump' && '. Fixes to the bump branch go through [downstream-lean4](https://github.com/leanprover/downstream-lean4).' || '' }}
check-nanoda:
runs-on: ubuntu-latest
needs: resolve
if: github.repository == 'leanprover-community/mathlib4' && !cancelled()
strategy:
fail-fast: false
matrix:
branch_type: ${{ fromJSON(needs.resolve.outputs.branch_types || '["master"]') }}
env:
BRANCH_REF: ${{ matrix.branch_type == 'master' && 'master' || needs.resolve.outputs.bump_ref }}
TESTED_SHA: ${{ matrix.branch_type == 'master' && github.sha || needs.resolve.outputs.bump_sha }}
steps:
- name: Checkout the tested commit
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ env.TESTED_SHA }}
- name: Configure Lean
uses: leanprover/lean-action@fe408643ea7367d8c0404a8be3975bb145f5fb64 # v1.7.0
with:
auto-config: false
use-github-cache: false
use-mathlib-cache: true
reinstall-transient-toolchain: true
- name: Install Rust
uses: dtolnay/rust-toolchain@631a55b12751854ce901bb631d5902ceb48146f7 # stable
- name: Check Mathlib using nanoda # make sure this name is consistent with "Get job status and URLs" in the notify job
id: nanoda
run: |
# Clone and build lean4export
git clone https://github.com/leanprover/lean4export
cd lean4export
# Match toolchain to mathlib
cp ../lean-toolchain .
lake build
cd ..
# Clone and build nanoda_lib
git clone https://github.com/ammkrn/nanoda_lib
cd nanoda_lib
cargo build --release
cd ..
# Export Mathlib
lake env lean4export/.lake/build/bin/lean4export Mathlib > mathlib_export.txt
# Create config
cat > nanoda_config.json << 'EOF'
{
"export_file_path": "mathlib_export.txt",
"permitted_axioms": [
"propext",
"Classical.choice",
"Quot.sound",
"Lean.trustCompiler"
],
"unpermitted_axiom_hard_error": false,
"nat_extension": true,
"string_extension": true,
"print_success_message": true
}
EOF
# Run nanoda
nanoda_lib/target/release/nanoda_bin nanoda_config.json
notify-nanoda:
runs-on: ubuntu-latest
needs: [resolve, check-nanoda]
if: github.repository == 'leanprover-community/mathlib4' && always()
strategy:
fail-fast: false
matrix:
branch_type: ${{ fromJSON(needs.resolve.outputs.branch_types || '["master"]') }}
env:
BRANCH_REF: ${{ matrix.branch_type == 'master' && 'master' || needs.resolve.outputs.bump_ref }}
TESTED_SHA: ${{ matrix.branch_type == 'master' && github.sha || needs.resolve.outputs.bump_sha }}
steps:
- name: Get job status and URLs
id: get-status
env:
GH_TOKEN: ${{ github.token }}
run: |
JOB_NAME="check-nanoda (${{ matrix.branch_type }})"
# Get URL and conclusion for the specific job
JOB_DATA=$(gh run view ${{ github.run_id }} --json jobs --jq \
".jobs[] | select(.name == \"$JOB_NAME\")")
NANODA_URL=$(echo "$JOB_DATA" | jq -r \
'(.url + (.steps[] | select(.name == "Check Mathlib using nanoda")
| "#step:\(.number):1"))')
JOB_CONCLUSION=$(echo "$JOB_DATA" | jq -r '.conclusion')
echo "nanoda_url=${NANODA_URL}" | tee -a "$GITHUB_OUTPUT"
echo "job_conclusion=${JOB_CONCLUSION}" | tee -a "$GITHUB_OUTPUT"
- name: Post success message for nanoda on Zulip
if: steps.get-status.outputs.job_conclusion == 'success'
uses: zulip/github-actions-zulip/send-message@f675f2b4eb2a95fae974215476dcb7ad8dfeff6b # v2.0.2
with:
api-key: ${{ secrets.ZULIP_API_KEY }}
email: 'github-mathlib4-bot@leanprover.zulipchat.com'
organization-url: 'https://leanprover.zulipchat.com'
to: 'nightly-testing-mathlib'
type: 'stream'
topic: 'nanoda'
content: |
✅ nanoda [succeeded](${{ steps.get-status.outputs.nanoda_url }}) on ${{ env.TESTED_REPO }}@${{ env.TESTED_SHA }} (ref: ${{ env.BRANCH_REF }})
- name: Post failure / cancelled message for nanoda on Zulip
if: steps.get-status.outputs.job_conclusion != 'success'
uses: zulip/github-actions-zulip/send-message@f675f2b4eb2a95fae974215476dcb7ad8dfeff6b # v2.0.2
with:
api-key: ${{ secrets.ZULIP_API_KEY }}
email: 'github-mathlib4-bot@leanprover.zulipchat.com'
organization-url: 'https://leanprover.zulipchat.com'
to: 'nightly-testing-mathlib'
type: 'stream'
topic: 'nanoda failure'
content: |
❌ nanoda [${{ steps.get-status.outputs.job_conclusion }}](${{ steps.get-status.outputs.nanoda_url }}) on ${{ env.TESTED_REPO }}@${{ env.TESTED_SHA }} (ref: ${{ env.BRANCH_REF }})${{ matrix.branch_type == 'bump' && '. Fixes to the bump branch go through [downstream-lean4](https://github.com/leanprover/downstream-lean4).' || '' }}
[Verzeichnis aufwärts0.35unsichere VerbindungÜbersetzung europäischer Sprachen durch Browser2026-11-18]