From dbb7c65300a9434704e38e42ddae95cb10cc35b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20Fr=C3=B6hlich?= Date: Thu, 29 Jun 2023 14:18:07 +0200 Subject: [PATCH] Touchup Dockerfile and create a workflow building it (#323) --- .github/workflows/humble-docker-build.yaml | 22 +++++++++++++++++++++ .github/workflows/rolling-binary-build.yml | 5 ----- .github/workflows/rolling-docker-build.yaml | 22 +++++++++++++++++++++ Dockerfile/Dockerfile | 16 ++++++++++++--- 4 files changed, 57 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/humble-docker-build.yaml create mode 100644 .github/workflows/rolling-docker-build.yaml diff --git a/.github/workflows/humble-docker-build.yaml b/.github/workflows/humble-docker-build.yaml new file mode 100644 index 000000000..be2f12c47 --- /dev/null +++ b/.github/workflows/humble-docker-build.yaml @@ -0,0 +1,22 @@ +name: Build Humble Dockerfile +# description: builds the dockerfile contained within the repo + +on: + pull_request: + branches: + - humble + push: + branches: + - humble + schedule: + # Run every morning to detect broken dependencies + - cron: '40 1 * * *' + + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Build the Docker image + run: docker build . --file Dockerfile/Dockerfile --tag ros2_control_demos_humble diff --git a/.github/workflows/rolling-binary-build.yml b/.github/workflows/rolling-binary-build.yml index 3df16c819..f3d89c288 100644 --- a/.github/workflows/rolling-binary-build.yml +++ b/.github/workflows/rolling-binary-build.yml @@ -13,11 +13,6 @@ on: # Run every morning to detect flakiness and broken dependencies - cron: '03 1 * * *' -#TODO(christophfroehlich): remove once it is released -# otherwise ros-gz won't build -env: - GZ_VERSION: fortress - jobs: binary: uses: ./.github/workflows/reusable-industrial-ci-with-cache.yml diff --git a/.github/workflows/rolling-docker-build.yaml b/.github/workflows/rolling-docker-build.yaml new file mode 100644 index 000000000..5e9ff32f2 --- /dev/null +++ b/.github/workflows/rolling-docker-build.yaml @@ -0,0 +1,22 @@ +name: Build Rolling Dockerfile +# description: builds the dockerfile contained within the repo + +on: + pull_request: + branches: + - master + push: + branches: + - master + schedule: + # Run every morning to detect broken dependencies + - cron: '50 1 * * *' + + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Build the Docker image + run: docker build . --file Dockerfile/Dockerfile --tag ros2_control_demos_rolling diff --git a/Dockerfile/Dockerfile b/Dockerfile/Dockerfile index 3ffbc8699..b91229f27 100644 --- a/Dockerfile/Dockerfile +++ b/Dockerfile/Dockerfile @@ -5,13 +5,23 @@ FROM ros:${ROS_DISTRO}-ros-base ENV DEBIAN_FRONTEND noninteractive RUN apt-get update \ - && apt-get upgrade -y + && apt-get upgrade -y \ + && \ + : "remove cache" && \ + apt-get autoremove -y -qq && \ + rm -rf /var/lib/apt/lists/* COPY . /home/ros2_ws/src/ros2_control_demos RUN cd /home/ros2_ws/src \ - && rosdep update \ - && rosdep install --from-paths ./ -i -y --rosdistro ${ROS_DISTRO} --skip-keys rviz2 + && rosdep update --rosdistro ${ROS_DISTRO} \ + && apt-get update \ + && rosdep install --from-paths ./ -i -y --rosdistro ${ROS_DISTRO} \ + --skip-keys ros-${ROS_DISTRO}-joint-state-publisher-gui --skip-keys ros-${ROS_DISTRO}-rviz2\ + && \ + : "remove cache" && \ + apt-get autoremove -y -qq && \ + rm -rf /var/lib/apt/lists/* RUN cd /home/ros2_ws/ \ && . /opt/ros/${ROS_DISTRO}/setup.sh \