diff --git a/.github/workflows/conformance.yml b/.github/workflows/conformance.yml index 7de041162..356494d58 100644 --- a/.github/workflows/conformance.yml +++ b/.github/workflows/conformance.yml @@ -2,7 +2,7 @@ name: Conformance on: push: - branches: [master] + branches: [master, test-ci] pull_request: types: [opened, synchronize, reopened] @@ -15,4 +15,15 @@ jobs: submodules: true - name: Format with clang-format run: .github/workflows/scripts/format_cpp.sh - + BuildAndTest: + runs-on: ubuntu-latest + env: + LLVM_PROJECT: $GITHUB_WORKSPACE/llvm_project + steps: + - uses: actions/checkout@v2 + - name: Build and test compiler + uses: addnab/docker-run-action@v3 + with: + image: qbozama/mlir:54f059c + options: -v ${{ github.workspace }}:/workspace + run: cd /workspace/compiler && mkdir build && cmake -B build . -DLLVM_DIR=$LLVM_PROJECT/build/lib/cmake/llvm -DMLIR_DIR=$LLVM_PROJECT/build/lib/cmake/mlir && make -C build/ zamacompiler && make test \ No newline at end of file diff --git a/builders/Dockerfile.mlir-env b/builders/Dockerfile.mlir-env new file mode 100644 index 000000000..b6aa50ebe --- /dev/null +++ b/builders/Dockerfile.mlir-env @@ -0,0 +1,24 @@ +FROM ubuntu:latest + +RUN apt-get update --fix-missing +RUN DEBIAN_FRONTEND="noninteractive" apt-get install -y curl cmake g++ build-essential python3 python3-pip python3-setuptools ninja-build +RUN apt-get install -y git +RUN git clone https://github.com/llvm/llvm-project.git +ENV LLVM_PROJECT=$PWD/llvm-project +RUN mkdir ${LLVM_PROJECT}/build +RUN cd ${LLVM_PROJECT}/build && cmake -GNinja ../llvm \ + -DLLVM_ENABLE_PROJECTS=mlir \ + -DLLVM_BUILD_EXAMPLES=ON \ + -DLLVM_TARGETS_TO_BUILD="host" \ + -DCMAKE_BUILD_TYPE=Release \ + -DLLVM_ENABLE_ASSERTIONS=ON +RUN cd ${LLVM_PROJECT}/build && cmake --build . --target check-mlir +ENV PATH=${LLVM_PROJECT}/build/bin:${PATH} + +FROM ubuntu:latest +COPY --from=0 /llvm-project/ /llvm-project/ +ENV LLVM_PROJECT=/llvm-project +ENV PATH=${LLVM_PROJECT}/build/bin:${PATH} +RUN apt-get update +RUN DEBIAN_FRONTEND="noninteractive" apt-get install -y cmake g++ build-essential python3 +RUN apt-get install zlib1g-dev \ No newline at end of file