diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 8d07cf1..84a9835 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -23,33 +23,12 @@ jobs: - name: Display python version run: python -c "import sys; print(sys.version)" - # Install pip and packages - - name: Install pip - run: python -m pip install --upgrade pip - - - name: Install packages - run: pip install pytest treelib - - # Install clang and it's python inteface via apt - - name: Add llvm keys - run: | - wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - - echo 'deb http://apt.llvm.org/focal/ llvm-toolchain-focal-12 main' | sudo tee -a /etc/apt/sources.list - echo 'deb-src http://apt.llvm.org/focal/ llvm-toolchain-focal-12 main' | sudo tee -a /etc/apt/sources.list - - name: Install libclang and its python bindings - run: | - sudo apt-get update - sudo apt-get install -y libclang-12-dev python3-clang-12 - - # Add dist-package to path to enable apt installed python3-clang import - - name: Add dist-packages to PYTHONPATH - run: echo "PYTHONPATH=${PYTHON_PATH}:/usr/lib/python3/dist-packages" >> $GITHUB_ENV - - name: Display PYTHONPATH - run: python -c "import sys; print('\n'.join(sys.path))" + - name: Build docker + run: docker build --pull --rm -f "Dockerfile" -t pointcloudlibrary/clang-bind:latest "." # Test with pytest - name: Test with pytest - run: pytest --junitxml=${GITHUB_WORKSPACE}/result_${{ matrix.python-version }}.xml + run: docker run --rm -t pointcloudlibrary/clang-bind:latest -c "export PYTHONPATH=.; pytest --junitxml=${GITHUB_WORKSPACE}/result_${{ matrix.python-version }}.xml" # Artifacts - name: Upload pytest test results diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..1826917 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,10 @@ +FROM ubuntu:20.04 + +WORKDIR /clang-bind +COPY . . + +RUN apt-get update -y && apt-get install -y python3-pip libclang-12-dev python3-clang-12 + +RUN pip install -r requirements.txt + +ENTRYPOINT [ "bash" ] diff --git a/requirements.txt b/requirements.txt index 4f590eb..4cff5fd 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,4 +4,5 @@ conan==1.31.0 pybind11==2.6.0 black==20.8b1 pytest==6.1.2 -cmake==3.18.2 \ No newline at end of file +cmake==3.18.2 +treelib==1.6.1 \ No newline at end of file