-
Notifications
You must be signed in to change notification settings - Fork 1
65 lines (54 loc) · 1.69 KB
/
build.yaml
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
name: Generate markdown file
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-only-cancel-in-progress-jobs-or-runs-for-the-current-workflow
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
pull_request:
push:
branches:
- main
schedule:
# monthly run
- cron: '0 0 1 * *'
permissions:
contents: write
pages: write
id-token: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
- name: Install elan
run: |
curl https://raw.githubusercontent.com/leanprover/elan/master/elan-init.sh -sSf | sh -s -- -y --default-toolchain none
echo "$HOME/.elan/bin" >> $GITHUB_PATH
- name: Cache dependencies
uses: actions/cache@v3
with:
path: .lake
key: deps-${{ runner.os }}-${{ hashFiles('lean-toolchain') }}-${{ hashFiles('lake-manifest.json') }}
restore-keys: |
deps-${{ runner.os }}-${{ hashFiles('lean-toolchain') }}
- name: get mathlib cache
run: lake exe cache get
- name: generate markdown file
run: lake env lean --run Main.lean > tactics.md
- name: run python script
run: python3 script.py
- name: get diff
id: diff
run: |
git add -N tactics.md
git diff --name-only --exit-code
continue-on-error: true
- name: commit
if: steps.diff.outcome == 'failure'
run: |
git config user.name "GitHub Action"
git config user.email "[email protected]"
git add .
git commit -m "generated by GitHub Action"
git push