Skip to content

Commit ffe0aa1

Browse files
committed
Add extra validation when storing and restoring
Since we're supporting multi-path inputs: - Store must ensure caches exist for all inputs when it skips storing. - Restore must ensure caches exist for all inputs before it attempts restoring.
1 parent f250a8b commit ffe0aa1

6 files changed

Lines changed: 295 additions & 197 deletions

File tree

.idea/inspectionProfiles/Project_Default.xml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

product/dist/Restore.js

Lines changed: 82 additions & 55 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

product/dist/Store.js

Lines changed: 82 additions & 55 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

source/Test/IntegrationTest.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import fs from 'node:fs/promises';
44
import os from 'node:os';
55
import path from 'node:path';
66
import { beforeAll, describe, expect, it, vi } from 'vitest';
7-
import { processPath, restore, store } from '../Util';
7+
import { getLocalPath, restore, store } from '../Util';
88
import { generateFile, PRODUCT_PATH } from './Helper';
99

1010
// Silences actions logging / output.
@@ -46,7 +46,7 @@ describe('integration', () => {
4646

4747
// Verify that all files exist in the cache.
4848
for (const inputPath of Object.values(inputPaths)) {
49-
await fs.lstat(path.join(cacheDirPath, key, `${(await processPath(inputPath)).name}${compress ? '.tar' : ''}`));
49+
await fs.lstat(path.join(cacheDirPath, key, `${(await getLocalPath(inputPath)).cacheName}${compress ? '.tar' : ''}`));
5050
}
5151

5252
// Restore and move the project directory to a different location.

0 commit comments

Comments
 (0)