-
Notifications
You must be signed in to change notification settings - Fork 30
163 lines (131 loc) · 4.69 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
# This is the MLKit main workflow for building and testing the MLKit
# on various architectures. The workflow contains a job called
# "build-test-deploy". It is triggered on push or pull request events
# on the master branch. It is also triggered when a tag is pushed, in
# which case a binary distribution is deployed. The build matrix is
# currently setup to run only with mlkit as the primary SML compiler.
name: CI
on:
push:
branches: [ master ]
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
pull_request:
branches: [ master ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build-test-deploy:
strategy:
matrix:
os: [ubuntu-20.04, macos-latest]
mlcomp: [mlkit, mlton]
# mlcomp: [mlton]
# mlcomp: [mlkit]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Setup environment
run: |
echo "OS=$(uname -s | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
echo "RUNHOME=$(echo $HOME)" >> $GITHUB_ENV
- name: Install dependencies (linux)
if: ${{ env.OS == 'linux' }}
run: |
# sudo apt-get -qq update
sudo apt-get install -y gcc autoconf make
- name: Install dependencies (linux, mlton)
if: ${{ env.OS == 'linux' && matrix.mlcomp == 'mlton' }}
run: |
# sudo apt-get -qq update
sudo apt-get install -y mlton
- name: Install dependencies (macos)
if: ${{ env.OS == 'darwin' }}
run: |
brew install gcc autoconf make
brew tap homebrew/cask
brew install --cask phantomjs
- name: Install dependencies (macos, mlton)
if: ${{ env.OS == 'darwin' && matrix.mlcomp == 'mlton' }}
run: |
# The brew version of MLton has a bug
brew install mlton --HEAD
- name: Install MLKit and smlpkg
working-directory: ${{ env.RUNHOME }}
run: |
echo "[OS: $OS, HOME: $RUNHOME]"
wget https://github.com/diku-dk/smlpkg/releases/download/v0.1.4/smlpkg-bin-dist-${{env.OS}}.tgz
tar xzf smlpkg-bin-dist-${{env.OS}}.tgz
echo "$HOME/smlpkg-bin-dist-${{env.OS}}/bin" >> $GITHUB_PATH
wget https://github.com/melsman/mlkit/releases/download/v4.7.4/mlkit-bin-dist-${{env.OS}}.tgz
tar xzf mlkit-bin-dist-${{env.OS}}.tgz
echo "$HOME/mlkit-bin-dist-${{env.OS}}/bin" >> $GITHUB_PATH
mkdir -p .mlkit
echo "SML_LIB $HOME/mlkit-bin-dist-${{env.OS}}/lib/mlkit" > .mlkit/mlb-path-map
- name: Check MLton
if: ${{ matrix.mlcomp == 'mlton' }}
run: |
mlton
echo 'github.event_name: ' ${{ github.event_name }}
echo 'github.ref: ' ${{ github.ref }}
- name: Check MLKit
if: ${{ matrix.mlcomp == 'mlkit' }}
run: |
mlkit --version
smlpkg --version
echo 'github.event_name: ' ${{ github.event_name }}
echo 'github.ref: ' ${{ github.ref }}
- name: Configure With MLton
if: ${{ matrix.mlcomp == 'mlton' }}
run: |
./autobuild
./configure
- name: Configure With MLKit
if: ${{ matrix.mlcomp == 'mlkit' }}
run: |
./autobuild
./configure --with-compiler=mlkit
- name: Build MLKit
run: |
make mlkit
make mlkit_basislibs
- name: Install MLKit
run: |
sudo make install
- name: Run MLKit tests
run: |
make -C test_dev test
make -C test_dev test_prof
make -C test test_mlkit
make -C test test_mlkit_no_gc
make -C test/explicit_regions all
make -C test/repl all
make -C test/parallelism all
- name: Configure SmlToJs
if: ${{ matrix.mlcomp == 'mlton' }}
run: |
./configure --with-compiler="SML_LIB=`pwd` `pwd`/bin/mlkit"
- name: Build SmlToJs
run: |
make smltojs
make smltojs_basislibs
- name: Install SmlToJs
run: |
sudo make install_smltojs
- name: Run SmlToJs tests
run: |
make -C js/test test
- name: Build binary distribution
run: |
make mlkit_bin_dist
- name: Test bootstrapping
run: |
make bootstrap
- name: Upload release
if: ${{ matrix.mlcomp == 'mlton' && github.event_name == 'push' && contains(github.ref, '/tags/v') }}
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: dist/mlkit-bin-dist-${{ env.OS }}.tgz
tag: ${{ github.ref }}
overwrite: true