diff --git a/.github/workflows/clp-artifact-build.yaml b/.github/workflows/clp-artifact-build.yaml index 59b216b43c..9cbb0b6c4b 100644 --- a/.github/workflows/clp-artifact-build.yaml +++ b/.github/workflows/clp-artifact-build.yaml @@ -463,8 +463,10 @@ jobs: run: "chown $(id -u):$(id -g) -R ." shell: "bash" - # NOTE: We don't use the cache for scheduled runs so that they run lint:check-cpp-static-full - # on all files. + # NOTE: We don't restore the cache for `schedule` runs so that below, + # `lint:check-cpp-static-full` runs on all files. If we don't do this periodically, + # `lint:check-cpp-static-full` could miss issues in files that haven't changed but depend on + # files which have changed. - if: "'schedule' != github.event_name" name: "Restore lint:check-cpp-static-full cache" id: "cache-restore-lint-check-cpp-static-full" @@ -475,9 +477,10 @@ jobs: .task/checksum/utils-cpp-lint-clang-tidy-* build/lint-clang-tidy - # NOTE: We use a per-OS cache since different OSes may trigger different clang-tidy - # violations. - key: "main-branch-ubuntu-jammy-lint:check-cpp-static-full" + # NOTE: This key must be kept in-sync with the key prefix in the `actions/cache/save` step + # below (we can't use the output of the current step since `schedule` workflow runs don't + # run this step). + key: "lint:check-cpp-static-full-on-ubuntu-24.04" - uses: "./.github/actions/run-on-image" env: @@ -505,7 +508,15 @@ jobs: .task/checksum/lint-check-cpp-static-full .task/checksum/utils-cpp-lint-clang-tidy-* build/lint-clang-tidy - key: "${{steps.cache-restore-lint-check-cpp-static-full.outputs.cache-primary-key}}" + + # NOTE: This key prefix (without the hash) must be kept in-sync with the + # `actions/cache/restore` step above. + key: >- + lint:check-cpp-static-full-on-ubuntu-24.04-${{hashFiles( + '.task/checksum/lint-check-cpp-static-full', + '.task/checksum/utils-cpp-lint-clang-tidy-*', + 'build/lint-clang-tidy/**/*' + )}} package-image: name: "package-image" diff --git a/.github/workflows/clp-core-build-macos.yaml b/.github/workflows/clp-core-build-macos.yaml index a0c3522963..089d296f6c 100644 --- a/.github/workflows/clp-core-build-macos.yaml +++ b/.github/workflows/clp-core-build-macos.yaml @@ -94,8 +94,10 @@ jobs: --num-jobs $(getconf _NPROCESSORS_ONLN) --test-spec "~[Stopwatch]" - # NOTE: We don't use the cache for scheduled runs so that they run lint:check-cpp-static-full - # on all files. + # NOTE: We don't restore the cache for `schedule` runs so that below, + # `lint:check-cpp-static-full` runs on all files. If we don't do this periodically, + # `lint:check-cpp-static-full` could miss issues in files that haven't changed but depend on + # files which have changed. - if: "'schedule' != github.event_name" name: "Restore lint:check-cpp-static-full cache" id: "cache-restore-lint-check-cpp-static-full" @@ -106,9 +108,11 @@ jobs: .task/checksum/utils-cpp-lint-clang-tidy-* build/lint-clang-tidy - # NOTE: We use a per-OS cache since different OSes may trigger different clang-tidy - # violations. - key: "main-branch-${{matrix.os}}-lint:check-cpp-static-full" + # NOTE: This key must be kept in-sync with the key prefix in the `actions/cache/save` step + # below (we can't use the output of the current step since `schedule` workflow runs don't + # run this step). + key: "lint:check-cpp-static-full-on-${{matrix.os}}-with\ + -${{matrix.use_shared_libs == true && 'shared' || 'static'}}-libs" # TODO: When enough files are passing clang-tidy, switch to a full pass on schedule only. # - run: >- @@ -129,4 +133,14 @@ jobs: .task/checksum/lint-check-cpp-static-full .task/checksum/utils-cpp-lint-clang-tidy-* build/lint-clang-tidy - key: "${{steps.cache-restore-lint-check-cpp-static-full.outputs.cache-primary-key}}" + + # NOTE: This key prefix (without the hash) must be kept in-sync with the + # `actions/cache/restore` step above. + key: >- + lint:check-cpp-static-full-on-${{matrix.os}}-with-${{ + matrix.use_shared_libs == true && 'shared' || 'static' + }}-libs-${{hashFiles( + '.task/checksum/lint-check-cpp-static-full', + '.task/checksum/utils-cpp-lint-clang-tidy-*', + 'build/lint-clang-tidy/**/*' + )}}