From c4f5fb2c36980fd1f5c9d591f7725cbaaf0d6d0a Mon Sep 17 00:00:00 2001 From: Divyanshu Madan Date: Sun, 22 Aug 2021 03:43:47 +0530 Subject: [PATCH] [pytest.yml] use docker --- .github/workflows/pytest.yml | 27 +++------------------------ 1 file changed, 3 insertions(+), 24 deletions(-) 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