Skip to content

Reduce CI runtime using ccache and path filters - #635

Merged
urfeex merged 6 commits into
UniversalRobots:masterfrom
urfeex:optimize_ci
Nov 24, 2026
Merged

urfeex merged 6 commits into
UniversalRobots:masterfrom
urfeex:optimize_ci

Conversation

@urfeex

@urfeex urfeex commented Nov 24, 2026 •

Copy link
Copy Markdown
Member

Attempt to reduce CI runtimes by

  • Skipping builds if no source files changed (e.g. doc-only changes)
  • Using ccache in builds to get to the tests faster
  • Cancel ongoing runs if a new push comes in on the same branch

This way, rebuilds e.g. for doc-only changes are skipped.
This should speed up builds tremendously, getting to the actual tests
faster.
@urfeex urfeex added the CI label Nov 24, 2026
Copilot AI balanced review requested due to automatic review settings November 24, 2026 05:00
@codecov

codecov Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.90%. Comparing base (f53cd97) to head (c2dee1a).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #635   +/-   ##
=======================================
  Coverage   83.90%   83.90%           
=======================================
  Files         128      128           
  Lines        8564     8564           
  Branches     3914     3914           
=======================================
  Hits         7186     7186           
+ Misses        967      966    -1     
- Partials      411      412    +1     
Flag Coverage Δ
python_scripts 49.69% <ø> (ø)
start_ursim 89.31% <ø> (+0.25%) ⬆️
unit 64.25% <ø> (+0.02%) ⬆️
ur20-latest 81.56% <ø> (-0.03%) ⬇️
ur5-3.14.3 81.37% <ø> (-0.03%) ⬇️
ur5e-10.11.0 77.16% <ø> (+0.02%) ⬆️
ur5e-10.12.0 78.11% <ø> (+0.03%) ⬆️
ur5e-10.7.0 76.76% <ø> (+0.03%) ⬆️
ur5e-5.9.4 81.50% <ø> (-0.03%) ⬇️
ur7e-10.13.0 78.44% <ø> (-0.02%) ⬇️
ur7e-10.14.0 78.73% <ø> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The Alpine cache action lacks the GNU tar needed to save archives, and CI filters exclude configuration and dependency files that require validation.

2 open issues
What changed in this PR

This PR aims to reduce CI runtimes by skipping unrelated pull-request changes and reusing compiled objects in selected builds.

Changes:

  • Add pull-request path filters to six build and test workflows.
  • Enable persistent ccache storage for Ubuntu integration, unit-coverage, and Alpine builds.
  • Report cache statistics after compilation.
File Description
.github/​workflows/​win-build.yml Filter pull requests by Windows build inputs.
.github/​workflows/​rhel_build.yml Filter pull requests by RHEL build and package inputs.
.github/​workflows/​mac-build.yml Filter pull requests by macOS build inputs.
.github/​workflows/​industrial-ci.yml Filter pull requests by ROS build, package, and script inputs.
.github/​workflows/​ci.yml Add path filtering and ccache to Ubuntu builds.
.github/​workflows/​alpine-build.yml Add path filtering and ccache to the Alpine build.

Review effort: Balanced

Comment thread .github/workflows/alpine-build.yml Resolved
Comment thread .github/workflows/ci.yml Resolved
Copilot AI balanced review requested due to automatic review settings November 24, 2026 06:55

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Alpine cache saves fail without GNU tar, and workflow path filters omit CI inputs and installed scripts, allowing relevant changes to bypass validation.

2 open issues
1 previously missed issue

In code that hasn't changed since last review

Medium severity Include scripts in the RHEL build workflow filter

.github/​workflows/​rhel_build.yml:16

Please include scripts/** here as well. This workflow runs colcon build, whose install phase installs scripts referenced by CMakeLists.txt (start_ursim.sh, tool_communication.py, and wait_robot_booted.py). A PR that only removes or renames one of those scripts now skips the RHEL build, hiding the resulting installation failure until after merging.

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings November 24, 2026 07:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The workflow path filters omit dependency and coverage configuration files and installed scripts, allowing affected pull requests to skip the CI and RHEL jobs that could catch tooling or installation failures.

1 open issue
2 previously missed issues

In code that hasn't changed since last review

Medium severity Path filter skips Gemfile and coverage tooling changes

.github/​workflows/​ci.yml:17

The new filter excludes Gemfile, Gemfile.lock, and .simplecov, but this workflow also runs test_start_ursim, which installs the bundled gems and uses bashcov to generate coverage (lines 477–482). A PR that only updates those dependencies or the coverage formatter now skips the job that exercises them, allowing broken test tooling to reach the push build. Include these three files in the path filter.

Medium severity Path filter skips changes to installed scripts

.github/​workflows/​rhel_build.yml:16

This filter omits scripts/**, although CMakeLists.txt:196–205 installs programs from that directory and the RHEL job uses colcon build, including installation. A PR that only deletes or renames an installed script now skips all RHEL builds instead of exposing the missing-file installation failure. Include scripts/** so changes to these package inputs still exercise the RHEL build.

1 resolved since last review

Review effort: Balanced

@urfeex

urfeex commented Nov 24, 2026

Copy link
Copy Markdown
Member Author

The ccache takes builds without changed source files from > 5 minutes down to < 15 seconds. Thus, we're getting to running our integration tests a lot faster.

@urfeex
urfeex marked this pull request as ready for review November 24, 2026 07:16
@cursor

cursor Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

PR Summary

Medium Risk
CI trigger and cancellation behavior changes could skip builds or abort runs reviewers still expect; no application runtime code is affected.

Overview
This PR speeds up CI by skipping heavyweight build workflows on pull requests unless relevant paths change (CMake, src/, tests/, etc.), so doc-only or unrelated edits no longer trigger Alpine, Ubuntu integration, macOS, Windows, RHEL, and industrial builds.

Compile caching is added on Alpine and the main Ubuntu jobs (ubuntu_build, unit_coverage): install ccache, restore/save cache via actions/cache, wire CMake compiler launchers, and print ccache -s after builds. The integration ubuntu_build step no longer installs python3-pandas / python3-lxml at image setup (those remain available where integration tests install them).

Concurrency is standardized across workflows so new pushes or PR commits cancel stale in-flight runs, while scheduled and workflow_dispatch runs are grouped separately so nightly/manual jobs are not auto-cancelled. update_rtde_fields now cancels superseded PR runs; sphinx_build moves concurrency from the job to the workflow level with the same push/PR cancel behavior.

Reviewed by Cursor Bugbot for commit c2dee1a. Bugbot is set up for automated code reviews on this repo. Configure here.

@urfeex
urfeex requested a review from urrsk November 24, 2026 07:17
@mergify

mergify Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

This pull request is merged.

@urfeex urfeex changed the title Optimize ci Reduce CI runtime using ccache and path filters Nov 24, 2026

@cursor cursor 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.

Cursor Bugbot has reviewed your changes using default effort and found 3 potential issues.

Fix All in Cursor

Reviewed by Cursor Bugbot for commit c2dee1a. Configure here.

Comment thread .github/workflows/ci.yml Resolved
Comment thread .github/workflows/ci.yml Resolved
Comment thread .github/workflows/ci.yml Resolved
@urfeex
urfeex merged commit 096c4ae into UniversalRobots:master Nov 24, 2026
100 of 102 checks passed
@urfeex
urfeex deleted the optimize_ci branch November 24, 2026 09:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants