Skip to content

Haskell CI

Haskell CI #5022

Workflow file for this run

name: Haskell CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
schedule:
# Always regenerate once every 4 hour
- cron: '15 */4 * * *'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
- name: Setup Haskell Stack
uses: actions/setup-haskell@v1
with:
enable-stack: true
stack-no-global: true
stack-version: 'latest'
- name: Cache
uses: actions/cache@70655ec8323daeeaa7ef06d7c56e1b9191396cbe
with:
path: |
~/.stack
$GITHUB_WORKSPACE/.stack-work
key: ${{ runner.os }}-${{ hashFiles('**/*.cabal', 'stack*.yaml') }}
restore-keys: ${{ runner.os }}-
- name: Install zstd
run: sudo apt install libzstd-dev
- name: Install Ninja
uses: llvm/actions/install-ninja@55d844821959226fab4911f96f37071c1d4c3268
- name: Clone LLVM repo
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
with:
repository: llvm/llvm-project
ref: 'main'
path: 'llvm-project'
- name: Ccache for C++ compilation
uses: hendrikmuhs/ccache-action@4687d037e4d7cf725512d9b819137a3af34d39b3
- name: Install dependencies (LLVM & MLIR)
run: |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
cmake -B llvm-project/build -DLLVM_CCACHE_BUILD=ON \
-DLLVM_BUILD_LLVM_DYLIB=ON -DMLIR_BUILD_MLIR_C_DYLIB=ON -DCMAKE_BUILD_TYPE=Release \
-DLLVM_ENABLE_PROJECTS=mlir -DLLVM_TARGETS_TO_BUILD="host" \
-DCMAKE_INSTALL_PREFIX=$HOME/mlir_shared llvm-project/llvm
cmake --build llvm-project/build -t install
echo "$HOME/mlir_shared/bin" >> $GITHUB_PATH
env:
CC: clang
CXX: clang++
CMAKE_GENERATOR: Ninja
- name: Install dependencies (Haskell)
run: |
stack build --test --only-dependencies
- name: Build mlir-hs
run: |
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/mlir_shared/lib
stack build --test --ghc-options "-Wall -Werror -fforce-recomp"
- name: Run mlir-hs tests
run: |
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/mlir_shared/lib
stack test