Update Setup.hs (#51) #69
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: Publish Haddock docs | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout the repository | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 | |
- 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@v2 | |
with: | |
path: ~/.stack | |
key: ${{ runner.os }}-docs-${{ hashFiles('**/*.cabal', 'stack*.yaml') }} | |
restore-keys: ${{ runner.os }}-docs- | |
- 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@b4ffde65f46336ab88eb53be808477a3936bae11 | |
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: Build mlir-hs documentation | |
run: | | |
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/mlir_shared/lib | |
stack haddock --no-haddock-deps --force-dirty | |
cp -r `stack path --local-install-root`/doc haddock | |
- name: Deploy to GitHub Pages | |
uses: "JamesIves/github-pages-deploy-action@3dbacc7e69578703f91f077118b3475862cb09b8" # 4.1.0 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
branch: gh-pages # The branch the action should deploy to. | |
folder: haddock # The folder the action should deploy. | |
clean: false # If true, automatically remove deleted files from the deploy branch. | |
commit-message: Updating gh-pages from ${{ github.sha }} |