From 5861b1f8458a5e0dbeb46fd25e286d4701049037 Mon Sep 17 00:00:00 2001 From: David Leins Date: Sun, 24 Sep 2023 21:38:52 +0200 Subject: [PATCH] build: add workflows based on moveit --- .codecov.yaml | 23 +++ .docker/ci-testing/Dockerfile | 14 ++ .docker/ci/Dockerfile | 52 ++++++ .docker/ci/mujoco_installer.sh | 26 +++ .docker/source/Dockerfile | 30 ++++ .dockerignore | 7 + .github/workflows/ci.yaml | 163 +++++++++++++++++++ .github/workflows/docker.yaml | 201 ++++++++++++++++++++++++ .github/workflows/downstream.rosinstall | 9 ++ .github/workflows/format.yaml | 45 ++++++ .github/workflows/upstream.rosinstall | 9 ++ mujoco_ros/CMakeLists.txt | 4 +- mujoco_ros/package.xml | 2 +- mujoco_ros_msgs/srv/Reload.srv | 2 +- mujoco_ros_pkgs/CMakeLists.txt | 2 +- 15 files changed, 584 insertions(+), 5 deletions(-) create mode 100644 .codecov.yaml create mode 100644 .docker/ci-testing/Dockerfile create mode 100644 .docker/ci/Dockerfile create mode 100755 .docker/ci/mujoco_installer.sh create mode 100644 .docker/source/Dockerfile create mode 100644 .dockerignore create mode 100644 .github/workflows/ci.yaml create mode 100644 .github/workflows/docker.yaml create mode 100644 .github/workflows/downstream.rosinstall create mode 100644 .github/workflows/format.yaml create mode 100644 .github/workflows/upstream.rosinstall diff --git a/.codecov.yaml b/.codecov.yaml new file mode 100644 index 0000000..cfaeca4 --- /dev/null +++ b/.codecov.yaml @@ -0,0 +1,23 @@ +coverage: + precision: 2 + round: up + range: "45...70" + status: + project: + default: + target: auto + threshold: 5% + patch: off + +# While UI is not being tested, ignore UI/rendering related files +ignore: + - mujoco_ros/include/mujoco_ros/offscreen_camera.h + - mujoco_ros/include/mujoco_ros/platform_ui_adapter.h + - mujoco_ros/include/mujoco_ros/viewer.h + - mujoco_ros/src/glfw_adapter.cc + - mujoco_ros/src/glfw_dispatch.cc + - mujoco_ros/src/lodepng.cpp + - mujoco_ros/src/offscreen_camera.cpp + - mujoco_ros/src/offscreen_rendering.cpp + - mujoco_ros/src/platform_ui_adapter.cc + - mujoco_ros/src/viewer.cpp diff --git a/.docker/ci-testing/Dockerfile b/.docker/ci-testing/Dockerfile new file mode 100644 index 0000000..75be5c1 --- /dev/null +++ b/.docker/ci-testing/Dockerfile @@ -0,0 +1,14 @@ +# mujoco_ros/mujoco_ros:noetic-ci-testing + +ARG IMAGE=noetic +FROM davidpl1/mujoco_ros:${IMAGE}-ci + +# Switch to ros-testing +RUN echo "deb http://packages.ros.org/ros-testing/ubuntu `lsb_release -cs` main" | tee /etc/apt/sources.list.d/ros1-latest.list + +# Upgrade packages to ros-testing and clean apt-cache within one RUN command +RUN apt-get -qq update && \ + apt-get -qq -y dist-upgrade && \ + # + # Clear apt-cache to reduce image size + rm -rf /var/lib/apt/lists/* diff --git a/.docker/ci/Dockerfile b/.docker/ci/Dockerfile new file mode 100644 index 0000000..0b2835c --- /dev/null +++ b/.docker/ci/Dockerfile @@ -0,0 +1,52 @@ +ARG ROS_DISTRO=noetic +FROM ros:${ROS_DISTRO}-ros-base + +ARG MUJOCO_VERSIONS=[2.3.6] + +ENV TERM xterm +ENV MUJOCO_DIR=/root/mujoco/2.3.6 + +# Setup temporary ROS workspace +WORKDIR /root/ws_mujoco + +# Copy MuJoCo ROS sources from docker context +COPY . src/mujoco_ros_pkgs + +# Combined commands for less stages +RUN \ + apt-get -q update && \ + apt-get -q -y dist-upgrade && \ + # + # Base dependencies + apt-get -q install --no-install-recommends -y \ + wget curl git sudo python3-wstool \ + # Build tools + python3-catkin-tools \ + clang clang-format-10 clang-tidy clang-tools \ + ccache && \ + # + # Install MuJoCo Versions + MUJOCO_VERSIONS=${MUJOCO_VERSIONS} ./src/mujoco_ros_pkgs/.docker/ci/mujoco_installer.sh >> mujoco_install.log && \ + # + # Add paths to generic mujoco installs + echo "export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:\$MUJOCO_DIR/lib:/usr/lib/nvidia\n \ + export CPATH=\$CPATH:\$MUJOCO_DIR/include\n \ + export LIBRARY_PATH=\$LIBRARY_PATH:\$MUJOCO_DIR/lib" >> ${HOME}/.bashrc && \ + # + # Download upstream repo dependencies + wstool init --shallow src ./src/mujoco_ros_pkgs/.github/workflows/upstream.rosinstall && \ + # + # Download all dependencies + rosdep update && \ + DEBIAN_FRONTEND=noninteractive \ + rosdep install -y --from-paths src --ignore-src --rosdistro ${ROS_DISTRO} --as-root=apt:false && \ + # Remove sources from the container + rm -rf src && \ + # + # Clear apt-cache to reduce image size + rm -rf /var/lib/apt/lists/* && \ + # + # Globally disable git security + git config --global --add safe.directory "*" + +ENV IN_DOCKER 1 diff --git a/.docker/ci/mujoco_installer.sh b/.docker/ci/mujoco_installer.sh new file mode 100755 index 0000000..e2d02ad --- /dev/null +++ b/.docker/ci/mujoco_installer.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +mkdir -p ${HOME}/mujoco +rm -rf ${HOME}/mujoco/* +echo parsing MuJoCo versions: $MUJOCO_VERSIONS +newstr=$(echo $MUJOCO_VERSIONS | sed 's/\[//' ) # remove [ +newstr2=$(echo $newstr | sed 's/\]//' ) # remove ] +IFS=, # split on , +read -r -a versions <<< "$newstr2" +#set -o noglob # disable glob +#set -- $newstr2 # split+glob with glob disabled + +for mj_version in "${versions[@]}" +do + echo "installing MuJoCo Version ${mj_version} ..." + available=$(curl -o /dev/null --silent -Iw '%{http_code}' \ + https://github.com/google-deepmind/mujoco/releases/download/${mj_version}/mujoco-${mj_version}-linux-x86_64.tar.gz) + if [[ $available -eq 404 ]]; then + echo "version ${mj_version} could not be found!" + continue + fi + curl -O -L https://github.com/google-deepmind/mujoco/releases/download/${mj_version}/mujoco-${mj_version}-linux-x86_64.tar.gz || echo "could not find version ${mj_version}!" + mkdir ${HOME}/mujoco/${mj_version} + tar -xzf mujoco-${mj_version}-linux-x86_64.tar.gz -C ${HOME}/mujoco/${mj_version} --strip-components 1 + rm mujoco-${mj_version}-linux-x86_64.tar.gz +done diff --git a/.docker/source/Dockerfile b/.docker/source/Dockerfile new file mode 100644 index 0000000..35a2d46 --- /dev/null +++ b/.docker/source/Dockerfile @@ -0,0 +1,30 @@ +ARG IMAGE=noetic + +FROM davidpl1/mujoco_ros:${IMAGE}-ci-testing + +ENV PYTHONIOENCODING UTF-8 +# Export ROS_UNDERLAY for downstream docker containers +ENV ROS_UNDERLAY /root/ws_mujoco/install +# Environment variable used in instructions on moveit.ros.org website for running clang-tidy +ENV CATKIN_WS $(realpath $ROS_UNDERLAY/..) +WORKDIR $ROS_UNDERLAY/.. + +# Copy MoveIt sources from docker context +COPY . src/mujoco_ros_pkgs + +# Commands are combined in single RUN statement with "apt/lists" folder removal to reduce image size +# https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#minimize-the-number-of-layers +RUN --mount=type=cache,target=/root/.ccache/ \ + # Enable ccache + PATH=/usr/lib/ccache:$PATH && \ + # Fetch required upstream sources for building + wstool init --shallow src src/mujoco_ros_pkgs/.github/workflows/upstream.rosinstall && \ + # + catkin config --extend /opt/ros/$ROS_DISTRO --install --cmake-args -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=ON && \ + # Status rate is limited so that just enough info is shown to keep Docker from timing out, + # but not too much such that the Docker log gets too long (another form of timeout) + catkin build --limit-status-rate 0.001 --no-notify && \ + ccache -s && \ + # + # Update /ros_entrypoint.sh to source our new workspace + sed -i "s#/opt/ros/\$ROS_DISTRO/setup.bash#$ROS_UNDERLAY/setup.sh#g" /ros_entrypoint.sh diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..f1185ad --- /dev/null +++ b/.dockerignore @@ -0,0 +1,7 @@ +* + +!.docker/** +!.github/workflows/upstream.rosinstall +!.github/workflows/downstream.rosinstall +!**/package.xml +!**/CATKIN_IGNORE diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..1bdc230 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,163 @@ +name: CI + +on: + workflow_dispatch: + pull_request: + push: + branches: + - noetic-devel + - noetic-master + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + default: + strategy: + fail-fast: false + matrix: + env: + - IMAGE: noetic-ci + CCOV: true + BUILDER: catkin_tools_devel + MUJOCO_VERSION: 2.3.6 + # Skip 2.3.7 compability tests for now + # - IMAGE: noetic-ci + # CCOV: true + # BUILDER: catkin_tools_devel + # MUJOCO_VERSION: 2.3.7 + # There is no master at the time + # - IMAGE: master-ci + # MUJOCO_VERSION: 2.3.6 + # CATKIN_LINT: true + env: + DOCKER_RUN_OPTS: -e MUJOCO_DIR=/root/mujoco/${{ matrix.env.MUJOCO_VERSION }} + # CXXFLAGS: -Wall -Wextra -Wwrite-strings -Wunreachable-code -Wpointer-arith -Wredundant-decls + CXXFLAGS: -Wwrite-strings -Wunreachable-code -Wpointer-arith -Wredundant-decls + CLANG_TIDY_ARGS: --fix --fix-errors --format-style=file + DOCKER_IMAGE: docker.io/davidpl1/mujoco_ros:${{ matrix.env.IMAGE }} + UPSTREAM_WORKSPACE: .github/workflows/upstream.rosinstall + # DOWNSTREAM_WORKSPACE: .github/workflows/downstream.rosinstall + # Pull any updates to the upstream workspace + AFTER_SETUP_UPSTREAM_WORKSPACE: vcs pull $BASEDIR/upstream_ws/src + AFTER_SETUP_DOWNSTREAM_WORKSPACE: vcs pull $BASEDIR/downstream_ws/src + # Clear ccache stats before and log the stats after the build + AFTER_SETUP_CCACHE: ccache --zero-stats --max-size=10.0G + AFTER_BUILD_TARGET_WORKSPACE: ccache --show-stats + AFTER_BUILD_DOWNSTREAM_WORKSPACE: ccache --show-stats + # Compile CCOV with Debug. Enable -Werror. + TARGET_CMAKE_ARGS: > + -DCMAKE_BUILD_TYPE=${{ matrix.env.CCOV && 'Debug' || 'Release'}} + -DCMAKE_CXX_FLAGS="-Werror $CXXFLAGS${{ matrix.env.CCOV && ' --coverage -O2 -fno-omit-frame-pointer'}}" + UPSTREAM_CMAKE_ARGS: "-DCMAKE_CXX_FLAGS=''" + DOWNSTREAM_CMAKE_ARGS: -DCMAKE_CXX_FLAGS="-Wall -Wextra" + CCACHE_DIR: ${{ github.workspace }}/.ccache + BASEDIR: ${{ github.workspace }}/.work + CLANG_TIDY_BASE_REF: ${{ github.event_name != 'workflow_dispatch' && (github.base_ref || github.ref) || '' }} + BEFORE_CLANG_TIDY_CHECKS: | + # Show list of applied checks + (cd $TARGET_REPO_PATH; clang-tidy --list-checks) + BUILDER: ${{ matrix.env.BUILDER || 'catkin_tools' }} + CC: ${{ matrix.env.CLANG_TIDY && 'clang' }} + CXX: ${{ matrix.env.CLANG_TIDY && 'clang++' }} + + name: "${{ matrix.env.IMAGE }} mj-${{ matrix.env.MUJOCO_VERSION }}${{ matrix.env.CATKIN_LINT && ' + catkin_lint' || ''}}${{ matrix.env.CCOV && ' + ccov' || ''}}${{ matrix.env.IKFAST_TEST && ' + ikfast' || ''}}${{ matrix.env.CLANG_TIDY && (github.event_name != 'workflow_dispatch' && ' + clang-tidy (delta)' || ' + clang-tidy (all)') || '' }}" + runs-on: ubuntu-20.04 + steps: + - name: "Free up disk space" + if: matrix.env.CCOV + run: | + sudo apt-get -qq purge build-essential "ghc*" + sudo apt-get clean + # cleanup docker images not used by us + docker system prune -af + # shift ccache folder to /mnt on a separate disk + sudo mkdir -p /mnt/ccache + sudo mkdir ${{ env.CCACHE_DIR }} + sudo mount --bind ${{ env.CCACHE_DIR }} /mnt/ccache + # free up a lot of stuff from /usr/local + sudo rm -rf /usr/local + df -h + - uses: actions/checkout@v3 + - name: Cache upstream workspace + uses: rhaschke/cache@main + with: + path: ${{ env.BASEDIR }}/upstream_ws + key: ${{ env.CACHE_PREFIX }}-${{ github.run_id }} + restore-keys: ${{ env.CACHE_PREFIX }} + env: + GHA_CACHE_SAVE: always + CACHE_PREFIX: upstream_ws-${{ matrix.env.IMAGE }}-${{ hashFiles('.github/workflows/upstream.rosinstall', '.github/workflows/ci.yaml') }} + - name: Cache downstream workspace + uses: rhaschke/cache@main + with: + path: ${{ env.BASEDIR }}/downstream_ws + key: ${{ env.CACHE_PREFIX }}-${{ github.run_id }} + restore-keys: ${{ env.CACHE_PREFIX }} + env: + GHA_CACHE_SAVE: always + CACHE_PREFIX: downstream_ws-${{ matrix.env.IMAGE }}-${{ hashFiles('.github/workflows/downstream.rosinstall', '.github/workflows/ci.yaml') }} + # The target directory cache doesn't include the source directory because + # that comes from the checkout. See "prepare target_ws for cache" task below + - name: Cache target workspace + if: "!matrix.env.CCOV" + uses: rhaschke/cache@main + with: + path: ${{ env.BASEDIR }}/target_ws + key: ${{ env.CACHE_PREFIX }}-${{ github.run_id }} + restore-keys: ${{ env.CACHE_PREFIX }} + env: + GHA_CACHE_SAVE: always + CACHE_PREFIX: target_ws${{ matrix.env.CCOV && '-ccov' || '' }}-${{ matrix.env.IMAGE }}-${{ hashFiles('**/CMakeLists.txt', '**/package.xml', '.github/workflows/ci.yaml') }} + - name: Cache ccache + uses: rhaschke/cache@main + with: + path: ${{ env.CCACHE_DIR }} + key: ${{ env.CACHE_PREFIX }}-${{ github.sha }}-${{ github.run_id }} + restore-keys: | + ${{ env.CACHE_PREFIX }}-${{ github.sha }} + ${{ env.CACHE_PREFIX }} + env: + GHA_CACHE_SAVE: always + CACHE_PREFIX: ccache-${{ matrix.env.IMAGE }}${{ matrix.env.CCOV && '-ccov' || '' }} + + - id: ici + name: Run industrial_ci + uses: ros-industrial/industrial_ci@master + env: ${{ matrix.env }} + + - name: Upload test artifacts (on failure) + uses: actions/upload-artifact@v3 + if: failure() && (steps.ici.outputs.run_target_test || steps.ici.outputs.target_test_results) + with: + name: test-results-${{ matrix.env.IMAGE }} + path: ${{ env.BASEDIR }}/target_ws/**/test_results/**/*.xml + - name: Generate codecov report + uses: rhaschke/lcov-action@main + if: always() && matrix.env.CCOV && steps.ici.outputs.target_test_results == '0' + with: + docker: $DOCKER_IMAGE + workdir: ${{ env.BASEDIR }}/target_ws + ignore: '"*/target_ws/build/*" "*/target_ws/install/*" "*/test/*"' + - name: Upload codecov report + uses: codecov/codecov-action@v3 + if: always() && matrix.env.CCOV && steps.ici.outputs.target_test_results == '0' + with: + files: ${{ env.BASEDIR }}/target_ws/coverage.info + - name: Upload clang-tidy changes + uses: rhaschke/upload-git-patch-action@main + if: always() && matrix.env.CLANG_TIDY + with: + name: clang-tidy + path: ${{ env.BASEDIR }}/target_ws/src/$(basename $(pwd)) + - name: Prepare target_ws for cache + if: always() && !matrix.env.CCOV + run: | + du -sh ${{ env.BASEDIR }}/target_ws + sudo find ${{ env.BASEDIR }}/target_ws -wholename '*/test_results/*' -delete + sudo rm -rf ${{ env.BASEDIR }}/target_ws/src ${{ env.BASEDIR }}/target_ws/logs + du -sh ${{ env.BASEDIR }}/target_ws diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml new file mode 100644 index 0000000..75f75d7 --- /dev/null +++ b/.github/workflows/docker.yaml @@ -0,0 +1,201 @@ +name: Docker + +on: + schedule: + # 6 AM UTC every Sunday + - cron: "0 6 * * 6" + workflow_dispatch: + push: + branches: + - noetic-devel + - master + +concurrency: # cancel any previous workflow(s) from the same PR or branch/tag + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + # release: + # strategy: + # fail-fast: false + # matrix: + # ROS_DISTRO: [noetic] + # runs-on: ubuntu-latest + # permissions: + # packages: write + # contents: read + # env: + # IMAGE: mujoco_ros/mujoco_ros:${{ matrix.ROS_DISTRO }}-${{ github.job }} + + # steps: + # - name: Check for apt updates + # uses: rhaschke/docker-run-action@v4 + # continue-on-error: true + # id: apt + # with: + # image: ${{ env.IMAGE }} + # run: | + # apt-get update + # have_updates=$(apt-get --simulate upgrade | grep -q "^0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.$" && echo false || echo true) + # echo "no_cache=$have_updates" >> "$GITHUB_OUTPUT" + # - name: Set up Docker Buildx + # uses: docker/setup-buildx-action@v3 + # if: ${{ github.event_name == 'workflow_dispatch' || github.event_name != 'schedule' || steps.apt.outputs.no_cache }} + # - name: Login to GitLab Container Registry + # uses: docker/login-action@v3 + # with: + # registry: gitlab.ub.uni-bielefeld.de:4567 + # username: ${{ secrets.GITLAB_REG_USER }} + # password: ${{ secrets.GITLAB_REG_TOKEN }} + # - name: Build and push + # uses: docker/build-push-action@v5 + # if: ${{ github.event_name == 'workflow_dispatch' || github.event_name != 'schedule' || steps.apt.outputs.no_cache }} + # with: + # file: .docker/${{ github.job }}/Dockerfile + # build-args: ROS_DISTRO=${{ matrix.ROS_DISTRO }} + # push: true + # cache-to: type=inline + # tags: gitlab.ub.uni-bielefeld.de:4567/${{ env.IMAGE }} + + ci: + strategy: + fail-fast: false + matrix: + IMAGE: [noetic] + runs-on: ubuntu-latest + permissions: + packages: write + contents: read + env: + REGISTRY: docker.io + IMAGE: docker.io/davidpl1/mujoco_ros:${{ matrix.IMAGE }}-${{ github.job }} + ROS_DISTRO: noetic + MUJOCO_VERSIONS: '[2.3.6,2.3.7]' + + steps: + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + if: ${{ github.event_name == 'workflow_dispatch' || github.event_name != 'schedule' }} + - name: Login to Container Registry + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ secrets.DOCKERHUB_USER }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Check for apt updates + uses: rhaschke/docker-run-action@v4 + continue-on-error: true + id: apt + with: + image: ${{ env.IMAGE }} + shell: bash + run: | + apt-get update + have_updates=$(apt-get --simulate upgrade | grep -q "^0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.$" && echo false || echo true) + echo "no_cache=$have_updates" >> "$GITHUB_OUTPUT" + - name: Build and push + uses: docker/build-push-action@v5 + if: ${{ github.event_name == 'workflow_dispatch' || github.event_name != 'schedule' || steps.apt.outputs.no_cache }} + with: + file: .docker/${{ github.job }}/Dockerfile + build-args: | + ROS_DISTRO=${{ env.ROS_DISTRO }} + MUJOCO_VERSIONS=${{ env.MUJOCO_VERSIONS }} + + no-cache: true + # no-cache: ${{ steps.apt.outputs.no_cache || github.event_name == 'workflow_dispatch' }} + # no-cache: ${{ steps.apt.outputs.no_cache }} # TODO: remove this line, currently only to save time + cache-from: type=registry,ref=${{ env.IMAGE }} + cache-to: type=inline + push: true + tags: | + ${{ env.IMAGE }} + ${{ env.REGISTRY }}/davidpl1/mujoco_ros:master-ci-testing + + ci-testing: + needs: ci + strategy: + fail-fast: false + matrix: + IMAGE: [noetic] + runs-on: ubuntu-latest + permissions: + packages: write + contents: read + env: + IMAGE: docker.io/davidpl1/mujoco_ros:${{ matrix.IMAGE }}-${{ github.job }} + REGISTRY: docker.io + steps: + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + if: ${{ github.event_name == 'workflow_dispatch' || github.event_name != 'schedule' }} + - name: Login to Container Registry + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ secrets.DOCKERHUB_USER }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Check for apt updates + uses: rhaschke/docker-run-action@v4 + continue-on-error: true + id: apt + with: + image: ${{ env.IMAGE }} + run: | + apt-get update + have_updates=$(apt-get --simulate upgrade | grep -q "^0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.$" && echo false || echo true) + echo "no_cache=$have_updates" >> "$GITHUB_OUTPUT" + - name: Build and Push + uses: docker/build-push-action@v5 + if: ${{ github.event_name == 'workflow_dispatch' || github.event_name != 'schedule' || steps.apt.outputs.no_cache }} + with: + file: .docker/${{ github.job }}/Dockerfile + build-args: IMAGE=${{ matrix.IMAGE }} + no-cache: ${{ steps.apt.outputs.no_cache || github.event_name == 'workflow_dispatch' }} + cache-from: type=registry,ref=${{ env.IMAGE }} + cache-to: type=inline + push: true + tags: | + ${{ env.IMAGE }} + ${{ env.REGISTRY }}/davidpl1/mujoco_ros:${{ matrix.IMAGE }}-ci-shadow-fixed + + source: + needs: ci-testing + strategy: + fail-fast: false + matrix: + IMAGE: [noetic] + runs-on: ubuntu-latest + permissions: + packages: write + contents: read + env: + REGISTRY: docker.io + IMAGE: docker.io/davidpl1/mujoco_ros:${{ matrix.IMAGE }}-${{ github.job }} + ROS_DISTRO: noetic + + steps: + - uses: actions/checkout@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Login to Container Registry + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ secrets.DOCKERHUB_USER }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: "Remove .dockerignore" + run: rm .dockerignore # enforce full source context + continue-on-error: true + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: . + file: .docker/${{ github.job }}/Dockerfile + build-args: IMAGE=${{ matrix.IMAGE }} + cache-from: type=registry,ref=${{ env.IMAGE }} + cache-to: type=inline + push: true + tags: | + ${{ env.IMAGE }} + ${{ env.REGISTRY }}/davidpl1/mujoco_ros:master-ci-testing diff --git a/.github/workflows/downstream.rosinstall b/.github/workflows/downstream.rosinstall new file mode 100644 index 0000000..8943492 --- /dev/null +++ b/.github/workflows/downstream.rosinstall @@ -0,0 +1,9 @@ +- git: + local-name: franka_mujoco + uri: https://github.com/ubi-agni/franka_mujoco_ros.git + version: noetic-devel + +- git: + local-name: mujoco_ros_demos + uri: https://github.com/ubi-agni/mujoco_ros_demos.git + version: noetic-devel diff --git a/.github/workflows/format.yaml b/.github/workflows/format.yaml new file mode 100644 index 0000000..66ed45e --- /dev/null +++ b/.github/workflows/format.yaml @@ -0,0 +1,45 @@ +name: Format + +on: + workflow_dispatch: + pull_request: + push: + +permissions: + contents: read + +jobs: + pre-commit: + name: pre-commit + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v3 + - name: Check clang-format installed + id: clang-format-check + run: | + must_be_installed=$(whereis clang-format | grep -q "^clang-format:$" && echo true || echo false) + echo "must_be_installed=$must_be_installed" >> "$GITHUB_OUTPUT" + - name: Install clang-format + if: ${{ steps.clang-format-check.outputs.must_be_installed }} + run: sudo apt update && sudo apt install clang-format -y + - name: Install catkin_lint + run: | + sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list' + sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654 + sudo apt-get -q update + sudo apt-get -q -y install python3-rosdep + sudo rm -rf /etc/ros/rosdep/* + sudo rosdep init + rosdep update + sudo apt-get -q -y install catkin-lint + export ROS_DISTRO=${{ inputs.distro }} + # - name: Setup python + # run: sudo apt install -q -y python-is-python3 python3-pip + - uses: actions/setup-python@v4 + - uses: pre-commit/action@v3.0.0 + id: precommit + - name: Upload pre-commit changes + if: failure() && steps.precommit.outcome == 'failure' + uses: rhaschke/upload-git-patch-action@main + with: + name: pre-commit diff --git a/.github/workflows/upstream.rosinstall b/.github/workflows/upstream.rosinstall new file mode 100644 index 0000000..39ba8c6 --- /dev/null +++ b/.github/workflows/upstream.rosinstall @@ -0,0 +1,9 @@ +- git: + local-name: actionlib + uri: https://github.com/rhaschke/actionlib.git + version: noetic-devel + +#- git: +# local-name: moveit +# uri: https://github.com/ros-planning/moveit.git +# version: noetic-devel diff --git a/mujoco_ros/CMakeLists.txt b/mujoco_ros/CMakeLists.txt index 468ff3e..0ca62dd 100644 --- a/mujoco_ros/CMakeLists.txt +++ b/mujoco_ros/CMakeLists.txt @@ -45,7 +45,7 @@ find_package(catkin REQUIRED image_transport camera_info_manager sensor_msgs - moveit_ros_planning_interface + # moveit_ros_planning_interface ) # cmake-format: off @@ -107,7 +107,7 @@ catkin_package( image_transport camera_info_manager sensor_msgs - moveit_ros_planning_interface + # moveit_ros_planning_interface INCLUDE_DIRS include ${mujoco_INCLUDE_DIRS} diff --git a/mujoco_ros/package.xml b/mujoco_ros/package.xml index a40999a..cdd2619 100644 --- a/mujoco_ros/package.xml +++ b/mujoco_ros/package.xml @@ -23,7 +23,7 @@ image_transport camera_info_manager sensor_msgs - moveit_ros_planning_interface + urdf rostest diff --git a/mujoco_ros_msgs/srv/Reload.srv b/mujoco_ros_msgs/srv/Reload.srv index dab99fb..065a054 100644 --- a/mujoco_ros_msgs/srv/Reload.srv +++ b/mujoco_ros_msgs/srv/Reload.srv @@ -2,4 +2,4 @@ string model string admin_hash --- bool success -string status_message \ No newline at end of file +string status_message diff --git a/mujoco_ros_pkgs/CMakeLists.txt b/mujoco_ros_pkgs/CMakeLists.txt index a1b7b47..7d565a5 100644 --- a/mujoco_ros_pkgs/CMakeLists.txt +++ b/mujoco_ros_pkgs/CMakeLists.txt @@ -1,4 +1,4 @@ cmake_minimum_required(VERSION 3.0.2) project(mujoco_ros_pkgs) find_package(catkin REQUIRED) -catkin_metapackage() \ No newline at end of file +catkin_metapackage()