Skip to content

ci(actions): add composite actions and clang-tidy PR helper#27005

Merged
mrpollo merged 1 commit intomainfrom
mrpollo/ci-composite-actions
Apr 8, 2026
Merged

ci(actions): add composite actions and clang-tidy PR helper#27005
mrpollo merged 1 commit intomainfrom
mrpollo/ci-composite-actions

Conversation

@mrpollo
Copy link
Copy Markdown
Contributor

@mrpollo mrpollo commented Apr 8, 2026

Adds four reusable CI building blocks that upcoming optimization PRs will consume. No existing workflow is modified, so this change is dormant on merge: grep -r 'setup-ccache\|save-ccache\|build-gazebo-sitl\|run-clang-tidy-pr' .github/workflows/ returns nothing. CI behavior on main is unchanged by this PR.

Context: this is the foundation PR for a 6-PR series that back-ports the individual optimizations from #26257 (the orchestrator consolidation) without adopting the orchestrator architecture itself. Each follow-up PR will start referencing these files.

  • .github/actions/setup-ccache restores ~/.ccache with content-hash keys (prefix-ref-sha with ref and base_ref fallbacks), installs ccache optionally, and writes ccache.conf with compression, hash_dir = false, and compiler_check = content.
  • .github/actions/save-ccache prints stats and saves the cache under the primary key produced by setup-ccache, using if: always() so it runs on failures too.
  • .github/actions/build-gazebo-sitl builds px4_sitl_default plus the Gazebo Classic plugins and prints ccache -s between the two stages. Used by ros_integration_tests.yml in a later PR.
  • Tools/ci/run-clang-tidy-pr.py diffs the PR against its base, maps changed .cpp/.c files to translation units in compile_commands.json, grep-maps changed headers to TUs that include them, and invokes Tools/run-clang-tidy.py only on that subset. Exits 0 silently when no C++ files changed or no TUs matched. Will be wired into clang-tidy.yml in a later PR.

Nothing imports these yet, so the blast radius is zero. Verification: no workflow references them, the Python script is self-contained with python3 stdlib only, and python3 -m py_compile Tools/ci/run-clang-tidy-pr.py is clean.

Add four reusable building blocks that upcoming CI optimization PRs will
consume. No existing workflow is modified; these files are dormant until
referenced.

- .github/actions/setup-ccache: restore ~/.ccache with content-hash keys,
  write ccache.conf with compression and content-based compiler check
- .github/actions/save-ccache: print stats and save the cache under the
  primary key produced by setup-ccache
- .github/actions/build-gazebo-sitl: build px4_sitl_default plus the
  Gazebo Classic plugins with ccache stats between stages
- Tools/ci/run-clang-tidy-pr.py: compute the translation units affected
  by a PR diff and invoke Tools/run-clang-tidy.py on that subset only,
  exiting silently when no C++ files changed

Signed-off-by: Ramon Roche <mrpollo@gmail.com>
@mrpollo mrpollo merged commit eb9a76c into main Apr 8, 2026
79 checks passed
@mrpollo mrpollo deleted the mrpollo/ci-composite-actions branch April 8, 2026 19:14
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.

1 participant