Skip to content

Commit

Permalink
Adding CI for cmake build.
Browse files Browse the repository at this point in the history
  • Loading branch information
vguerra committed Sep 27, 2023
1 parent 6564842 commit 2b69d46
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and Test
name: Build and Test w/Bazel
permissions: read-all
on:
push:
Expand Down
47 changes: 47 additions & 0 deletions .github/workflows/build_and_test_cmake.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Build and Test w/CMake
permissions: read-all
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: seanmiddleditch/gha-setup-ninja@master

- name: Install prerequisites
run: |
sudo apt update
sudo apt install -y uuid-dev
- name: Cache LLVM artifact
id: cache-llvm
uses: actions/cache@v3
with:
path: |
./externals/llvm-project
key: ${{ runner.os }}-norm-${{ hashFiles('externals/llvm-project/llvm/CMakeLists.txt') }}

- name: Build LLVM
if: steps.cache-llvm.outputs.cache-hit != 'true'
run: |
git submodule update --init --recursive
cd externals/llvm-project
mkdir build && cd build
cmake -G Ninja ../llvm -DLLVM_ENABLE_PROJECTS=mlir -DLLVM_BUILD_EXAMPLES=ON -DLLVM_ENABLE_ASSERTIONS=ON -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_RTTI=ON -DLLVM_TARGETS_TO_BUILD="host"
cmake --build . --target check-mlir
- name: Build and test mlir-tutorial
run: |
mkdir build && cd build
cmake -DLLVM_DIR=$PWD/../externals/llvm-project/build/lib/cmake/llvm -DMLIR_DIR=$PWD/../externals/llvm-project/build/lib/cmake/mlir ..
cmake --build . --target MLIRAffineFullUnrollPasses
cmake --build . --target MLIRMulToAddPasses
cmake --build . --target mlir-headers
cmake --build . --target tutorial-opt
cmake --build . --target check-mlir-tutorial

0 comments on commit 2b69d46

Please sign in to comment.