Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use docker #29

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 3 additions & 24 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 10 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Comment on lines +6 to +8
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merge?


ENTRYPOINT [ "bash" ]
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ conan==1.31.0
pybind11==2.6.0
black==20.8b1
pytest==6.1.2
cmake==3.18.2
cmake==3.18.2
treelib==1.6.1