forked from leanprover-community/mathlib4
-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (57 loc) · 2.4 KB
/
Copy pathcache_test.yml
File metadata and controls
64 lines (57 loc) · 2.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# Runs the cache tool's unit tests (`lake exe cache-test`) on Linux and Windows
# for PRs that touch the cache code. The suite is deliberately network-free (see
# the module docstring in `Cache/Test.lean`), so the job only needs 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.
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@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
# 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@38fbc41a8c28c4cbaec22d7f7de508ec2e7c0dd9 # v1.5.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