Add caching of the compiler's temporary files

This commit is contained in:
Ivan Zosimov 2022-04-18 17:57:33 +02:00
parent c8ed3f974d
commit 661954d154
6 changed files with 814 additions and 796 deletions

View file

@ -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) {