Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,20 @@ jobs:
run: |
git config --global --add safe.directory "$PWD"
git fetch --no-tags -fu origin develop:develop
mkdir -p /cache/cppcheck
shell: bash

- name: Restore cppcheck cache
uses: actions/cache/restore@v5
with:
path: /cache/cppcheck
key: cppcheck-${{ hashFiles('contrib/containers/ci/ci-slim.Dockerfile') }}-${{ github.sha }}
restore-keys: |
cppcheck-${{ hashFiles('contrib/containers/ci/ci-slim.Dockerfile') }}-
Comment on lines +42 to +44

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Suggestion: Invalidate fallback caches when cppcheck configuration changes

Include test/lint/lint-cppcheck-dash.py in the cache configuration hash used here and in the save key at line 84. The restored prefix currently changes only with ci-slim.Dockerfile, so modifying the script's cppcheck command can restore analyzer data created with the previous configuration. In Cppcheck 2.21, CppCheck::calculateHash() includes the version, severity flags, defines, check level, and source tokens, but not mSettings.standards or the selected language. For example, changing --std=c++20 can therefore leave an unchanged translation unit's hash unchanged and cause Cppcheck to replay the old result rather than reanalyze it. A successful default-branch run would then save those stale results under the new commit key. Use hashFiles('contrib/containers/ci/ci-slim.Dockerfile', 'test/lint/lint-cppcheck-dash.py') consistently in the restore key, restore prefix, and save key.

source: ['codex']


- name: Run linters
run: |
export CACHE_DIR="/cache"
export BUILD_TARGET="linux64"
export CHECK_DOC=1

Expand All @@ -61,4 +71,14 @@ jobs:
git log --oneline ${COMMIT_RANGE} || echo "Could not show commit range"

./ci/dash/lint.sh
du -sh "${CACHE_DIR}/cppcheck"
shell: bash

- name: Save cppcheck cache
if: |
github.event_name == 'push' &&
github.ref_name == github.event.repository.default_branch
uses: actions/cache/save@v5
with:
path: /cache/cppcheck
key: cppcheck-${{ hashFiles('contrib/containers/ci/ci-slim.Dockerfile') }}-${{ github.sha }}
Loading