-
Notifications
You must be signed in to change notification settings - Fork 4
214 lines (174 loc) · 5.92 KB
/
blank.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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "main" branch
push:
branches: [ "main" ]
pull_request:
branches:
- '**'
env:
fourmolu_url: https://github.com/fourmolu/fourmolu/releases/download/v0.7.0.1/fourmolu-0.7.0.1-linux-x86_64
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
lint-vc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install formoulu
run: |
curl -L -o /usr/local/bin/fourmolu ${{env.fourmolu_url}}
chmod a+x /usr/local/bin/fourmolu
- name: Run fourmolu
run: |
find vc/src -name *.hs -exec fourmolu --mode 'check' {} +
- name: Install libtinfo (HLint dependency)
run: |
sudo apt-get install libtinfo6
sudo apt-get install libtinfo5
- name: 'Set up HLint'
uses: rwe/actions-hlint-setup@v1
with:
version: '3.4.1'
- name: 'Run HLint'
uses: rwe/actions-hlint-run@v2
with:
path: '["vc/src/"]'
fail-on: suggestion
build-vc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: freckle/stack-action@v4
with:
working-directory: vc
pedantic: false
stack-arguments: --ghc-options -Werror
run-vc:
permissions: write-all
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- uses: freckle/stack-action@v4
with:
working-directory: vc
pedantic: false
- if: github.ref == 'refs/heads/main'
name: Delete Build Cache on Main Push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh extension install actions/gh-actions-cache
REPO=${{ github.repository }}
BRANCH=${{ github.ref }}
cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH | grep "Linux-cache-build-" | cut -f 1 )
set +e
echo "Deleting caches:"
for cacheKey in $cacheKeysForPR
do
gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm
echo $cacheKey
done
echo -e "\n\nDone"
- name: Cache Elan and Mathlib
id: cache-elan-mathlib
uses: actions/cache@v3
env:
cache-name: cache-elan-mathlib
with:
path: |
./lake-packages
~/.elan
~/.profile
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/lakefile.lean') }}
- if: ${{ steps.cache-elan-mathlib.outputs.cache-hit != 'true' }}
name: Install Elan
run: |
curl https://raw.githubusercontent.com/leanprover/elan/master/elan-init.sh -sSf > elan_install.sh
chmod +x elan_install.sh
./elan_install.sh -y
source ~/.profile
echo $PATH >> $GITHUB_PATH
- if: ${{ steps.cache-elan-mathlib.outputs.cache-hit != 'true' }}
name: Get Mathlib cache
run: lake exe cache get
- name: Cache Build
id: cache-build
uses: actions/cache@v3
env:
cache-name: cache-build
with:
path: |
./build
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/lakefile.lean') }}
- name: Run feedback loop
run: |
source ~/.profile
cd vc
./integration-tests.sh
build-aether:
permissions: write-all
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- uses: freckle/stack-action@v4
with:
working-directory: vc
pedantic: false
- if: github.ref == 'refs/heads/main'
name: Delete Build Cache on Main Push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh extension install actions/gh-actions-cache
REPO=${{ github.repository }}
BRANCH=${{ github.ref }}
cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH | grep "Linux-cache-build-" | cut -f 1 )
set +e
echo "Deleting caches:"
for cacheKey in $cacheKeysForPR
do
gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm
echo $cacheKey
done
echo -e "\n\nDone"
- name: Cache Elan and Mathlib
id: cache-elan-mathlib
uses: actions/cache@v3
env:
cache-name: cache-elan-mathlib
with:
path: |
./lake-packages
~/.elan
~/.profile
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/lakefile.lean') }}
- if: ${{ steps.cache-elan-mathlib.outputs.cache-hit != 'true' }}
name: Install Elan
run: |
curl https://raw.githubusercontent.com/leanprover/elan/master/elan-init.sh -sSf > elan_install.sh
chmod +x elan_install.sh
./elan_install.sh -y
source ~/.profile
echo $PATH >> $GITHUB_PATH
- if: ${{ steps.cache-elan-mathlib.outputs.cache-hit != 'true' }}
name: Get Mathlib cache
run: lake exe cache get
- name: Cache Build
id: cache-build
uses: actions/cache@v3
env:
cache-name: cache-build
with:
path: |
./build
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/lakefile.lean') }}
- name: Build
run: |
source ~/.profile
lake build