2021-12-04 15:25:15 +03:00
|
|
|
name: MiniJuvix CI
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2022-04-04 16:55:15 +03:00
|
|
|
branches: [ main , dev ]
|
2021-12-04 15:25:15 +03:00
|
|
|
pull_request:
|
2022-04-04 16:55:15 +03:00
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
- dev
|
2021-12-04 15:25:15 +03:00
|
|
|
|
|
|
|
jobs:
|
2022-04-05 20:57:21 +03:00
|
|
|
|
|
|
|
ormolu:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: mrkkrp/ormolu-action@v5
|
|
|
|
with:
|
|
|
|
extra-args: >-
|
|
|
|
--ghc-opt -XDerivingStrategies
|
|
|
|
--ghc-opt -XImportQualifiedPost
|
|
|
|
--ghc-opt -XMultiParamTypeClasses
|
|
|
|
--ghc-opt -XStandaloneDeriving
|
|
|
|
--ghc-opt -XTemplateHaskell
|
|
|
|
--ghc-opt -XUnicodeSyntax
|
|
|
|
|
|
|
|
hlint:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: 'Set up HLint'
|
|
|
|
uses: rwe/actions-hlint-setup@v1
|
|
|
|
with:
|
|
|
|
version: '3.1.6'
|
|
|
|
- name: 'Run HLint'
|
|
|
|
uses: rwe/actions-hlint-run@v2.0.1
|
|
|
|
with:
|
|
|
|
path: '["src/", "app/", "test/"]'
|
|
|
|
fail-on: warning
|
|
|
|
|
2022-04-04 16:55:15 +03:00
|
|
|
build:
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os: [ ubuntu-latest , macOS-latest ]
|
|
|
|
ghc: ["9.2.2"]
|
2021-12-04 16:17:49 +03:00
|
|
|
steps:
|
2022-04-05 20:57:21 +03:00
|
|
|
- uses: actions/cache@v3
|
|
|
|
name: Cache Stack
|
2022-04-04 16:55:15 +03:00
|
|
|
id: cache
|
|
|
|
env:
|
|
|
|
cache-name: cache-env
|
2021-12-04 16:17:49 +03:00
|
|
|
with:
|
2022-04-04 16:55:15 +03:00
|
|
|
path: |
|
|
|
|
~/.stack
|
2022-04-05 20:57:21 +03:00
|
|
|
main/.stack-work
|
2022-04-04 16:55:15 +03:00
|
|
|
main/.hie
|
2022-05-04 13:57:42 +03:00
|
|
|
key: ${{ runner.os }}-v1-build-${{ matrix.ghc }}-${{ hashFiles('main/src/**/*.hs', 'main/app/**/*.hs', 'main/test/**/*.hs', 'main/package.yaml', 'main/stack.yaml') }}
|
2022-04-04 16:55:15 +03:00
|
|
|
restore-keys: |
|
2022-05-04 13:57:42 +03:00
|
|
|
${{ runner.os }}-v1-build-${{ matrix.ghc }}-
|
|
|
|
${{ runner.os }}-v1-build-
|
|
|
|
${{ runner.os }}-v1-
|
2022-04-04 16:55:15 +03:00
|
|
|
|
|
|
|
- uses: haskell/actions/setup@v1
|
|
|
|
name: Setup Haskell
|
|
|
|
with:
|
|
|
|
ghc-version: ${{ matrix.ghc }}
|
|
|
|
enable-stack: true
|
|
|
|
stack-version: 'latest'
|
2021-12-04 16:17:49 +03:00
|
|
|
|
2022-04-04 16:55:15 +03:00
|
|
|
- name: Checkout our repository
|
|
|
|
uses: actions/checkout@v2
|
2021-12-04 16:17:49 +03:00
|
|
|
with:
|
2022-04-04 16:55:15 +03:00
|
|
|
path: main
|
2021-12-04 16:17:49 +03:00
|
|
|
|
2022-04-04 16:55:15 +03:00
|
|
|
- name: Build Haskell Project
|
2021-12-04 16:17:49 +03:00
|
|
|
run: |
|
|
|
|
cd main
|
2022-05-05 17:21:04 +03:00
|
|
|
make ci-build
|
2021-12-04 16:17:49 +03:00
|
|
|
|
2022-04-04 16:55:15 +03:00
|
|
|
- name: Download MiniJuvix-stdlib
|
|
|
|
run: |
|
|
|
|
cd main
|
|
|
|
make minijuvix-stdlib
|
|
|
|
|
2022-04-05 20:57:21 +03:00
|
|
|
test:
|
2022-04-04 16:55:15 +03:00
|
|
|
needs: build
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os: [ macOS-latest , ubuntu-latest ]
|
|
|
|
ghc: ["9.2.2"]
|
|
|
|
steps:
|
2022-04-05 20:57:21 +03:00
|
|
|
- uses: actions/cache@v3
|
2022-04-04 16:55:15 +03:00
|
|
|
id: cache-build
|
2021-12-04 16:17:49 +03:00
|
|
|
with:
|
2022-04-04 16:55:15 +03:00
|
|
|
path: |
|
|
|
|
~/.stack
|
|
|
|
main/.stack-work/
|
|
|
|
main/.hie
|
2022-05-04 13:57:42 +03:00
|
|
|
key: ${{ runner.os }}-v1-build-${{ matrix.ghc }}-
|
2022-04-04 16:55:15 +03:00
|
|
|
- name: Checkout the main repository
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
path: main
|
2022-05-16 18:17:28 +03:00
|
|
|
- name: Cache LLVM and Clang
|
|
|
|
id: cache-llvm
|
|
|
|
uses: actions/cache@v3
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
C:/Program Files/LLVM
|
|
|
|
./llvm
|
|
|
|
key: ${{ runner.os }}-llvm-13
|
|
|
|
- name: Install LLVM and Clang
|
|
|
|
uses: KyleMayes/install-llvm-action@v1
|
|
|
|
with:
|
|
|
|
version: "13.0"
|
|
|
|
cached: ${{ steps.cache-llvm.outputs.cache-hit }}
|
|
|
|
- name: Download and extract wasi-sysroot
|
|
|
|
run: |
|
|
|
|
curl https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-15/wasi-sysroot-15.0.tar.gz -OL
|
|
|
|
tar xfv wasi-sysroot-15.0.tar.gz
|
|
|
|
- name: Download and extract libclang_rt.builtins-wasm32-wasi
|
|
|
|
run: |
|
|
|
|
curl https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-15/libclang_rt.builtins-wasm32-wasi-15.0.tar.gz -OL
|
|
|
|
tar xfv libclang_rt.builtins-wasm32-wasi-15.0.tar.gz
|
|
|
|
working-directory: ${{ env.LLVM_PATH }}
|
|
|
|
- name: Set WASI_SYSROOT_PATH
|
|
|
|
run: |
|
|
|
|
echo "WASI_SYSROOT_PATH=$GITHUB_WORKSPACE/wasi-sysroot" >> $GITHUB_ENV
|
2022-05-05 16:12:17 +03:00
|
|
|
- name: Setup Wasmer
|
|
|
|
uses: wasmerio/setup-wasmer@v1
|
2022-04-04 16:55:15 +03:00
|
|
|
- name: Test suite
|
2022-04-05 20:57:21 +03:00
|
|
|
id: test
|
2022-04-04 16:55:15 +03:00
|
|
|
run: |
|
|
|
|
cd main
|
2022-05-05 17:21:04 +03:00
|
|
|
make ci-test
|