Skip to content

Commit

Permalink
Skip uploading empty caches
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael B. Gale committed Oct 29, 2024
1 parent 5b057af commit f3714ae
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
5 changes: 5 additions & 0 deletions lib/dependency-caching.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/dependency-caching.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions src/dependency-caching.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,15 @@ export async function uploadDependencyCaches(config: Config, logger: Logger) {
}

const size = await getTotalCacheSize(cacheConfig.paths, logger);

// Skip uploading an empty cache.
if (size === 0) {
logger.info(
`Skipping upload of dependency cache for ${language} since it is empty.`,
);
continue;
}

const key = await cacheKey(language, cacheConfig);

logger.info(
Expand Down

0 comments on commit f3714ae

Please sign in to comment.