mirror of
https://github.com/actions/setup-go.git
synced 2025-07-16 20:15:14 -06:00
Add caching of the compiler's temporary files
This commit is contained in:
parent
c8ed3f974d
commit
661954d154
6 changed files with 814 additions and 796 deletions
|
@ -35,10 +35,12 @@ const cachePackages = async () => {
|
|||
|
||||
const cachePath = await getCacheDirectoryPath(packageManagerInfo);
|
||||
|
||||
if (!fs.existsSync(cachePath)) {
|
||||
throw new Error(
|
||||
`Cache folder path is retrieved but doesn't exist on disk: ${cachePath}`
|
||||
);
|
||||
for (let path of cachePath) {
|
||||
if (!fs.existsSync(path)) {
|
||||
throw new Error(
|
||||
`Cache folder path is retrieved but doesn't exist on disk: ${path}`
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (primaryKey === state) {
|
||||
|
@ -49,7 +51,7 @@ const cachePackages = async () => {
|
|||
}
|
||||
|
||||
try {
|
||||
await cache.saveCache([cachePath], primaryKey);
|
||||
await cache.saveCache(cachePath, primaryKey);
|
||||
core.info(`Cache saved with the key: ${primaryKey}`);
|
||||
} catch (error) {
|
||||
if (error.name === cache.ValidationError.name) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue