fix #16
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: [ master ] | |
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-13] | |
mlcomp: [mlkit, mlton] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup environment | |
run: | | |
echo "OS=$(uname -s | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV | |
echo "RUNHOME=$(echo $HOME)" >> $GITHUB_ENV | |
- name: Install MLton (linux) | |
if: ${{ env.OS == 'linux' && matrix.mlcomp == 'mlton' }} | |
run: | | |
sudo apt-get install -y mlton | |
mlton | |
- name: Install MLkit (linux) | |
working-directory: ${{ env.RUNHOME }} | |
if: ${{ env.OS == 'linux' && matrix.mlcomp == 'mlkit' }} | |
run: | | |
wget https://github.com/melsman/mlkit/releases/download/v4.7.14/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: Install MLKit (macos) | |
if: ${{ env.OS == 'darwin' && matrix.mlcomp == 'mlkit' }} | |
run: | | |
arch -x86_64 brew install mlkit | |
mlkit --version | |
- name: Install MLton (macos) | |
if: ${{ env.OS == 'darwin' && matrix.mlcomp == 'mlton' }} | |
run: | | |
brew install mlton | |
mlton | |
- name: Install smlpkg | |
working-directory: ${{ env.RUNHOME }} | |
run: | | |
echo "[OS: $OS, HOME: $RUNHOME]" | |
wget https://github.com/diku-dk/smlpkg/releases/download/v0.1.5/smlpkg-bin-dist-${{env.OS}}.tgz | |
tar xzf smlpkg-bin-dist-${{env.OS}}.tgz | |
echo "$HOME/smlpkg-bin-dist-${{env.OS}}/bin" >> $GITHUB_PATH | |
$HOME/smlpkg-bin-dist-${{env.OS}}/bin/smlpkg --version | |
- name: Build | |
run: MLCOMP=${{ matrix.mlcomp }} make clean all | |
- name: Run tests | |
run: MLCOMP=${{ matrix.mlcomp }} make test |