-
Notifications
You must be signed in to change notification settings - Fork 166
627 lines (500 loc) · 17.2 KB
/
main.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
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
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
name: CI
on:
pull_request:
push:
branches: [ master ]
jobs:
build-linux-nix:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Install Nix
uses: cachix/install-nix-action@v20
- uses: cachix/cachix-action@v12
with:
name: futhark
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
- name: Build Futhark
run: nix-build --argstr suffix nightly-linux-x86_64 --argstr commit $GITHUB_SHA
- uses: actions/upload-artifact@v1
with:
name: futhark-nightly-linux-x86_64.tar.xz
path: result/futhark-nightly-linux-x86_64.tar.xz
build-linux-cabal:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Workaround runner image issue
# https://github.com/actions/runner-images/issues/7061
run: sudo chown -R $USER /usr/local/.ghcup
- uses: haskell/actions/setup@v2
with:
ghc-version: '9.4.4'
- uses: actions/cache@v3
name: Cache ~/.cabal/packages, ~/.cabal/store and dist-newstyle
with:
path: |
~/.cabal/packages
~/.cabal/store
dist-newstyle
key: ${{ runner.os }}-cabal-${{ hashFiles('futhark.cabal', 'cabal.project') }}
- name: Build Futhark
run: |
cabal --version
ghc --version
make configure
make build
make install
build-mac-cabal:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: |
brew install cabal-install ghc@9 sphinx-doc
echo "/usr/local/opt/sphinx-doc/bin" >> $GITHUB_PATH
echo "/usr/local/opt/ghc@9/bin" >> $GITHUB_PATH
- uses: actions/cache@v3
name: Cache ~/.cabal/packages, ~/.cabal/store and dist-newstyle
with:
path: |
~/.cabal/packages
~/.cabal/store
dist-newstyle
key: ${{ runner.os }}-cabal-${{ hashFiles('futhark.cabal', 'cabal.project') }}
- name: Build
run: |
cp -r tools/release/skeleton futhark-nightly-macos-x86_64
mkdir -p futhark-nightly-macos-x86_64/bin
cabal v2-update
cabal install --install-method=copy --overwrite-policy=always --installdir=futhark-nightly-macos-x86_64/bin
mkdir -p futhark-nightly-macos-x86_64/share/man/man1/
(cd docs; make man)
cp -r docs/_build/man/* futhark-nightly-macos-x86_64/share/man/man1/
mkdir -p futhark-nightly-macos-x86_64/share/futhark
cp LICENSE futhark-nightly-macos-x86_64/share/futhark/
echo "${GITHUB_SHA}" > futhark-nightly-macos-x86_64/commit-id
tar -Jcf futhark-nightly-macos-x86_64.tar.xz futhark-nightly-macos-x86_64
- uses: actions/upload-artifact@v1
with:
name: futhark-nightly-macos-x86_64.tar.xz
path: futhark-nightly-macos-x86_64.tar.xz
build-windows-cabal:
runs-on: windows-2019
steps:
- uses: actions/checkout@v3
- id: setup-haskell
uses: haskell/actions/setup@v2
with:
ghc-version: '9.4.4'
- uses: actions/cache@v3
name: Cache cabal stuff
with:
path: |
${{ steps.setup-haskell.outputs.cabal-store }}
dist-newstyle
key: ${{ runner.os }}-cabal-${{ hashFiles('futhark.cabal', 'cabal.project') }}
- name: Build
shell: bash
run: |
cabal update
try() { cabal install --install-method=copy --overwrite-policy=always --installdir=.; }
try || try || try
- uses: papeloto/[email protected]
with:
files: futhark.exe
dest: futhark-nightly-windows-x86_64.zip
- uses: actions/upload-artifact@v1
with:
name: futhark-nightly-windows-x86_64.zip
path: futhark-nightly-windows-x86_64.zip
haskell-test-style:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Install Nix
uses: cachix/install-nix-action@v20
- uses: actions/cache@v3
name: Cache ~/.cabal/packages, ~/.cabal/store and dist-newstyle
with:
path: |
~/.cabal/packages
~/.cabal/store
dist-newstyle
key: ${{ runner.os }}-${{ hashFiles('nix/sources.json') }}-style
- name: Style check
run: nix-shell --pure --run "make check"
python-test-style:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Install Nix
uses: cachix/install-nix-action@v20
- name: Style check
run: nix-shell --pure --run "black --check ."
- name: Type check
run: nix-shell --pure --run "mypy ."
# Fails mysteriously right now.
#
# build-docs:
# runs-on: ubuntu-22.04
# steps:
# - uses: actions/checkout@v3
# - name: Install Nix
# uses: cachix/install-nix-action@v18
# - uses: actions/cache@v3
# name: Cache ~/.cabal/packages, ~/.cabal/store and dist-newstyle
# with:
# path: |
# ~/.cabal/packages
# ~/.cabal/store
# dist-newstyle
# key: ${{ runner.os }}-${{ hashFiles('nix/sources.json', 'futhark.cabal', 'cabal.project') }}-haddock
# - name: Run haddock
# run: |
# nix-shell --pure --run "make configure"
# nix-shell --pure --run "make docs"
test-interpreter:
runs-on: ubuntu-22.04
needs: [build-linux-nix]
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: futhark-nightly-linux-x86_64.tar.xz
- name: Install from nightly tarball
run: |
tar xvf futhark-nightly-linux-x86_64.tar.xz
make -C futhark-nightly-linux-x86_64/ install PREFIX=$HOME/.local
echo "$HOME/.local/bin" >> $GITHUB_PATH
- run: |
futhark test -i tests
test-c:
runs-on: ubuntu-22.04
needs: [build-linux-nix]
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y python3-jsonschema
- uses: actions/download-artifact@v3
with:
name: futhark-nightly-linux-x86_64.tar.xz
- name: Install from nightly tarball
run: |
tar xvf futhark-nightly-linux-x86_64.tar.xz
make -C futhark-nightly-linux-x86_64/ install PREFIX=$HOME/.local
echo "$HOME/.local/bin" >> $GITHUB_PATH
- run: |
export CFLAGS="-fsanitize=undefined -fsanitize=address -fno-sanitize-recover -O"
futhark test -c --backend=c tests --no-tuning
make -C tests_lib/c -j
test-multicore:
runs-on: ubuntu-22.04
needs: [build-linux-nix]
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y python3-jsonschema
- uses: actions/download-artifact@v3
with:
name: futhark-nightly-linux-x86_64.tar.xz
- name: Install from nightly tarball
run: |
tar xvf futhark-nightly-linux-x86_64.tar.xz
make -C futhark-nightly-linux-x86_64/ install PREFIX=$HOME/.local
echo "$HOME/.local/bin" >> $GITHUB_PATH
- run: |
export CFLAGS="-fsanitize=undefined -fsanitize=address -fno-sanitize-recover -O"
futhark test -c --backend=multicore tests --no-tuning
make -C tests_lib/c FUTHARK_BACKEND=multicore
test-ispc:
runs-on: ubuntu-22.04
needs: [build-linux-nix]
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y python3-jsonschema
- name: Install Nix
uses: cachix/install-nix-action@v20
- uses: actions/download-artifact@v3
with:
name: futhark-nightly-linux-x86_64.tar.xz
- name: Install from nightly tarball
run: |
tar xvf futhark-nightly-linux-x86_64.tar.xz
make -C futhark-nightly-linux-x86_64/ install PREFIX=$HOME/.local
echo "$HOME/.local/bin" >> $GITHUB_PATH
- run: |
export CFLAGS="-fsanitize=undefined -fsanitize=address -fno-sanitize-recover -O"
nix-shell --run 'futhark test -c --backend=ispc tests --no-tuning'
nix-shell --run 'make -C tests_lib/c FUTHARK_BACKEND=ispc'
test-python:
runs-on: ubuntu-22.04
needs: [build-linux-nix]
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y python3-numpy
- uses: actions/download-artifact@v3
with:
name: futhark-nightly-linux-x86_64.tar.xz
- name: Install from nightly tarball
run: |
tar xvf futhark-nightly-linux-x86_64.tar.xz
make -C futhark-nightly-linux-x86_64/ install PREFIX=$HOME/.local
echo "$HOME/.local/bin" >> $GITHUB_PATH
- run: |
futhark test -c --no-terminal --no-tuning --backend=python --exclude=no_python --exclude=compiled tests
make -C tests_lib/python -j
test-oclgrind:
runs-on: ubuntu-22.04
needs: [build-linux-nix]
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y opencl-headers oclgrind nvidia-cuda-dev nvidia-opencl-dev
- uses: actions/download-artifact@v3
with:
name: futhark-nightly-linux-x86_64.tar.xz
- name: Install from nightly tarball
run: |
tar xvf futhark-nightly-linux-x86_64.tar.xz
make -C futhark-nightly-linux-x86_64/ install PREFIX=$HOME/.local
echo "$HOME/.local/bin" >> $GITHUB_PATH
- run: |
futhark test tests -c --no-terminal --backend=opencl --exclude=compiled --cache-extension=cache --pass-option=--build-option=-O0 --runner=tools/oclgrindrunner.sh
test-opencl:
runs-on: opencl
needs: [build-linux-nix]
if: github.repository == 'diku-dk/futhark'
steps:
- uses: actions/checkout@v3
- run: |
module load python/3.9.9
virtualenv virtualenv
source virtualenv/bin/activate
pip install jsonschema
- uses: ./.github/actions/futhark-slurm
with:
script: |
set -e
futhark test tests \
--backend=opencl \
--cache-extension=cache
source virtualenv/bin/activate
FUTHARK_BACKEND=opencl make -C tests_lib/c -j
slurm-options: -p gpu --time=0-01:00:00 --gres=gpu:1 --job-name=fut-opencl-test --exclude=hendrixgpu05fl,hendrixgpu06fl
test-pyopencl:
runs-on: opencl
needs: [build-linux-nix]
if: github.repository == 'diku-dk/futhark'
steps:
- uses: actions/checkout@v3
- run: |
module load python/3.9.9
virtualenv virtualenv
source virtualenv/bin/activate
pip install numpy pyopencl jsonschema
- uses: ./.github/actions/futhark-slurm
with:
script: |
set -e
source virtualenv/bin/activate
futhark test tests --no-terminal --backend=pyopencl
slurm-options: -p gpu --time=0-01:00:00 --gres=gpu:1 --job-name=fut-pyopencl-test --exclude=hendrixgpu05fl,hendrixgpu06fl
test-cuda:
runs-on: cuda
needs: [build-linux-nix]
if: github.repository == 'diku-dk/futhark'
steps:
- uses: actions/checkout@v3
- run: |
module load python/3.9.9
virtualenv virtualenv
source virtualenv/bin/activate
pip install jsonschema
- uses: ./.github/actions/futhark-slurm
with:
script: |
set -e
futhark test tests --no-terminal --backend=cuda --concurrency=8
source virtualenv/bin/activate
FUTHARK_BACKEND=cuda make -C tests_lib/c -j
slurm-options: -p gpu --time=0-01:00:00 --gres=gpu:1 --job-name=fut-cuda-test --exclude=hendrixgpu05fl,hendrixgpu06fl
test-wasm:
runs-on: ubuntu-22.04
needs: [build-linux-nix]
steps:
- uses: actions/checkout@v3
- uses: mymindstorm/setup-emsdk@v11
with:
version: 2.0.18
actions-cache-folder: 'emsdk-cache'
- uses: actions/[email protected]
with:
node-version: '16.x'
- uses: actions/download-artifact@v3
with:
name: futhark-nightly-linux-x86_64.tar.xz
- name: Install from nightly tarball
run: |
tar xvf futhark-nightly-linux-x86_64.tar.xz
make -C futhark-nightly-linux-x86_64/ install PREFIX=$HOME/.local
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Run tests
run: |
node --version
export EMCFLAGS="-sINITIAL_MEMORY=2147418112 -O1" # 2gb - 64kb... largest value of memory
futhark test \
-c \
--backend=wasm \
--runner=./tools/node-simd.sh \
--no-tuning \
--exclude=no_wasm tests
test-wasm-multicore:
runs-on: ubuntu-22.04
needs: [build-linux-nix]
steps:
- uses: actions/checkout@v3
- uses: mymindstorm/setup-emsdk@v11
with:
version: 2.0.18
actions-cache-folder: 'emsdk-cache'
- uses: actions/[email protected]
with:
node-version: '16.x'
- uses: actions/download-artifact@v3
with:
name: futhark-nightly-linux-x86_64.tar.xz
- name: Install from nightly tarball
run: |
tar xvf futhark-nightly-linux-x86_64.tar.xz
make -C futhark-nightly-linux-x86_64/ install PREFIX=$HOME/.local
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Run tests
run: |
node --version
export EMCFLAGS="-sINITIAL_MEMORY=2147418112 -O1 -s PTHREAD_POOL_SIZE=12" # 2gb - 64kb... largest value of memory
futhark test -c --backend=wasm-multicore --runner=./tools/node-threaded.sh --no-tuning --exclude=no_wasm tests
test-wasm-lib:
runs-on: ubuntu-22.04
needs: [build-linux-nix]
steps:
- uses: actions/checkout@v3
- uses: mymindstorm/setup-emsdk@v11
with:
version: 2.0.18
actions-cache-folder: 'emsdk-cache'
- uses: actions/[email protected]
with:
node-version: '16.x'
- uses: actions/download-artifact@v3
with:
name: futhark-nightly-linux-x86_64.tar.xz
- name: Install from nightly tarball
run: |
tar xvf futhark-nightly-linux-x86_64.tar.xz
make -C futhark-nightly-linux-x86_64/ install PREFIX=$HOME/.local
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Run tests
run: |
make -C tests_lib/javascript
test-ir-parser:
runs-on: ubuntu-22.04
needs: [build-linux-nix]
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: futhark-nightly-linux-x86_64.tar.xz
- name: Install from nightly tarball
run: |
tar xvf futhark-nightly-linux-x86_64.tar.xz
make -C futhark-nightly-linux-x86_64/ install PREFIX=$HOME/.local
echo "$HOME/.local/bin" >> $GITHUB_PATH
- run: |
tools/testparser.sh tests
test-tools:
runs-on: ubuntu-22.04
needs: [build-linux-nix]
steps:
- name: Install OS dependencies
run: |
sudo apt-get update
sudo apt-get install -y ffmpeg
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: futhark-nightly-linux-x86_64.tar.xz
- name: Install from nightly tarball
run: |
tar xvf futhark-nightly-linux-x86_64.tar.xz
make -C futhark-nightly-linux-x86_64/ install PREFIX=$HOME/.local
echo "$HOME/.local/bin" >> $GITHUB_PATH
- run: |
cd tests_pkg && sh test.sh
- run: |
cd tests_literate && sh test.sh
- run: |
cd tests_repl && sh test.sh
- run: |
cd tests_bench && sh test.sh
- run: |
cd tests_adhoc && sh test.sh
- run: |
futhark doc -o prelude-docs /dev/null
tar -Jcf prelude-docs.tar.xz prelude-docs
- uses: actions/upload-artifact@v1
with:
name: prelude-docs.tar.xz
path: prelude-docs.tar.xz
deploy-nightly:
runs-on: ubuntu-22.04
needs: [build-linux-nix, build-mac-cabal, build-windows-cabal, test-tools]
if: github.ref == 'refs/heads/master'
steps:
- name: Install SSH key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.SSHKEY }}
known_hosts: ${{ secrets.KNOWN_HOSTS }}
- uses: actions/download-artifact@v3
with:
name: futhark-nightly-windows-x86_64.zip
- uses: actions/download-artifact@v3
with:
name: futhark-nightly-macos-x86_64.tar.xz
- uses: actions/download-artifact@v3
with:
name: futhark-nightly-linux-x86_64.tar.xz
- uses: actions/download-artifact@v3
with:
name: prelude-docs.tar.xz
- name: scp tarballs to server
run: |
scp -o StrictHostKeyChecking=no futhark-nightly-windows-x86_64.zip futhark-nightly-linux-x86_64.tar.xz futhark-nightly-macos-x86_64.tar.xz [email protected]:/var/www/htdocs/futhark-lang.org/releases
- name: copy docs to server
run: |
tar -xf prelude-docs.tar.xz
rsync -rv -e 'ssh -o "StrictHostKeyChecking no"' prelude-docs/* [email protected]:/var/www/htdocs/futhark-lang.org/docs/prelude/
- name: make nightly release
uses: "marvinpinto/[email protected]"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "nightly"
prerelease: true
title: "nightly"
files: |
futhark-nightly-windows-x86_64.zip
futhark-nightly-linux-x86_64.tar.xz
futhark-nightly-macos-x86_64.tar.xz