-
Notifications
You must be signed in to change notification settings - Fork 103
80 lines (77 loc) · 2.34 KB
/
stack-linux.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
name: stack-linux
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: free disk space
run: |
sudo swapoff -a
sudo rm -f /swapfile
sudo apt -y purge ghc* cabal-install* php* || true
sudo apt autoremove -y || true
sudo apt autoclean -y || true
docker rmi $(docker image ls -aq)
df -h
- name: Setup packages
run: |
sudo rm -f /etc/apt/sources.list.d/sbt.list
sudo apt update -qq
sudo apt -y --allow-downgrades --allow-remove-essential --allow-change-held-packages install cmake curl wget unzip git libtinfo-dev python3 python3-yaml
## Stack is preinstalled on the GHA runners
# (wget -qO- https://get.haskellstack.org/ | sh) || true
- name: Cache .stack
uses: actions/cache@v3
with:
path: |
~/.stack
.stack-work
key: "\
${{ runner.os }}-stack\
-${{ hashFiles('**/stack.yaml.lock') }}\
-${{ hashFiles('**/package.yaml') }}\
"
restore-keys: |
${{ runner.os }}-stack-
- name: Build
run: |
# export PATH=/opt/ghc/bin:$PATH
source setenv
pushd deps/ ; ./get-deps.sh -a cpu -c; popd
stack build \
libtorch-ffi \
libtorch-ffi-helper \
hasktorch \
codegen \
examples \
bounding-box \
dataloader-cifar10 \
untyped-nlp
- name: Test
run: |
# export PATH=/opt/ghc/bin:$PATH
source setenv
stack test codegen
stack test libtorch-ffi
stack test hasktorch
stack exec codegen-exe
stack exec xor-mlp
# - name: Build tutorial
# run: |
# stack build tintin
# pushd hasktorch
# stack exec tintin -- run
# popd
# mkdir -p public/tutorial
# cp -r hasktorch/.stack-work/tintin/rendered/* public/tutorial
# - name: Deploy tutorial
# if: github.event_name == 'push' && github.ref == 'refs/heads/master'
# uses: peaceiris/actions-gh-pages@v3
# with:
# deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
# external_repository: hasktorch/hasktorch.github.io
# publish_branch: tutorial
# publish_dir: ./public