-
Notifications
You must be signed in to change notification settings - Fork 3
267 lines (223 loc) · 7.59 KB
/
release-nightly.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
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
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
name: Nightly build, release and benchmark
on:
workflow_dispatch:
inputs:
ref:
description: "the repository ref to build"
required: true
default: "main"
schedule:
- cron: '0 3 * * *'
env:
STACK_VERSION: 2.11.1
jobs:
build-linux:
name: Build static Linux binary and release
runs-on: ubuntu-latest
container: glcr.b-data.ch/ghc/ghc-musl:9.4.5
outputs:
tag: ${{ steps.tag.outputs.value }}
steps:
- name: checkout code
uses: actions/checkout@v3
with:
submodules: true
repository: anoma/juvix
ref: ${{ github.event.inputs.ref }}
- name: create ~/.local/bin
run: mkdir -p "$HOME/.local/bin"
shell: bash
- name: install stack
run: |
curl https://github.com/commercialhaskell/stack/releases/download/v$STACK_VERSION/stack-$STACK_VERSION-linux-x86_64-static.tar.gz -OL
tar xf stack-$STACK_VERSION-linux-x86_64-static.tar.gz
cp stack-$STACK_VERSION-linux-x86_64-static/stack /usr/local/bin
- name: add ~/.local/bin to PATH
run: echo "$HOME/.local/bin" >> $GITHUB_PATH
shell: bash
- name: Stack permissions bug workaround
run: "chown -R $(id -un):$(id -gn) ~"
- name: Install clang14
run: apk add --update clang14
- name: Runtime build
run: make runtime LIBTOOL=llvm14-ar
- name: build Juvix
run: stack install --allow-different-user --system-ghc --ghc-options='-split-sections' --flag juvix:static
- run: echo "HOME=$HOME" >> $GITHUB_ENV
shell: bash
- name: set current date to date.now output variable
id: date
run: echo "now=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
- name: set Juvix version to juvix-version.current output variable
id: juvix-version
run: echo "current=$(juvix --version | head -n 1 | sed -E 's/[^0-9]+(.*)/\1/')" >> $GITHUB_OUTPUT
- name: set tag.value to tag for release
id: tag
run: echo "value=nightly-${{ steps.date.outputs.now }}-${{ steps.juvix-version.outputs.current }}" >> $GITHUB_OUTPUT
- name: create release tar
run: |
cp "${{ env.HOME }}/.local/bin/juvix" /tmp/juvix
cd /tmp
tar zcf juvix-linux_x86_64.tar.gz juvix
- name: create draft nightly release and upload artifacts
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.tag.outputs.value }}
commit: "main"
name: "Nightly Build ${{ steps.date.outputs.now }} ${{ steps.juvix-version.outputs.current }}"
artifacts: /tmp/juvix-linux*
artifactErrorsFailBuild: true
allowUpdates: true
draft: true
build-macos:
runs-on: macos-latest
name: Build macOS binary
steps:
- name: checkout code
uses: actions/checkout@v3
with:
submodules: true
repository: anoma/juvix
ref: main
- name: Set homebrew LLVM CC and LIBTOOL vars (macOS)
run: |
echo "CC=$(brew --prefix llvm@15)/bin/clang" >> $GITHUB_ENV
echo "LIBTOOL=$(brew --prefix llvm@15)/bin/llvm-ar" >> $GITHUB_ENV
- name: Make runtime
run: |
make CC=$CC LIBTOOL=$LIBTOOL runtime
- name: Stack setup
id: stack
uses: freckle/stack-action@v4
with:
test: false
- name: Install Juvix
run: |
make CC=$CC LIBTOOL=$LIBTOOL install
- run: echo "HOME=$HOME" >> $GITHUB_ENV
shell: bash
- name: create release tar
run: |
tar zcf juvix-darwin_x86_64.tar.gz -C "${{ env.HOME }}/.local/bin" juvix
- uses: actions/upload-artifact@v3
with:
name: macos-binary
path: juvix-darwin*
if-no-files-found: error
publish-release:
needs: [build-linux, build-macos]
runs-on: ubuntu-latest
name: Publish Release
steps:
- uses: actions/download-artifact@v3
with:
name: macos-binary
path: /tmp
- name: upload macOS release binary
uses: ncipollo/release-action@v1
with:
tag: ${{needs.build-linux.outputs.tag}}
omitNameDuringUpdate: true
artifactErrorsFailBuild: true
artifacts: /tmp/juvix-darwin*
draft: true
allowUpdates: true
- name: make nightly release latest
uses: ncipollo/release-action@v1
with:
tag: ${{needs.build-linux.outputs.tag}}
omitNameDuringUpdate: true
makeLatest: true
allowUpdates: true
bench:
needs: publish-release
name: Run benchmarks
runs-on: ubuntu-20.04
steps:
- name: checkout code
uses: actions/checkout@v3
with:
submodules: true
repository: anoma/juvix
ref: main
path: main
- name: checkout nightly repo
uses: actions/checkout@v3
with:
path: nightly-repo
- name: Download latest nightly Juvix binary
uses: jaxxstorm/[email protected]
with:
repo: anoma/juvix-nightly-builds
cache: enable
rename-to: juvix
chmod: 0755
- name: Setup OCAML
uses: ocaml/setup-ocaml@v2
with:
ocaml-compiler: 4.13.x
- uses: actions/cache@v3
name: Cache ~/.stack
with:
path: ~/.stack
key: ${{ runner.os }}-${{ matrix.ghc }}-stack-global-${{ hashFiles('main/stack.yaml') }}-${{ hashFiles('main/package.yaml') }}
restore-keys: |
${{ runner.os }}-9.2.7-stack-global-
- uses: actions/cache@v3
name: Cache .stack-work
with:
path: main/.stack-work
key: ${{ runner.os }}-${{ matrix.ghc }}-stack-work-${{ hashFiles('main/stack.yaml') }}-${{ hashFiles('main/package.yaml') }}-${{ hashFiles('main/**/*.hs') }}
restore-keys: |
${{ runner.os }}-9.2.7-stack-work-
- uses: haskell/actions/setup@v2
name: Setup Haskell
with:
ghc-version: 9.2.7
enable-stack: true
stack-version: 'latest'
- name: Install gnuplot
run: sudo apt install gnuplot
- name: Cache LLVM and Clang (Linux)
id: cache-llvm
uses: actions/cache@v3
with:
path: |
C:/Program Files/LLVM
./llvm
key: ${{ runner.os }}-llvm-13
- name: Install LLVM and Clang (Linux)
uses: KyleMayes/install-llvm-action@v1
with:
version: "13.0"
cached: ${{ steps.cache-llvm.outputs.cache-hit }}
- name: Download and extract wasi-sysroot
run: |
curl https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-15/wasi-sysroot-15.0.tar.gz -OL
tar xfv wasi-sysroot-15.0.tar.gz
- name: Set WASI_SYSROOT_PATH
run: |
echo "WASI_SYSROOT_PATH=$GITHUB_WORKSPACE/wasi-sysroot" >> $GITHUB_ENV
- name: Setup Wasmer
uses: wasmerio/setup-wasmer@v1
- name: Setup Juvix runtime
run: |
cd main
make runtime
- name: Run benchmarks
run: |
eval $(opam env)
wasmer --version
juvix --version
ocamlc --version
ocamlopt --version
clang --version
cd main
stack bench --system-ghc
- name: Copy benchmark results
run: cp -r main/.benchmark-results/. nightly-repo/benchmark-results
- uses: EndBug/add-and-commit@v9
with:
message: Add benchmark results
add: benchmark-results/**/*.svg benchmark-results/**/*.csv
cwd: ./nightly-repo