-
Notifications
You must be signed in to change notification settings - Fork 9
87 lines (67 loc) · 2.47 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
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:
strategy:
matrix:
os: [ubuntu-20.04, macos-12]
mlcomp: [mlkit, mlton]
# mlcomp: [mlton]
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 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.11/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
run: |
mlkit --version
smlpkg --version
echo 'github.event_name: ' ${{ github.event_name }}
echo 'github.ref: ' ${{ github.ref }}
- name: Install MLton (linux)
if: ${{ env.OS == 'linux' && matrix.mlcomp == 'mlton' }}
run: |
sudo apt-get install -y mlton
mlton
- name: Install MLton (macos)
if: ${{ env.OS == 'darwin' && matrix.mlcomp == 'mlton' }}
run: |
brew install mlton
mlton
- name: Build
run: MLCOMP=${{ matrix.mlcomp }} make clean all
- name: Run tests
run: MLCOMP=${{ matrix.mlcomp }} make test
- name: Make binary distribution
if: ${{ matrix.mlcomp == 'mlton' }}
run: make dist
- 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/apltail-bin-dist-${{ env.OS }}.tgz
tag: ${{ github.ref }}
overwrite: true