-
Notifications
You must be signed in to change notification settings - Fork 2
146 lines (140 loc) · 4.65 KB
/
lean4.yml
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
name: Lean 4 CI
on:
# Triggers the workflow on push or pull request events but only for the "main" branch and "v4*" branches
push:
branches:
- main
- 'v4*'
paths:
- '.github/workflows/lean4.yml'
- 'lean4*/**'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
# This workflow contains a single job called "lean4"
lean4:
name: Lean 4 Projects
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- uses: extractions/setup-just@v2
with:
just-version: 1.35.0
# - name: install elan on Ubuntu and macOS
# if: matrix.os != 'windows-latest'
# run: |
# set -o pipefail
# curl https://raw.githubusercontent.com/leanprover/elan/master/elan-init.sh -sSf | bash -s -- -y
# echo "$HOME/.elan/bin" >> $GITHUB_PATH
# - name: install elan on Windows
# if: matrix.os == 'windows-latest'
# run: |
# curl -O --location https://raw.githubusercontent.com/leanprover/elan/master/elan-init.ps1
# .\elan-init.ps1 -NoPrompt 1 -DefaultToolchain none
# echo "$HOME\.elan\bin" >> $env:GITHUB_PATH
- uses: dorny/paths-filter@v3
id: filter
with:
list-files: shell
filters: |
shared:
- added|modified: '.github/workflows/lean4.yml'
- added|modified: 'lean4-xp-kit/**/*'
lean4:
- added|modified: 'lean4/**/*'
duper:
- added|modified: 'lean4-duper-xp/**/*'
verso:
- added|modified: 'lean4-verso-xp/**/*'
sci:
- added|modified: 'lean4-sci-xp/**/*'
- name: Should annotate
id: annotate
# annotation is enabled conditionally
if: >-
matrix.os == 'ubuntu-latest' && (
startsWith(github.ref, 'refs/heads/v4') ||
contains(github.event.head_commit.message, '[annotate]')
)
run: echo "annotate=true" >> "$GITHUB_OUTPUT"
- name: Cache github-pages
if: >-
steps.annotate.outputs.annotate == 'true'
uses: actions/cache@v4
with:
path: github-pages
key: github-pages-${{ github.run_id }}
restore-keys: |
github-pages
- name: check Lean 4 Playground
if: >-
steps.filter.outputs.shared == 'true' ||
steps.filter.outputs.lean4 == 'true' ||
steps.annotate.outputs.annotate == 'true'
uses: leanprover/lean-action@v1
with:
lake-package-directory: "lean4"
- name: check DuperXp
if: >-
steps.filter.outputs.shared == 'true' ||
steps.filter.outputs.duper == 'true' ||
steps.annotate.outputs.annotate == 'true'
uses: leanprover/lean-action@v1
with:
lake-package-directory: "lean4-duper-xp"
- name: check VersoXp
if: >-
steps.filter.outputs.shared == 'true' ||
steps.filter.outputs.verso == 'true' ||
steps.annotate.outputs.annotate == 'true'
uses: leanprover/lean-action@v1
with:
lake-package-directory: "lean4-verso-xp"
# use-mathlib-cache: true
- name: check SciXp
if: >-
runner.os == 'macos-latest' && (
steps.filter.outputs.shared == 'true' ||
steps.filter.outputs.sci == 'true' ||
steps.annotate.outputs.annotate == 'true'
)
uses: leanprover/lean-action@v1
with:
lake-package-directory: "lean4-sci-xp"
use-mathlib-cache: true
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
# cache: 'pip' # caching pip dependencies
- name: annotate Lean 4 projects
if: >-
steps.annotate.outputs.annotate == 'true'
run: |
pushd lean4
just annotate Playground
popd
pushd lean4-duper-xp
just annotate DuperXp
popd
just pages lean4
just pages lean4-duper-xp
# - name: Try mk_all
# shell: bash
# run: |
# cd lean4
# rm -f .lake/packages/mathlib/lakefile.lean
# mv lakefile-for-mathlib.lean .lake/packages/mathlib/lakefile.lean
# lake -R exe mk_all || true
- name: Try check NoCI examples
shell: bash
run: |
cd lean4
./check_noci.sh || true