mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
Rename workflow to "Static Analysis" with job name "Clang-Tidy" for clearer GitHub Checks UI. Use Title Case action-verb step names. Switch from runs-on/cache to actions/cache since the runs-on Magic Cache sidecar transparently handles S3 backing. Signed-off-by: Ramon Roche <mrpollo@gmail.com>
70 lines
1.8 KiB
YAML
70 lines
1.8 KiB
YAML
name: Static Analysis
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- 'main'
|
|
paths-ignore:
|
|
- 'docs/**'
|
|
pull_request:
|
|
branches:
|
|
- '**'
|
|
paths-ignore:
|
|
- 'docs/**'
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
clang_tidy:
|
|
name: Clang-Tidy
|
|
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:
|
|
- uses: runs-on/action@v2
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
fetch-tags: true
|
|
|
|
- name: Configure Git Safe Directory
|
|
run: git config --system --add safe.directory '*'
|
|
|
|
- name: Restore Compiler Cache
|
|
id: cc_restore
|
|
uses: actions/cache/restore@v4
|
|
with:
|
|
path: ~/.ccache
|
|
key: ccache-clang-tidy-${{ github.head_ref || github.ref_name }}
|
|
restore-keys: |
|
|
ccache-clang-tidy-${{ github.head_ref || github.ref_name }}-
|
|
ccache-clang-tidy-main-
|
|
ccache-clang-tidy-
|
|
|
|
- name: Configure Compiler Cache
|
|
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: Run Clang-Tidy Analysis
|
|
run: make -j16 clang-tidy
|
|
|
|
- name: Compiler Cache Stats
|
|
if: always()
|
|
run: ccache -s
|
|
|
|
- name: Save Compiler Cache
|
|
if: always()
|
|
uses: actions/cache/save@v4
|
|
with:
|
|
path: ~/.ccache
|
|
key: ${{ steps.cc_restore.outputs.cache-primary-key }}
|