-
Notifications
You must be signed in to change notification settings - Fork 18
62 lines (54 loc) · 1.94 KB
/
Copy pathbuild-project.yml
File metadata and controls
62 lines (54 loc) · 1.94 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
name: Build Project
on:
push:
branches:
- main
paths:
- '**/*.lean'
- 'lean-toolchain'
- 'lakefile.toml'
- 'lake-manifest.json'
pull_request:
branches:
- main
paths:
- '**/*.lean'
- 'lean-toolchain'
- 'lakefile.toml'
- 'lake-manifest.json'
workflow_dispatch: # Allow manual triggering of the workflow from the GitHub Actions interface
# Cancel previous runs if a new commit is pushed to the same PR or branch
concurrency:
group: ${{ github.ref }} # Group runs by the ref (branch or PR)
cancel-in-progress: true # Cancel any ongoing runs in the same group
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages and modify PR labels
permissions:
contents: read # Read access to repository contents
pages: write # Write access to GitHub Pages
id-token: write # Write access to ID tokens
jobs:
build_project:
runs-on: ubuntu-latest
name: Build project
steps:
- name: Checkout project
uses: actions/checkout@v7
with:
fetch-depth: 0 # Fetch all history for all branches and tags
- name: Install and configure Lean, and get mathlib cache
uses: leanprover/lean-action@38fbc41a8c28c4cbaec22d7f7de508ec2e7c0dd9 # v1.5.0
with:
auto-config: false
use-github-cache: false
use-mathlib-cache: true
- name: "Check that Project.lean is up to date"
run: |
~/.elan/bin/lake exe mk_all --check || echo "ERROR: please ensure that Project.lean is up to date, for instance by running lake exe mk_all"
- name: Cache build artifacts
uses: actions/cache@v6
with:
path: .lake/build
key: LakeBuild-${{ runner.os }}-${{ hashFiles('lean-toolchain') }}-${{ hashFiles('lake-manifest.json') }}
restore-keys: LakeBuild-
- name: Build project
run: ~/.elan/bin/lake build Project