add pinocchio paths to docker construction #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# build docker files with the gsplines installed | |
name: compilation | |
on: push | |
jobs: | |
deploy: | |
name: build image | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
docker_image: | |
- image_name: "rafa606/ros-opstop-vim-dev:noetic" | |
base_image: "rafa606/ros-gsplines-vim-dev:noetic" | |
ros_distro: "noetic" | |
- image_name: "rafa606/moveit-opstop-vim-dev:noetic" | |
base_image: "rafa606/moveit-gsplines-vim-dev:noetic" | |
ros_distro: "noetic" | |
steps: | |
- name: checkout code | |
uses: actions/checkout@main | |
with: | |
fetch-depth: 2 | |
submodules: recursive | |
- name: Check last modified time of Foo Dockerfile | |
id: image_modify_date | |
run: | | |
echo "image=$(date -d "$(curl -s https://hub.docker.com/v2/repositories/"$(echo ${{ matrix.docker_image.image_name }} | sed 's/:/\/tags\//')" | jq -r '.last_updated')" +%s)" >> $GITHUB_OUTPUT; | |
echo "base_image=$(date -d "$(curl -s https://hub.docker.com/v2/repositories/"$(echo ${{ matrix.docker_image.base_image }} | sed 's/:/\/tags\//')" | jq -r '.last_updated')" +%s)" >> $GITHUB_OUTPUT; | |
- name: Check last modified time of Foo Docker image | |
id: file_modify_date | |
run: | | |
echo "docker_file=$(date -d "$(git log -1 --format=%cd --date=iso -- ./docker/docker.dockerfile)" +%s)" >> $GITHUB_OUTPUT | |
echo "source=$(date -d "$(git log -1 --format=%cd --date=iso -- ./source)" +%s)" >> $GITHUB_OUTPUT | |
echo "include=$(date -d "$(git log -1 --format=%cd --date=iso -- ./include)" +%s)" >> $GITHUB_OUTPUT | |
echo "python=$(date -d "$(git log -1 --format=%cd --date=iso -- ./python)" +%s)" >> $GITHUB_OUTPUT | |
echo "bindings=$(date -d "$(git log -1 --format=%cd --date=iso -- ./bindings)" +%s)" >> $GITHUB_OUTPUT | |
- name: Login to DockerHub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: build and push ${{ matrix.docker_image.image_name }} | |
uses: docker/build-push-action@v3 | |
with: | |
tags: ${{ matrix.docker_image.image_name }} | |
file: docker/docker.dockerfile | |
push: true | |
build-args: | | |
BASEIMAGE=${{ matrix.docker_image.base_image }} | |
ROS_DISTRO=${{ matrix.docker_image.ros_distro }} | |
if: | | |
steps.image_modify_date.outputs.image < steps.file_modify_date.outputs.docker_file || | |
steps.image_modify_date.outputs.image < steps.file_modify_date.outputs.source || | |
steps.image_modify_date.outputs.image < steps.file_modify_date.outputs.include || | |
steps.image_modify_date.outputs.image < steps.file_modify_date.outputs.python || | |
steps.image_modify_date.outputs.image < steps.file_modify_date.outputs.bindings || | |
steps.image_modify_date.outputs.image < steps.image_modify_date.outputs.base_image | |
buildpackage: | |
name: build dep package | |
runs-on: ubuntu-latest | |
container: | |
image: ros:noetic-ros-core-focal | |
steps: | |
- name: Git Sumbodule Update ad build | |
run: | | |
apt-get update | |
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends -o Dpkg::Options::="--force-confnew" software-properties-common lsb-release curl wget | |
mkdir -p /etc/apt/keyrings | |
curl http://robotpkg.openrobots.org/packages/debian/robotpkg.asc | sudo tee /etc/apt/keyrings/robotpkg.asc | |
echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/robotpkg.asc] http://robotpkg.openrobots.org/packages/debian/pub $(lsb_release -cs) robotpkg" | sudo tee /etc/apt/sources.list.d/robotpkg.list | |
apt-get update | |
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends -o Dpkg::Options::="--force-confnew" git ros-noetic-ifopt libgtest-dev cmake build-essential libeigen3-dev ros-noetic-hpp-fcl robotpkg-pinocchio | |
export PATH=/opt/openrobots/bin:$PATH | |
export PKG_CONFIG_PATH=/opt/openrobots/lib/pkgconfig:$PKG_CONFIG_PATH | |
export LD_LIBRARY_PATH=/opt/openrobots/lib:$LD_LIBRARY_PATH | |
export PYTHONPATH=/opt/openrobots/lib/python3.10/site-packages:$PYTHONPATH # Adapt your desired python version here | |
export CMAKE_PREFIX_PATH=/opt/openrobots:$CMAKE_PREFIX_PATH | |
wget https://github.com/rafaelrojasmiliani/gsplines_cpp/releases/download/master/gsplines-0.0.1-amd64.deb | |
dpkg -i gsplines-0.0.1-amd64.deb | |
git clone --recursive https://github.com/rafaelrojasmiliani/opstop_cpp.git | |
cd opstop_cpp | |
mkdir build | |
cd build | |
bash -c "source /opt/ros/noetic/setup.bash && cmake .. -DBUILD_TESTING=OFF && make -j2 && cpack -G DEB" | |
- name: Upload binaries to release | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: opstop_cpp/build/opstop-0.0.1-amd64.deb | |
asset_name: opstop-0.0.1-amd64.deb | |
tag: ${{ github.ref }} | |
overwrite: true | |
body: "Debian pack compiled with standard ros noetic docker image" | |
buildpackage2: | |
name: build dep package with g++-11 | |
runs-on: ubuntu-latest | |
container: | |
image: ros:noetic-ros-core-focal | |
steps: | |
- name: Git Sumbodule Update ad build | |
run: | | |
apt-get update | |
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends -o Dpkg::Options::="--force-confnew" software-properties-common lsb-release curl wget | |
mkdir -p /etc/apt/keyrings | |
curl http://robotpkg.openrobots.org/packages/debian/robotpkg.asc | sudo tee /etc/apt/keyrings/robotpkg.asc | |
echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/robotpkg.asc] http://robotpkg.openrobots.org/packages/debian/pub $(lsb_release -cs) robotpkg" | sudo tee /etc/apt/sources.list.d/robotpkg.list | |
add-apt-repository ppa:ubuntu-toolchain-r/test | |
apt-get update | |
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends -o Dpkg::Options::="--force-confnew" git ros-noetic-ifopt libgtest-dev cmake build-essential libeigen3-dev gcc-11 g++-11 ros-noetic-hpp-fcl robotpkg-pinocchio | |
export PATH=/opt/openrobots/bin:$PATH | |
export PKG_CONFIG_PATH=/opt/openrobots/lib/pkgconfig:$PKG_CONFIG_PATH | |
export LD_LIBRARY_PATH=/opt/openrobots/lib:$LD_LIBRARY_PATH | |
export PYTHONPATH=/opt/openrobots/lib/python3.10/site-packages:$PYTHONPATH # Adapt your desired python version here | |
export CMAKE_PREFIX_PATH=/opt/openrobots:$CMAKE_PREFIX_PATH | |
bash -c 'update-alternatives \ | |
--install /usr/bin/gcc gcc /usr/bin/gcc-9 90 \ | |
--slave /usr/bin/g++ g++ /usr/bin/g++-9 \ | |
--slave /usr/bin/gcov gcov /usr/bin/gcov-9 \ | |
--slave /usr/bin/gcc-ar gcc-ar /usr/bin/gcc-ar-9 \ | |
--slave /usr/bin/gcc-ranlib gcc-ranlib /usr/bin/gcc-ranlib-9 && | |
update-alternatives \ | |
--install /usr/bin/gcc gcc /usr/bin/gcc-11 110 \ | |
--slave /usr/bin/g++ g++ /usr/bin/g++-11 \ | |
--slave /usr/bin/gcov gcov /usr/bin/gcov-11 \ | |
--slave /usr/bin/gcc-ar gcc-ar /usr/bin/gcc-ar-11 \ | |
--slave /usr/bin/gcc-ranlib gcc-ranlib /usr/bin/gcc-ranlib-11' | |
wget https://github.com/rafaelrojasmiliani/gsplines_cpp/releases/download/master/gsplines-0.0.1-gcc-11-amd64.deb | |
dpkg -i gsplines-0.0.1-gcc-11-amd64.deb | |
git clone --recursive https://github.com/rafaelrojasmiliani/opstop_cpp.git | |
cd opstop_cpp | |
mkdir build | |
cd build | |
bash -c "source /opt/ros/noetic/setup.bash && cmake .. -DBUILD_TESTING=OFF && make -j2 && cpack -G DEB" | |
- name: Upload binaries to release | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: opstop_cpp/build/opstop-0.0.1-amd64.deb | |
asset_name: opstop-0.0.1-gcc-11-amd64.deb | |
tag: ${{ github.ref }} | |
overwrite: true | |
body: "Debian pack compiled with g++-11" |