chore(compiler): Actions for build and test compiler

This commit is contained in:
Quentin Bourgerie
2021-06-09 12:01:18 +02:00
parent 428ba24807
commit b948c5c6a5
2 changed files with 37 additions and 2 deletions

View File

@@ -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

View File

@@ -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