Don't follow symlinks when hashing cache files (#10)

Fixes performance regression in 2eb83dc753
This commit is contained in:
Alex Rodionov 2024-03-13 10:28:27 -07:00 committed by GitHub
parent 1cc0c15a80
commit c033bc050f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 13 additions and 3 deletions

7
dist/post/index.js vendored
View file

@ -95859,7 +95859,12 @@ async function saveCache(cacheConfig) {
try {
core.startGroup(`Save cache for ${cacheConfig.name}`)
const paths = cacheConfig.paths
const hash = await glob.hashFiles(cacheConfig.files.join('\n'))
const hash = await glob.hashFiles(
cacheConfig.files.join('\n'),
undefined,
// We don't want to follow symlinks as it's extremely slow on macOS.
{ followSymbolicLinks: false }
)
const key = `${config.baseCacheKey}-${cacheConfig.name}-${hash}`
console.log(`Attempting to save ${paths} cache to ${key}`)
await cache.saveCache(paths, key)

File diff suppressed because one or more lines are too long