From 6a82f158ec6beedcfee58de20dd7199e97ffaabb Mon Sep 17 00:00:00 2001 From: Daniil Khaninaev <21182465+ikhann@users.noreply.github.com> Date: Sun, 16 Aug 2026 01:42:14 +0300 Subject: [PATCH] Add GitHub Actions CI and a devcontainer for the ROS 2 branches Revives the CI effort from #346, which was approved but stalled on a Ceres installation failure in 2023. Building inside the ros: container images avoids that class of problem entirely: the matching Ubuntu base and ROS apt sources come with the image, and rosdep resolves libceres-dev without additional setup. The workflow builds and tests every package except fuse_viz (blocked on Qt6 support, see #421) and fuse_doc (rosdoc2 configuration only). A weekly scheduled run catches breakage caused by upstream changes (new Boost, Ceres, or rclcpp releases) even when the repository is quiet - the failure modes of #396 and #423/#424/#425. A second job runs the google-benchmark suites in Release mode and uploads the results as an artifact. As a side effect this fixes the CodeQL "Analyze (actions)" check that currently fails on every pull request: the actions language analysis errors out with "CodeQL could not process any code written in GitHub Actions" because these branches contain no workflow files to scan. The devcontainer provides the same ros:rolling environment for local development, with rosdep dependency installation on create. --- .devcontainer/Dockerfile | 9 ++++ .devcontainer/devcontainer.json | 17 +++++++ .github/workflows/ci.yaml | 88 +++++++++++++++++++++++++++++++++ 3 files changed, 114 insertions(+) create mode 100644 .devcontainer/Dockerfile create mode 100644 .devcontainer/devcontainer.json create mode 100644 .github/workflows/ci.yaml diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 000000000..106d724ac --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,9 @@ +FROM ros:rolling + +RUN apt-get update && apt-get install -y --no-install-recommends \ + ccache \ + gdb \ + git \ + libbenchmark-dev \ + python3-vcstool \ + && rm -rf /var/lib/apt/lists/* diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 000000000..09c34fbf4 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,17 @@ +{ + "name": "fuse (ROS Rolling)", + "build": { + "dockerfile": "Dockerfile" + }, + "workspaceMount": "source=${localWorkspaceFolder},target=/ws/src/fuse,type=bind", + "workspaceFolder": "/ws/src/fuse", + "postCreateCommand": "rosdep update && rosdep install --from-paths /ws/src --ignore-src -y", + "customizations": { + "vscode": { + "extensions": [ + "ms-vscode.cpptools", + "ms-iot.vscode-ros" + ] + } + } +} diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 000000000..348ed3576 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,88 @@ +name: CI + +on: + push: + branches: + - rolling + pull_request: + schedule: + # Weekly build to catch breakage caused by upstream changes (new Boost, + # Ceres, or rclcpp releases) even when the repository itself is quiet. + - cron: '0 5 * * 1' + workflow_dispatch: + +jobs: + build-and-test: + strategy: + matrix: + include: + - ros_distro: rolling + fail-fast: false + runs-on: ubuntu-latest + container: + image: ros:${{ matrix.ros_distro }} + steps: + - uses: actions/checkout@v7 + - name: Install action dependencies + run: | + apt-get update + apt-get install -y --no-install-recommends git lcov python3-vcstool \ + python3-colcon-lcov-result python3-colcon-coveragepy-result + - uses: ros-tooling/action-ros-ci@v0.4 + with: + target-ros2-distro: ${{ matrix.ros_distro }} + # fuse_viz is excluded until Qt6 support lands (see #421). + # fuse_doc only holds the rosdoc2 configuration. + package-name: >- + fuse + fuse_msgs + fuse_core + fuse_graphs + fuse_loss + fuse_variables + fuse_constraints + fuse_models + fuse_optimizers + fuse_publishers + fuse_tutorials + + benchmarks: + runs-on: ubuntu-latest + container: + image: ros:rolling + steps: + - uses: actions/checkout@v7 + with: + path: src/fuse + - name: Install dependencies + run: | + apt-get update + apt-get install -y --no-install-recommends libbenchmark-dev + rosdep update --rosdistro "${ROS_DISTRO}" + rosdep install --from-paths src --ignore-src -y + - name: Build + shell: bash + run: | + # shellcheck disable=SC1090,SC1091 + source "/opt/ros/${ROS_DISTRO}/setup.bash" + colcon build --packages-up-to fuse_constraints fuse_graphs fuse_models \ + --cmake-args -DCMAKE_BUILD_TYPE=Release + - name: Run benchmarks + shell: bash + run: | + # shellcheck disable=SC1090,SC1091 + source install/setup.bash + mkdir -p benchmark_results + for benchmark in \ + build/fuse_constraints/benchmark/benchmark_normal_delta_pose_2d \ + build/fuse_constraints/benchmark/benchmark_normal_prior_pose_2d \ + build/fuse_graphs/benchmark_create_problem \ + build/fuse_models/benchmark/benchmark_unicycle_2d_state_cost_function + do + "${benchmark}" --benchmark_out="benchmark_results/$(basename "${benchmark}").json" \ + --benchmark_out_format=json + done + - uses: actions/upload-artifact@v7 + with: + name: benchmark-results + path: benchmark_results/