-
-
Notifications
You must be signed in to change notification settings - Fork 7
46 lines (39 loc) · 1.2 KB
/
sync.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
name: sync exercise and solutions
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
pull_request:
branches:
- main
push:
branches:
- main
workflow_dispatch:
permissions:
contents: write
pages: write
id-token: write
jobs:
sync_exercise:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
- 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: run mk_exercise
run: |
rm -r LeanByExample/Tutorial/Exercise
lake exe mk_exercise LeanByExample/Tutorial/Solution LeanByExample/Tutorial/Exercise
- name: detect diff
id: diff
run: |
git add -N LeanByExample/Tutorial/Exercise
git diff --name-only --exit-code