Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/Lean/Mathlib/.github/workflows/     Datei vom 15.10.2026 mit Größe 4 kB image not shown  

Quelle  cache_test.yml  Sprache: unbekannt

 
Spracherkennung für: .yml vermutete Sprache: MT940 {MT940[43] Apollo[38] Postscript[38]} [Methode: maximale Elemente, drei Dimensionen]

# Checks the cache tool for PRs that touch the cache code.
#
# `cache-test` runs the unit tests (`lake exe cache-test`) on Linux and Windows.
# The suite is deliberately network-free (see the module docstring in
# `Cache/Test.lean`), so the job needs only the toolchain and the package
# dependencies' sources, not a Mathlib build, and finishes in a few minutes on
# a hosted runner. The Windows job guards the tool'
s cross-platform behavior,
# such as the null device the marker probe and tests discard output to.
#
# `cache-get` runs one `lake exe cache get` against the public cache on Ubuntu
# 26.04, whose curl 8.18 the tool runs without retries, and on Windows. The
# main CI runs the tool on neither.
name: cache tests

on:
  pull_request:
    paths:
      - 'Cache/**'
      # The `cache-test` target and the toolchain it compiles under live here;
      # a bump can break the tool's compilation even with `Cache/` untouched.
      - 'lakefile.lean'

      - 'lean-toolchain'
      # Re-run when the workflow itself changes.
      - '.github/workflows/cache_test.yml'

concurrency:
  group: cache-test-${{ github.ref }}
  cancel-in-progress: true

permissions:
  contents: read

jobs:
  cache-test:
    if: github.repository == 'leanprover-community/mathlib4'
    strategy:
      # Report both platforms even if one fails, so a Windows-only break is
      # never hidden by a Linux failure (or vice versa).
      fail-fast: false
      matrix:
        os: [ubuntu-latest, windows-latest]
    runs-on: ${{ matrix.os }}
    # `leanprover/lean-action` installs elan from a bash step and adds it to the
    # path in that shell's form, so the `lake` steps below must also run under
    # bash (available on Windows runners as Git Bash) to find it.
    defaults:
      run:
        shell: bash
    steps:
      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

      # Install elan and the toolchain cross-platform. Build/test/lint, the
      # Mathlib cache, and the GitHub cache are all disabled, so this is a
      # toolchain-only setup; the `lake` steps below then build and run just the
      # `cache-test` target. (The GitHub cache cannot be written from fork PRs
      # and buys little for this small build, so it stays off.)
      - uses: leanprover/lean-action@fe408643ea7367d8c0404a8be3975bb145f5fb64 # v1.7.0
        with:
          auto-config: "false"
          build: "false"
          test: "false"
          lint: "false"
          use-mathlib-cache: "false"
          use-github-cache: "false"

      - name: build cache-test
        run: lake build cache-test

      - name: run cache tests
        run: lake exe cache-test

  # Ubuntu 26.04 ships curl 8.18, which hangs on parallel retries, so on
  # Linux this job covers the tool'
s retry-free parallel mode. On Windows it
  # covers the download path with the system curl. Reads need no credential.
  # The tool exits 1 on a transfer or decompression failure and 0 on cache
  # misses, so a PR whose files are not in the cache (a toolchain bump, for
  # example) passes.
  cache-get:
    if: github.repository == 'leanprover-community/mathlib4'
    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-26.04, windows-latest]
    runs-on: ${{ matrix.os }}
    timeout-minutes: 15
    defaults:
      run:
        shell: bash
    steps:
      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

      - uses: leanprover/lean-action@fe408643ea7367d8c0404a8be3975bb145f5fb64 # v1.7.0
        with:
          auto-config: "false"
          build: "false"
          test: "false"
          lint: "false"
          use-mathlib-cache: "false"
          use-github-cache: "false"

      - name: build cache
        run: lake build cache

      - name: cache get
        run: |
          curl --version | head -n 1
          lake exe cache get Mathlib.Data.Nat.Basic | tee cache-get.log

      # This check holds only while the runner's curl is 8.18 or 8.19. If it
      # fails after a runner image update, move the job to a runner whose curl
      # the tool runs without retries.
      - name: check that the tool ran without curl retries
        if: runner.os == '
Linux'
        run: grep "without retries" cache-get.log

[Dauer der Verarbeitung: 0.3 Sekunden, vorverarbeitet 2026-11-18]