|
53 | 53 | run: "task deps:lib_install" |
54 | 54 |
|
55 | 55 | # NOTE: We don't use the cache for scheduled runs so that they run lint:cpp-static-check |
56 | | - # on all files. |
| 56 | + # NOTE: We don't restore the cache for `schedule` runs so that below, |
| 57 | + # `lint:cpp-static-check` runs on all files. If we don't do this periodically, |
| 58 | + # `lint:cpp-static-check` could miss issues in files that haven't changed but depend on |
| 59 | + # files which have changed. |
57 | 60 | - if: "'schedule' != github.event_name" |
58 | 61 | name: "Restore lint:cpp-static-check cache" |
59 | 62 | id: "cache-restore-lint-cpp-static-check" |
|
63 | 66 | .task/checksum/lint-cpp-static-check |
64 | 67 | .task/checksum/utils-cpp-lint-clang-tidy-* |
65 | 68 | build/lint-clang-tidy |
66 | | - key: "main-branch-ubuntu-latest-lint:cpp-static-check" |
| 69 | +
|
| 70 | + # NOTE: |
| 71 | + # * This key must be kept in-sync with the key prefix in the `actions/cache/save` step |
| 72 | + # below (we can't use the output of the current step since `schedule` workflow runs |
| 73 | + # don't run this step). |
| 74 | + # * Do not provide an exact (explicit) key here. Use a prefix so the cache action can |
| 75 | + # match and restore the most recent cache entry that shares that prefix. |
| 76 | + key: "lint:check-cpp-static-on-ubuntu-latest" |
67 | 77 |
|
68 | 78 | - run: "task lint:check -C $(nproc)" |
69 | 79 |
|
|
78 | 88 | .task/checksum/lint-cpp-static-check |
79 | 89 | .task/checksum/utils-cpp-lint-clang-tidy-* |
80 | 90 | build/lint-clang-tidy |
81 | | - key: "${{steps.cache-restore-lint-cpp-static-check.outputs.cache-primary-key}}" |
| 91 | +
|
| 92 | + # NOTE: This key prefix (without the hash) must be kept in-sync with the |
| 93 | + # `actions/cache/restore` step above. |
| 94 | + key: >- |
| 95 | + lint:check-cpp-static-on-ubuntu-latest-${{hashFiles( |
| 96 | + '.task/checksum/lint-cpp-static-check', |
| 97 | + '.task/checksum/utils-cpp-lint-clang-tidy-*', |
| 98 | + 'build/lint-clang-tidy/**/*' |
| 99 | + )}} |
0 commit comments