mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-31 02:16:53 +08:00
CI: add ccache and S3 caching to clang-tidy workflow
- Switch from addnab/docker-run-action to native container directive - Use runs-on 16-core runner with S3 cache (extras=s3-cache) - Add ccache setup matching build_all_targets pattern - Run clang-tidy with -j16 to leverage all cores Signed-off-by: Ramon Roche <mrpollo@gmail.com>
This commit is contained in:
@@ -14,18 +14,45 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: [runs-on, runner=16cpu-linux-x64, "run-id=${{ github.run_id }}"]
|
runs-on: [runs-on, runner=16cpu-linux-x64, "run-id=${{ github.run_id }}", "extras=s3-cache"]
|
||||||
|
container:
|
||||||
|
image: px4io/px4-dev:v1.17.0-beta1
|
||||||
steps:
|
steps:
|
||||||
|
- uses: runs-on/action@v2
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
fetch-tags: true
|
fetch-tags: true
|
||||||
|
|
||||||
- name: Testing (clang-tidy)
|
- name: Git ownership workaround
|
||||||
uses: addnab/docker-run-action@v3
|
run: git config --system --add safe.directory '*'
|
||||||
|
|
||||||
|
- name: ccache cache
|
||||||
|
id: cc_restore
|
||||||
|
uses: runs-on/cache@v4
|
||||||
with:
|
with:
|
||||||
image: px4io/px4-dev:v1.17.0-beta1
|
path: ~/.ccache
|
||||||
options: -v ${{ github.workspace }}:/workspace
|
key: ccache-clang-tidy-${{ github.ref_name }}
|
||||||
run: |
|
restore-keys: |
|
||||||
cd /workspace
|
ccache-clang-tidy-${{ github.ref_name }}-
|
||||||
make -j16 clang-tidy
|
ccache-clang-tidy-main-
|
||||||
|
ccache-clang-tidy-
|
||||||
|
|
||||||
|
- name: ccache config and stats
|
||||||
|
run: |
|
||||||
|
mkdir -p ~/.ccache
|
||||||
|
echo "base_dir = ${GITHUB_WORKSPACE}" > ~/.ccache/ccache.conf
|
||||||
|
echo "compression = true" >> ~/.ccache/ccache.conf
|
||||||
|
echo "compression_level = 6" >> ~/.ccache/ccache.conf
|
||||||
|
echo "max_size = 120M" >> ~/.ccache/ccache.conf
|
||||||
|
echo "hash_dir = false" >> ~/.ccache/ccache.conf
|
||||||
|
echo "compiler_check = content" >> ~/.ccache/ccache.conf
|
||||||
|
ccache -s
|
||||||
|
ccache -z
|
||||||
|
|
||||||
|
- name: Testing (clang-tidy)
|
||||||
|
run: make -j16 clang-tidy
|
||||||
|
|
||||||
|
- name: ccache post-build stats
|
||||||
|
if: always()
|
||||||
|
run: ccache -s
|
||||||
|
|||||||
Reference in New Issue
Block a user