Skip to content

Add GitHub Actions CI - #5

Merged
justagist merged 4 commits into
mainfrom
ci
Oct 15, 2026
Merged

justagist merged 4 commits into
mainfrom
ci

Conversation

@justagist

@justagist justagist commented Oct 15, 2026 •

Copy link
Copy Markdown
Owner

Builds and tests the repo on every PR and on pushes to main, via two jobs:

  • standalone: plain CMake build of piper_cpp on ubuntu-24.04 with no ROS, as documented
    in piper_cpp/README.md.
  • ros: colcon build of piper_cpp, piper_cpp_ros and piper_cpp_moveit in the ros:jazzy
    container, followed by colcon test.

Test steps and libgtest-dev are included now so upcoming PRs only need to add tests.
No format check yet: several files currently fail clang-format, so that needs a
separate reformat first.

Also adds CI, licence, ROS distro and C++ standard badges to the top-level and
per-package READMEs.

Summary by Sourcery

Add GitHub Actions CI to build and test the standalone and ROS packages on supported changes.

Enhancements:

  • Add automated standalone CMake and ROS 2 Jazzy build and test validation for pull requests and pushes to main.
  • Add project and package badges for CI status, licensing, supported ROS distribution, and C++ standard.

CI:

  • Run standalone and ROS build/test jobs in GitHub Actions with required system and ROS dependencies.

Documentation:

  • Update README files with project status and compatibility badges and correct package license references.

@sourcery-ai

sourcery-ai Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

This PR introduces GitHub Actions CI that independently validates the standalone CMake library and the ROS 2 Jazzy packages on pull requests and main-branch pushes, including dependency installation and test execution, and adds badges documenting CI, licensing, ROS distribution, and C++ standard support.

Sequence diagram for standalone CI validation

sequenceDiagram
    participant Actions as GitHub Actions
    participant CMake as CMake
    participant CTest as CTest
    Actions->>CMake: cmake -S piper_cpp -B build
    Actions->>CMake: cmake --build build -j
    Actions->>CTest: ctest --test-dir build --output-on-failure
    CTest-->>Actions: Test result
Loading

Sequence diagram for ROS CI validation

sequenceDiagram
    participant Actions as GitHub Actions
    participant ROS as ROS 2 Jazzy container
    participant Colcon as Colcon
    Actions->>ROS: Install dependencies with rosdep install
    Actions->>Colcon: colcon build --packages-up-to piper_cpp_ros piper_cpp_moveit
    Actions->>Colcon: colcon test --packages-select piper_cpp piper_cpp_ros piper_cpp_moveit
    Colcon-->>Actions: colcon test-result --verbose
Loading

File-Level Changes

Change Details Files
Added GitHub Actions coverage for standalone and ROS builds/tests.
  • Runs plain CMake configure, Release build, and CTest on Ubuntu 24.04.
  • Runs Jazzy container-based dependency installation, colcon build, and colcon test for the ROS packages.
  • Installs dependencies that rosdep cannot infer, including SocketCAN and GoogleTest libraries.
  • Triggers CI for pull requests and pushes to main.
.github/workflows/ci.yml
Documented project status and supported build environments with README badges.
  • Added CI and MIT license badges to the top-level and package documentation.
  • Added ROS 2 Jazzy badges to the top-level, ROS, and MoveIt documentation.
  • Added C++17 badges to the top-level, standalone library, and ROS documentation.
README.md
piper_cpp/README.md
piper_cpp_ros/README.md
piper_cpp_moveit/README.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@coderabbitai

coderabbitai Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ed35c31b-179e-4736-882b-fc8be81a295d
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

sourcery-ai[bot]
sourcery-ai Bot previously approved these changes Oct 15, 2026

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Sourcery assessment

Approved.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've found 5 issues

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path=".github/workflows/ci.yml" line_range="14" />
<code_context>
+  standalone:
+    runs-on: ubuntu-24.04
+    steps:
+      - uses: actions/checkout@v4
+      - name: Install dependencies
+        run: |
</code_context>
<issue_to_address>
**Pull requests expose repository token**

When an untrusted pull request changes build inputs that execute during CI, `actions/checkout@v4` persists its `GITHUB_TOKEN` in the checked-out Git config, and the subsequent CMake and colcon builds execute pull-request-controlled files. A malicious PR can read and exfiltrate the token, using whatever repository permissions are configured, potentially including write access.

Set least-privilege workflow permissions (for example, `contents: read`) and set `persist-credentials: false` on both checkout steps.

Also at `.github/workflows/ci.yml:31`.
</issue_to_address>

### Comment 2
<location path=".github/workflows/ci.yml" line_range="31" />
<code_context>
+  standalone:
+    runs-on: ubuntu-24.04
+    steps:
+      - uses: actions/checkout@v4
+      - name: Install dependencies
+        run: |
</code_context>
<issue_to_address>
**ROS job cannot check out code**

When the ROS job starts in the `ros:jazzy` container, `actions/checkout@v4` runs as a JavaScript action and requires its Node runtime in the job container; the `ros:jazzy` container has no Node installation step, so checkout fails before the workflow's install steps can run.

Run the ROS job in an image that includes the required Node runtime, or use a runner setup that does not execute checkout inside a container without Node.
</issue_to_address>

### Comment 3
<location path=".github/workflows/ci.yml" line_range="41" />
<code_context>
+          apt-get update
+          apt-get install -y --no-install-recommends libsocketcan-dev libgtest-dev
+          rosdep update
+          rosdep install --from-paths src --ignore-src -y --skip-keys piper_description
+      - name: Build
+        shell: bash
</code_context>
<issue_to_address>
**ROS build cannot resolve piper_cpp**

When the ROS job processes this workspace, `rosdep` treats `piper_cpp` as an unresolved dependency because it has no `package.xml`, and colcon cannot discover or build/install this plain CMake project. `piper_cpp_ros` then fails at `find_package(piper_cpp REQUIRED)`, so the ROS job never completes its build or tests.

Make `piper_cpp` recognizable to rosdep and colcon, and build and install it in the workflow with its CMake install prefix available to `piper_cpp_ros`.

Also at `.github/workflows/ci.yml:46`.
</issue_to_address>

### Comment 4
<location path=".github/workflows/ci.yml" line_range="39" />
<code_context>
+        # piper_description is an external runtime dependency not needed to build.
+        run: |
+          apt-get update
+          apt-get install -y --no-install-recommends libsocketcan-dev libgtest-dev
+          rosdep update
+          rosdep install --from-paths src --ignore-src -y --skip-keys piper_description
</code_context>
<issue_to_address>
**ROS tools are missing**

When the `ros:jazzy` image lacks the ROS development tools, the dependency step does not install `python3-rosdep` or `python3-colcon-common-extensions`, so `rosdep update` or later colcon commands fail with command-not-found and the ROS job stops before its checks.

Install `python3-rosdep` and `python3-colcon-common-extensions` before running rosdep or colcon.
</issue_to_address>

### Comment 5
<location path=".github/workflows/ci.yml" line_range="25" />
<code_context>
+      - name: Build
+        run: cmake --build build -j
+      - name: Test
+        run: ctest --test-dir build --output-on-failure
+
+  ros:
</code_context>
<issue_to_address>
**Test steps run no tests**

When the current projects have no registered tests, `ctest` and `colcon test` succeed without executing tests, so CI reports a green test result without checking behavior.

Add and register tests with the relevant test frameworks, and configure the test steps to fail when no tests are found.

Also at `.github/workflows/ci.yml:26`, `.github/workflows/ci.yml:51`.
</issue_to_address>

Sourcery assessment

Approval pending. 5 findings to address first.

Blocking findings: .github/workflows/ci.yml:14, .github/workflows/ci.yml:31, .github/workflows/ci.yml:41, .github/workflows/ci.yml:39, .github/workflows/ci.yml:25


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread .github/workflows/ci.yml Outdated
Comment thread .github/workflows/ci.yml Outdated
Comment thread .github/workflows/ci.yml Outdated
Comment thread .github/workflows/ci.yml
Comment thread .github/workflows/ci.yml
@justagist
justagist requested a balanced review from Copilot October 15, 2026 08:48
@sourcery-ai
sourcery-ai Bot dismissed their stale review October 15, 2026 08:48

Sourcery withdrew this approval because the latest commits introduced blocking findings.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

The workflow matches the existing build structure, and no blocking issues were identified.

0 open findings

What changed in this PR

Adds GitHub Actions CI for the standalone C++ library and ROS packages on pull requests and pushes to main.

Changes:

  • Adds standalone CMake and ROS 2 Jazzy build/test jobs.
  • Adds status and compatibility badges and fixes license links.
File Description
README.md Adds project badges and fixes the license link.
piper_cpp/​README.md Adds CI, license, and C++17 badges.
piper_cpp_ros/​README.md Adds CI, license, ROS, and C++17 badges.
piper_cpp_moveit/​README.md Adds badges and fixes the license link.
.github/​workflows/​ci.yml Defines standalone and ROS build/test jobs.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@justagist
justagist merged commit d12c59c into main Oct 15, 2026
5 checks passed
@justagist
justagist deleted the ci branch October 19, 2026 08:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants