diff --git a/packages/cache/__tests__/saveCacheV2.test.ts b/packages/cache/__tests__/saveCacheV2.test.ts index e96c2ac9..317a3a53 100644 --- a/packages/cache/__tests__/saveCacheV2.test.ts +++ b/packages/cache/__tests__/saveCacheV2.test.ts @@ -59,39 +59,6 @@ test('save with missing input should fail', async () => { ) }) -test('save with large cache outputs should fail using', async () => { - const paths = 'node_modules' - const key = 'Linux-node-bb828da54c148048dd17899ba9fda624811cfb43' - const cachePaths = [path.resolve(paths)] - - const createTarMock = jest.spyOn(tar, 'createTar') - const logWarningMock = jest.spyOn(core, 'warning') - - const cacheSize = 11 * 1024 * 1024 * 1024 //~11GB, over the 10GB limit - jest - .spyOn(cacheUtils, 'getArchiveFileSizeInBytes') - .mockReturnValueOnce(cacheSize) - const compression = CompressionMethod.Gzip - const getCompressionMock = jest - .spyOn(cacheUtils, 'getCompressionMethod') - .mockReturnValueOnce(Promise.resolve(compression)) - - const cacheId = await saveCache([paths], key) - expect(cacheId).toBe(-1) - expect(logWarningMock).toHaveBeenCalledWith( - 'Failed to save: Cache size of ~11264 MB (11811160064 B) is over the 10GB limit, not saving cache.' - ) - - const archiveFolder = '/foo/bar' - - expect(createTarMock).toHaveBeenCalledWith( - archiveFolder, - cachePaths, - compression - ) - expect(getCompressionMock).toHaveBeenCalledTimes(1) -}) - test('create cache entry failure on non-ok response', async () => { const paths = ['node_modules'] const key = 'Linux-node-bb828da54c148048dd17899ba9fda624811cfb43' diff --git a/packages/cache/src/cache.ts b/packages/cache/src/cache.ts index c5ab4dc2..ec134a01 100644 --- a/packages/cache/src/cache.ts +++ b/packages/cache/src/cache.ts @@ -12,7 +12,6 @@ import { FinalizeCacheEntryUploadResponse, GetCacheEntryDownloadURLRequest } from './generated/results/api/v1/cache' -import {CacheFileSizeLimit} from './internal/constants' import {HttpClientError} from '@actions/http-client' export class ValidationError extends Error { constructor(message: string) { @@ -550,15 +549,6 @@ async function saveCacheV2( const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath) core.debug(`File Size: ${archiveFileSize}`) - // For GHES, this check will take place in ReserveCache API with enterprise file size limit - if (archiveFileSize > CacheFileSizeLimit && !isGhes()) { - throw new Error( - `Cache size of ~${Math.round( - archiveFileSize / (1024 * 1024) - )} MB (${archiveFileSize} B) is over the 10GB limit, not saving cache.` - ) - } - // Set the archive size in the options, will be used to display the upload progress options.archiveSizeBytes = archiveFileSize