ci(actions): add composite actions and clang-tidy PR helper#27005
Merged
ci(actions): add composite actions and clang-tidy PR helper#27005
Conversation
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>
This was referenced Apr 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 onmainis 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-ccacherestores~/.ccachewith content-hash keys (prefix-ref-shawithrefandbase_reffallbacks), installs ccache optionally, and writesccache.confwith compression,hash_dir = false, andcompiler_check = content..github/actions/save-ccacheprints stats and saves the cache under the primary key produced bysetup-ccache, usingif: always()so it runs on failures too..github/actions/build-gazebo-sitlbuildspx4_sitl_defaultplus the Gazebo Classic plugins and printsccache -sbetween the two stages. Used byros_integration_tests.ymlin a later PR.Tools/ci/run-clang-tidy-pr.pydiffs the PR against its base, maps changed.cpp/.cfiles to translation units incompile_commands.json, grep-maps changed headers to TUs that include them, and invokesTools/run-clang-tidy.pyonly on that subset. Exits 0 silently when no C++ files changed or no TUs matched. Will be wired intoclang-tidy.ymlin 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
python3stdlib only, andpython3 -m py_compile Tools/ci/run-clang-tidy-pr.pyis clean.