mirror of
				https://github.com/actions/cache.git
				synced 2025-10-31 20:08:36 +08:00 
			
		
		
		
	Add new actions/cache version (with dryRun support)
This commit is contained in:
		
							parent
							
								
									6fd2d4538c
								
							
						
					
					
						commit
						eda4a77b7c
					
				
							
								
								
									
										11
									
								
								dist/restore-only/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										11
									
								
								dist/restore-only/index.js
									
									
									
									
										vendored
									
									
								
							|  | @ -41808,7 +41808,8 @@ function getDownloadOptions(copy) { | ||||||
|         useAzureSdk: true, |         useAzureSdk: true, | ||||||
|         downloadConcurrency: 8, |         downloadConcurrency: 8, | ||||||
|         timeoutInMs: 30000, |         timeoutInMs: 30000, | ||||||
|         segmentTimeoutInMs: 3600000 |         segmentTimeoutInMs: 3600000, | ||||||
|  |         dryRun: false | ||||||
|     }; |     }; | ||||||
|     if (copy) { |     if (copy) { | ||||||
|         if (typeof copy.useAzureSdk === 'boolean') { |         if (typeof copy.useAzureSdk === 'boolean') { | ||||||
|  | @ -41823,6 +41824,9 @@ function getDownloadOptions(copy) { | ||||||
|         if (typeof copy.segmentTimeoutInMs === 'number') { |         if (typeof copy.segmentTimeoutInMs === 'number') { | ||||||
|             result.segmentTimeoutInMs = copy.segmentTimeoutInMs; |             result.segmentTimeoutInMs = copy.segmentTimeoutInMs; | ||||||
|         } |         } | ||||||
|  |         if (typeof copy.dryRun === 'boolean') { | ||||||
|  |             result.dryRun = copy.dryRun; | ||||||
|  |         } | ||||||
|     } |     } | ||||||
|     const segmentDownloadTimeoutMins = process.env['SEGMENT_DOWNLOAD_TIMEOUT_MINS']; |     const segmentDownloadTimeoutMins = process.env['SEGMENT_DOWNLOAD_TIMEOUT_MINS']; | ||||||
|     if (segmentDownloadTimeoutMins && |     if (segmentDownloadTimeoutMins && | ||||||
|  | @ -41835,6 +41839,7 @@ function getDownloadOptions(copy) { | ||||||
|     core.debug(`Request timeout (ms): ${result.timeoutInMs}`); |     core.debug(`Request timeout (ms): ${result.timeoutInMs}`); | ||||||
|     core.debug(`Cache segment download timeout mins env var: ${process.env['SEGMENT_DOWNLOAD_TIMEOUT_MINS']}`); |     core.debug(`Cache segment download timeout mins env var: ${process.env['SEGMENT_DOWNLOAD_TIMEOUT_MINS']}`); | ||||||
|     core.debug(`Segment download timeout (ms): ${result.segmentTimeoutInMs}`); |     core.debug(`Segment download timeout (ms): ${result.segmentTimeoutInMs}`); | ||||||
|  |     core.debug(`Dry run: ${result.dryRun}`); | ||||||
|     return result; |     return result; | ||||||
| } | } | ||||||
| exports.getDownloadOptions = getDownloadOptions; | exports.getDownloadOptions = getDownloadOptions; | ||||||
|  | @ -47283,6 +47288,10 @@ function restoreCache(paths, primaryKey, restoreKeys, options, enableCrossOsArch | ||||||
|                 // Cache not found
 |                 // Cache not found
 | ||||||
|                 return undefined; |                 return undefined; | ||||||
|             } |             } | ||||||
|  |             if (options === null || options === void 0 ? void 0 : options.dryRun) { | ||||||
|  |                 core.info('Dry run - skipping download'); | ||||||
|  |                 return cacheEntry.cacheKey; | ||||||
|  |             } | ||||||
|             archivePath = path.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); |             archivePath = path.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); | ||||||
|             core.debug(`Archive Path: ${archivePath}`); |             core.debug(`Archive Path: ${archivePath}`); | ||||||
|             // Download the cache from the cache entry
 |             // Download the cache from the cache entry
 | ||||||
|  |  | ||||||
							
								
								
									
										11
									
								
								dist/restore/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										11
									
								
								dist/restore/index.js
									
									
									
									
										vendored
									
									
								
							|  | @ -41779,7 +41779,8 @@ function getDownloadOptions(copy) { | ||||||
|         useAzureSdk: true, |         useAzureSdk: true, | ||||||
|         downloadConcurrency: 8, |         downloadConcurrency: 8, | ||||||
|         timeoutInMs: 30000, |         timeoutInMs: 30000, | ||||||
|         segmentTimeoutInMs: 3600000 |         segmentTimeoutInMs: 3600000, | ||||||
|  |         dryRun: false | ||||||
|     }; |     }; | ||||||
|     if (copy) { |     if (copy) { | ||||||
|         if (typeof copy.useAzureSdk === 'boolean') { |         if (typeof copy.useAzureSdk === 'boolean') { | ||||||
|  | @ -41794,6 +41795,9 @@ function getDownloadOptions(copy) { | ||||||
|         if (typeof copy.segmentTimeoutInMs === 'number') { |         if (typeof copy.segmentTimeoutInMs === 'number') { | ||||||
|             result.segmentTimeoutInMs = copy.segmentTimeoutInMs; |             result.segmentTimeoutInMs = copy.segmentTimeoutInMs; | ||||||
|         } |         } | ||||||
|  |         if (typeof copy.dryRun === 'boolean') { | ||||||
|  |             result.dryRun = copy.dryRun; | ||||||
|  |         } | ||||||
|     } |     } | ||||||
|     const segmentDownloadTimeoutMins = process.env['SEGMENT_DOWNLOAD_TIMEOUT_MINS']; |     const segmentDownloadTimeoutMins = process.env['SEGMENT_DOWNLOAD_TIMEOUT_MINS']; | ||||||
|     if (segmentDownloadTimeoutMins && |     if (segmentDownloadTimeoutMins && | ||||||
|  | @ -41806,6 +41810,7 @@ function getDownloadOptions(copy) { | ||||||
|     core.debug(`Request timeout (ms): ${result.timeoutInMs}`); |     core.debug(`Request timeout (ms): ${result.timeoutInMs}`); | ||||||
|     core.debug(`Cache segment download timeout mins env var: ${process.env['SEGMENT_DOWNLOAD_TIMEOUT_MINS']}`); |     core.debug(`Cache segment download timeout mins env var: ${process.env['SEGMENT_DOWNLOAD_TIMEOUT_MINS']}`); | ||||||
|     core.debug(`Segment download timeout (ms): ${result.segmentTimeoutInMs}`); |     core.debug(`Segment download timeout (ms): ${result.segmentTimeoutInMs}`); | ||||||
|  |     core.debug(`Dry run: ${result.dryRun}`); | ||||||
|     return result; |     return result; | ||||||
| } | } | ||||||
| exports.getDownloadOptions = getDownloadOptions; | exports.getDownloadOptions = getDownloadOptions; | ||||||
|  | @ -47254,6 +47259,10 @@ function restoreCache(paths, primaryKey, restoreKeys, options, enableCrossOsArch | ||||||
|                 // Cache not found
 |                 // Cache not found
 | ||||||
|                 return undefined; |                 return undefined; | ||||||
|             } |             } | ||||||
|  |             if (options === null || options === void 0 ? void 0 : options.dryRun) { | ||||||
|  |                 core.info('Dry run - skipping download'); | ||||||
|  |                 return cacheEntry.cacheKey; | ||||||
|  |             } | ||||||
|             archivePath = path.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); |             archivePath = path.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); | ||||||
|             core.debug(`Archive Path: ${archivePath}`); |             core.debug(`Archive Path: ${archivePath}`); | ||||||
|             // Download the cache from the cache entry
 |             // Download the cache from the cache entry
 | ||||||
|  |  | ||||||
							
								
								
									
										11
									
								
								dist/save-only/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										11
									
								
								dist/save-only/index.js
									
									
									
									
										vendored
									
									
								
							|  | @ -41920,7 +41920,8 @@ function getDownloadOptions(copy) { | ||||||
|         useAzureSdk: true, |         useAzureSdk: true, | ||||||
|         downloadConcurrency: 8, |         downloadConcurrency: 8, | ||||||
|         timeoutInMs: 30000, |         timeoutInMs: 30000, | ||||||
|         segmentTimeoutInMs: 3600000 |         segmentTimeoutInMs: 3600000, | ||||||
|  |         dryRun: false | ||||||
|     }; |     }; | ||||||
|     if (copy) { |     if (copy) { | ||||||
|         if (typeof copy.useAzureSdk === 'boolean') { |         if (typeof copy.useAzureSdk === 'boolean') { | ||||||
|  | @ -41935,6 +41936,9 @@ function getDownloadOptions(copy) { | ||||||
|         if (typeof copy.segmentTimeoutInMs === 'number') { |         if (typeof copy.segmentTimeoutInMs === 'number') { | ||||||
|             result.segmentTimeoutInMs = copy.segmentTimeoutInMs; |             result.segmentTimeoutInMs = copy.segmentTimeoutInMs; | ||||||
|         } |         } | ||||||
|  |         if (typeof copy.dryRun === 'boolean') { | ||||||
|  |             result.dryRun = copy.dryRun; | ||||||
|  |         } | ||||||
|     } |     } | ||||||
|     const segmentDownloadTimeoutMins = process.env['SEGMENT_DOWNLOAD_TIMEOUT_MINS']; |     const segmentDownloadTimeoutMins = process.env['SEGMENT_DOWNLOAD_TIMEOUT_MINS']; | ||||||
|     if (segmentDownloadTimeoutMins && |     if (segmentDownloadTimeoutMins && | ||||||
|  | @ -41947,6 +41951,7 @@ function getDownloadOptions(copy) { | ||||||
|     core.debug(`Request timeout (ms): ${result.timeoutInMs}`); |     core.debug(`Request timeout (ms): ${result.timeoutInMs}`); | ||||||
|     core.debug(`Cache segment download timeout mins env var: ${process.env['SEGMENT_DOWNLOAD_TIMEOUT_MINS']}`); |     core.debug(`Cache segment download timeout mins env var: ${process.env['SEGMENT_DOWNLOAD_TIMEOUT_MINS']}`); | ||||||
|     core.debug(`Segment download timeout (ms): ${result.segmentTimeoutInMs}`); |     core.debug(`Segment download timeout (ms): ${result.segmentTimeoutInMs}`); | ||||||
|  |     core.debug(`Dry run: ${result.dryRun}`); | ||||||
|     return result; |     return result; | ||||||
| } | } | ||||||
| exports.getDownloadOptions = getDownloadOptions; | exports.getDownloadOptions = getDownloadOptions; | ||||||
|  | @ -47395,6 +47400,10 @@ function restoreCache(paths, primaryKey, restoreKeys, options, enableCrossOsArch | ||||||
|                 // Cache not found
 |                 // Cache not found
 | ||||||
|                 return undefined; |                 return undefined; | ||||||
|             } |             } | ||||||
|  |             if (options === null || options === void 0 ? void 0 : options.dryRun) { | ||||||
|  |                 core.info('Dry run - skipping download'); | ||||||
|  |                 return cacheEntry.cacheKey; | ||||||
|  |             } | ||||||
|             archivePath = path.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); |             archivePath = path.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); | ||||||
|             core.debug(`Archive Path: ${archivePath}`); |             core.debug(`Archive Path: ${archivePath}`); | ||||||
|             // Download the cache from the cache entry
 |             // Download the cache from the cache entry
 | ||||||
|  |  | ||||||
							
								
								
									
										11
									
								
								dist/save/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										11
									
								
								dist/save/index.js
									
									
									
									
										vendored
									
									
								
							|  | @ -41864,7 +41864,8 @@ function getDownloadOptions(copy) { | ||||||
|         useAzureSdk: true, |         useAzureSdk: true, | ||||||
|         downloadConcurrency: 8, |         downloadConcurrency: 8, | ||||||
|         timeoutInMs: 30000, |         timeoutInMs: 30000, | ||||||
|         segmentTimeoutInMs: 3600000 |         segmentTimeoutInMs: 3600000, | ||||||
|  |         dryRun: false | ||||||
|     }; |     }; | ||||||
|     if (copy) { |     if (copy) { | ||||||
|         if (typeof copy.useAzureSdk === 'boolean') { |         if (typeof copy.useAzureSdk === 'boolean') { | ||||||
|  | @ -41879,6 +41880,9 @@ function getDownloadOptions(copy) { | ||||||
|         if (typeof copy.segmentTimeoutInMs === 'number') { |         if (typeof copy.segmentTimeoutInMs === 'number') { | ||||||
|             result.segmentTimeoutInMs = copy.segmentTimeoutInMs; |             result.segmentTimeoutInMs = copy.segmentTimeoutInMs; | ||||||
|         } |         } | ||||||
|  |         if (typeof copy.dryRun === 'boolean') { | ||||||
|  |             result.dryRun = copy.dryRun; | ||||||
|  |         } | ||||||
|     } |     } | ||||||
|     const segmentDownloadTimeoutMins = process.env['SEGMENT_DOWNLOAD_TIMEOUT_MINS']; |     const segmentDownloadTimeoutMins = process.env['SEGMENT_DOWNLOAD_TIMEOUT_MINS']; | ||||||
|     if (segmentDownloadTimeoutMins && |     if (segmentDownloadTimeoutMins && | ||||||
|  | @ -41891,6 +41895,7 @@ function getDownloadOptions(copy) { | ||||||
|     core.debug(`Request timeout (ms): ${result.timeoutInMs}`); |     core.debug(`Request timeout (ms): ${result.timeoutInMs}`); | ||||||
|     core.debug(`Cache segment download timeout mins env var: ${process.env['SEGMENT_DOWNLOAD_TIMEOUT_MINS']}`); |     core.debug(`Cache segment download timeout mins env var: ${process.env['SEGMENT_DOWNLOAD_TIMEOUT_MINS']}`); | ||||||
|     core.debug(`Segment download timeout (ms): ${result.segmentTimeoutInMs}`); |     core.debug(`Segment download timeout (ms): ${result.segmentTimeoutInMs}`); | ||||||
|  |     core.debug(`Dry run: ${result.dryRun}`); | ||||||
|     return result; |     return result; | ||||||
| } | } | ||||||
| exports.getDownloadOptions = getDownloadOptions; | exports.getDownloadOptions = getDownloadOptions; | ||||||
|  | @ -47368,6 +47373,10 @@ function restoreCache(paths, primaryKey, restoreKeys, options, enableCrossOsArch | ||||||
|                 // Cache not found
 |                 // Cache not found
 | ||||||
|                 return undefined; |                 return undefined; | ||||||
|             } |             } | ||||||
|  |             if (options === null || options === void 0 ? void 0 : options.dryRun) { | ||||||
|  |                 core.info('Dry run - skipping download'); | ||||||
|  |                 return cacheEntry.cacheKey; | ||||||
|  |             } | ||||||
|             archivePath = path.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); |             archivePath = path.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); | ||||||
|             core.debug(`Archive Path: ${archivePath}`); |             core.debug(`Archive Path: ${archivePath}`); | ||||||
|             // Download the cache from the cache entry
 |             // Download the cache from the cache entry
 | ||||||
|  |  | ||||||
							
								
								
									
										12
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										12
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							|  | @ -9,7 +9,7 @@ | ||||||
|       "version": "3.2.2", |       "version": "3.2.2", | ||||||
|       "license": "MIT", |       "license": "MIT", | ||||||
|       "dependencies": { |       "dependencies": { | ||||||
|         "@actions/cache": "^3.1.2", |         "@actions/cache": "https://github.com/cdce8p/toolkit/raw/cache-dry-run-release/packages/cache/actions-cache-3.1.2.tgz", | ||||||
|         "@actions/core": "^1.10.0", |         "@actions/core": "^1.10.0", | ||||||
|         "@actions/exec": "^1.1.1", |         "@actions/exec": "^1.1.1", | ||||||
|         "@actions/io": "^1.1.2" |         "@actions/io": "^1.1.2" | ||||||
|  | @ -37,8 +37,9 @@ | ||||||
|     }, |     }, | ||||||
|     "node_modules/@actions/cache": { |     "node_modules/@actions/cache": { | ||||||
|       "version": "3.1.2", |       "version": "3.1.2", | ||||||
|       "resolved": "https://registry.npmjs.org/@actions/cache/-/cache-3.1.2.tgz", |       "resolved": "https://github.com/cdce8p/toolkit/raw/cache-dry-run-release/packages/cache/actions-cache-3.1.2.tgz", | ||||||
|       "integrity": "sha512-3XeKcXIonfIbqvW7gPm/VLOhv1RHQ1dtTgSBCH6OUhCgSTii9bEVgu0PIms7UbLnXeMCKFzECfpbud8fJEvBbQ==", |       "integrity": "sha512-1vcZXG2jWtEnDWq34byiQmS8tgOKAzFEIiMFPtxigm3vHOW+9FGdA2S+eWsK3NBLIbWd5erCkWgo4M0g6gw1yw==", | ||||||
|  |       "license": "MIT", | ||||||
|       "dependencies": { |       "dependencies": { | ||||||
|         "@actions/core": "^1.10.0", |         "@actions/core": "^1.10.0", | ||||||
|         "@actions/exec": "^1.0.1", |         "@actions/exec": "^1.0.1", | ||||||
|  | @ -9722,9 +9723,8 @@ | ||||||
|   }, |   }, | ||||||
|   "dependencies": { |   "dependencies": { | ||||||
|     "@actions/cache": { |     "@actions/cache": { | ||||||
|       "version": "3.1.2", |       "version": "https://github.com/cdce8p/toolkit/raw/cache-dry-run-release/packages/cache/actions-cache-3.1.2.tgz", | ||||||
|       "resolved": "https://registry.npmjs.org/@actions/cache/-/cache-3.1.2.tgz", |       "integrity": "sha512-1vcZXG2jWtEnDWq34byiQmS8tgOKAzFEIiMFPtxigm3vHOW+9FGdA2S+eWsK3NBLIbWd5erCkWgo4M0g6gw1yw==", | ||||||
|       "integrity": "sha512-3XeKcXIonfIbqvW7gPm/VLOhv1RHQ1dtTgSBCH6OUhCgSTii9bEVgu0PIms7UbLnXeMCKFzECfpbud8fJEvBbQ==", |  | ||||||
|       "requires": { |       "requires": { | ||||||
|         "@actions/core": "^1.10.0", |         "@actions/core": "^1.10.0", | ||||||
|         "@actions/exec": "^1.0.1", |         "@actions/exec": "^1.0.1", | ||||||
|  |  | ||||||
|  | @ -23,7 +23,7 @@ | ||||||
|   "author": "GitHub", |   "author": "GitHub", | ||||||
|   "license": "MIT", |   "license": "MIT", | ||||||
|   "dependencies": { |   "dependencies": { | ||||||
|     "@actions/cache": "^3.1.2", |     "@actions/cache": "https://github.com/cdce8p/toolkit/raw/cache-dry-run-release/packages/cache/actions-cache-3.1.2.tgz", | ||||||
|     "@actions/core": "^1.10.0", |     "@actions/core": "^1.10.0", | ||||||
|     "@actions/exec": "^1.1.1", |     "@actions/exec": "^1.1.1", | ||||||
|     "@actions/io": "^1.1.2" |     "@actions/io": "^1.1.2" | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Marc Mueller
						Marc Mueller