Loading __tests__/restore.test.ts +3 −1 Changes for __tests__/restore.test.ts: 3 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -319,7 +319,7 @@ test("restore with a pull request event and cache found", async () => { const setCacheStateMock = jest.spyOn(actionUtils, "setCacheState"); const downloadCacheMock = jest.spyOn(cacheHttpClient, "downloadCache"); const fileSize = 142; const fileSize = 62915000; const getArchiveFileSizeMock = jest .spyOn(actionUtils, "getArchiveFileSize") .mockReturnValue(fileSize); Loading @@ -336,6 +336,7 @@ test("restore with a pull request event and cache found", async () => { expect(createTempDirectoryMock).toHaveBeenCalledTimes(1); expect(downloadCacheMock).toHaveBeenCalledWith(cacheEntry, archivePath); expect(getArchiveFileSizeMock).toHaveBeenCalledWith(archivePath); expect(infoMock).toHaveBeenCalledWith(`Cache Size: ~60 MB (62915000 B)`); expect(mkdirMock).toHaveBeenCalledWith(cachePath); const IS_WINDOWS = process.platform === "win32"; Loading Loading @@ -412,6 +413,7 @@ test("restore with cache found for restore key", async () => { expect(createTempDirectoryMock).toHaveBeenCalledTimes(1); expect(downloadCacheMock).toHaveBeenCalledWith(cacheEntry, archivePath); expect(getArchiveFileSizeMock).toHaveBeenCalledWith(archivePath); expect(infoMock).toHaveBeenCalledWith(`Cache Size: ~0 MB (142 B)`); expect(mkdirMock).toHaveBeenCalledWith(cachePath); const IS_WINDOWS = process.platform === "win32"; Loading src/restore.ts +5 −1 Changes for src/restore.ts: 5 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -80,7 +80,11 @@ async function run(): Promise<void> { await cacheHttpClient.downloadCache(cacheEntry, archivePath); const archiveFileSize = utils.getArchiveFileSize(archivePath); core.debug(`File Size: ${archiveFileSize}`); core.info( `Cache Size: ~${Math.round( archiveFileSize / (1024 * 1024) )} MB (${archiveFileSize} B)` ); io.mkdirP(cachePath); Loading src/save.ts +3 −1 Changes for src/save.ts: 3 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -57,7 +57,9 @@ async function run(): Promise<void> { core.debug(`File Size: ${archiveFileSize}`); if (archiveFileSize > fileSizeLimit) { core.warning( `Cache size of ${archiveFileSize} bytes is over the 400MB limit, not saving cache.` `Cache size of ~${Math.round( archiveFileSize / (1024 * 1024) )} MB (${archiveFileSize} B) is over the 400MB limit, not saving cache.` ); return; } Loading Loading
__tests__/restore.test.ts +3 −1 Changes for __tests__/restore.test.ts: 3 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -319,7 +319,7 @@ test("restore with a pull request event and cache found", async () => { const setCacheStateMock = jest.spyOn(actionUtils, "setCacheState"); const downloadCacheMock = jest.spyOn(cacheHttpClient, "downloadCache"); const fileSize = 142; const fileSize = 62915000; const getArchiveFileSizeMock = jest .spyOn(actionUtils, "getArchiveFileSize") .mockReturnValue(fileSize); Loading @@ -336,6 +336,7 @@ test("restore with a pull request event and cache found", async () => { expect(createTempDirectoryMock).toHaveBeenCalledTimes(1); expect(downloadCacheMock).toHaveBeenCalledWith(cacheEntry, archivePath); expect(getArchiveFileSizeMock).toHaveBeenCalledWith(archivePath); expect(infoMock).toHaveBeenCalledWith(`Cache Size: ~60 MB (62915000 B)`); expect(mkdirMock).toHaveBeenCalledWith(cachePath); const IS_WINDOWS = process.platform === "win32"; Loading Loading @@ -412,6 +413,7 @@ test("restore with cache found for restore key", async () => { expect(createTempDirectoryMock).toHaveBeenCalledTimes(1); expect(downloadCacheMock).toHaveBeenCalledWith(cacheEntry, archivePath); expect(getArchiveFileSizeMock).toHaveBeenCalledWith(archivePath); expect(infoMock).toHaveBeenCalledWith(`Cache Size: ~0 MB (142 B)`); expect(mkdirMock).toHaveBeenCalledWith(cachePath); const IS_WINDOWS = process.platform === "win32"; Loading
src/restore.ts +5 −1 Changes for src/restore.ts: 5 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -80,7 +80,11 @@ async function run(): Promise<void> { await cacheHttpClient.downloadCache(cacheEntry, archivePath); const archiveFileSize = utils.getArchiveFileSize(archivePath); core.debug(`File Size: ${archiveFileSize}`); core.info( `Cache Size: ~${Math.round( archiveFileSize / (1024 * 1024) )} MB (${archiveFileSize} B)` ); io.mkdirP(cachePath); Loading
src/save.ts +3 −1 Changes for src/save.ts: 3 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -57,7 +57,9 @@ async function run(): Promise<void> { core.debug(`File Size: ${archiveFileSize}`); if (archiveFileSize > fileSizeLimit) { core.warning( `Cache size of ${archiveFileSize} bytes is over the 400MB limit, not saving cache.` `Cache size of ~${Math.round( archiveFileSize / (1024 * 1024) )} MB (${archiveFileSize} B) is over the 400MB limit, not saving cache.` ); return; } Loading