From c58abe65650831eddb89b546954237b9d31ef465 Mon Sep 17 00:00:00 2001 From: youben11 Date: Wed, 4 Aug 2021 15:07:33 +0100 Subject: [PATCH] chore(ci): add python testing --- .github/workflows/conformance.yml | 4 ++-- builders/Dockerfile.zamalang-env | 2 +- compiler/Makefile | 5 ++++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/conformance.yml b/.github/workflows/conformance.yml index 38c36fd53..b95ba0385 100644 --- a/.github/workflows/conformance.yml +++ b/.github/workflows/conformance.yml @@ -28,5 +28,5 @@ jobs: image: ghcr.io/zama-ai/mlir@sha256:5b7adfbf4e28c5a7517ed0b2bb0347455dea86f495b3ba060f6bea70c9dc10d3 username: ${{ secrets.GHCR_LOGIN }} password: ${{ secrets.GHCR_PASSWORD }} - 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 + options: -v ${{ github.workspace }}:/workspace -e PYTHONPATH=/llvm-project/build/python:/workspace/compiler/build/python + 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/ all zamacompiler && make test && pip install pytest && make test_python diff --git a/builders/Dockerfile.zamalang-env b/builders/Dockerfile.zamalang-env index 59e35f143..2a3d1bb58 100644 --- a/builders/Dockerfile.zamalang-env +++ b/builders/Dockerfile.zamalang-env @@ -4,4 +4,4 @@ ENV PYTHONPATH=/llvm-project/build/python:/compiler/build/python:$PYTHONPATH COPY /compiler /compiler WORKDIR /compiler -RUN mkdir -p build && make -B build && make -C build all \ No newline at end of file +RUN mkdir -p build && make -B build && make -C build all zamacompiler \ No newline at end of file diff --git a/compiler/Makefile b/compiler/Makefile index 2f95b8096..db107e5c5 100644 --- a/compiler/Makefile +++ b/compiler/Makefile @@ -5,4 +5,7 @@ zamacompiler: make -C build/ zamacompiler test: - ${LLVM_PROJECT}/build/bin/llvm-lit -v tests/ \ No newline at end of file + ${LLVM_PROJECT}/build/bin/llvm-lit -v tests/ + +test_python: + pytest -v tests/python \ No newline at end of file