mirror of
				https://github.com/actions/cache.git
				synced 2025-10-31 07:16:24 +07:00 
			
		
		
		
	Preview v0.0.2 Release (#50)
* Create CODE_OF_CONDUCT.md * Update workflow (#1) * Run workflow on linux, mac, and windows * Add status badge * Use npm install instead * Bump typescript version * Use node 12.x * Add Ruby Gem example (#4) * Add Cocoapods example (#5) * Add Carthage example (#10) * Move examples to their own page (#13) * Minor typo in README (#15) from `steps.[ID].outupts.cache-hit` to `steps.[ID].outputs.cache-hit` * Update README.md * Prevent commands from executing during tests (#21) * Prevent commands from executing during tests * Add newline at end of file * Drop all commands from output * Link to NuGet lock files documentation (#20) * Add trailing dash to Maven fallback key (#19) * Fix README.md (#25) `restore-keys` had incorrect indentation. * Exclude documentation from CI tests (#28) * Ignore all .md files * Add note about time-based eviction to README (#30) * Fix typo in error message (#29) * Time based eviction interval is 1 week (#34) * Remove cache checksum debug - close #24 (#26) * Remove cache checksum debug - close #24 * Remove cache checksum debug on save * Fix formatting * Add Go modules example (#18) * Add Go modules example * Fix TOC * Fix repo name in contact email (#41) * Add Elixir Mix example (#42) * Add Elixir Mix example * Fix typo * Add cargo example for Rust project (#8) * Add cargo example * Add hash of Cargo.lock to keys of caches * Move Rust example to examples.md * Stop warning when cache is not found (#40) The cache not being found is a common situation so very visible warning is a little too much. * Bump package version * Release v0.0.2
This commit is contained in:
		
							
								
								
									
										28
									
								
								dist/restore/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										28
									
								
								dist/restore/index.js
									
									
									
									
										vendored
									
									
								
							| @ -1475,10 +1475,11 @@ exports.debug = debug; // for test | ||||
| "use strict"; | ||||
|  | ||||
| var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||||
|     function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||||
|     return new (P || (P = Promise))(function (resolve, reject) { | ||||
|         function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||||
|         function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||||
|         function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } | ||||
|         function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||||
|         step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||||
|     }); | ||||
| }; | ||||
| @ -1506,7 +1507,7 @@ function getCacheEntry(keys) { | ||||
|         ]); | ||||
|         const response = yield restClient.get(resource, getRequestOptions()); | ||||
|         if (response.statusCode === 204) { | ||||
|             throw new Error(`Cache not found for input keys: ${JSON.stringify(keys)}.`); | ||||
|             return null; | ||||
|         } | ||||
|         if (response.statusCode !== 200) { | ||||
|             throw new Error(`Cache service responded with ${response.statusCode}`); | ||||
| @ -2120,10 +2121,11 @@ exports.createType3Message = createType3Message; | ||||
| "use strict"; | ||||
|  | ||||
| var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||||
|     function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||||
|     return new (P || (P = Promise))(function (resolve, reject) { | ||||
|         function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||||
|         function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||||
|         function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } | ||||
|         function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||||
|         step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||||
|     }); | ||||
| }; | ||||
| @ -2200,7 +2202,7 @@ function resolvePath(filePath) { | ||||
|     if (filePath[0] === "~") { | ||||
|         const home = os.homedir(); | ||||
|         if (!home) { | ||||
|             throw new Error("Unable to resole `~` to HOME"); | ||||
|             throw new Error("Unable to resolve `~` to HOME"); | ||||
|         } | ||||
|         return path.join(home, filePath.slice(1)); | ||||
|     } | ||||
| @ -2938,10 +2940,11 @@ module.exports = require("fs"); | ||||
| "use strict"; | ||||
|  | ||||
| var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||||
|     function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||||
|     return new (P || (P = Promise))(function (resolve, reject) { | ||||
|         function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||||
|         function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||||
|         function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } | ||||
|         function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||||
|         step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||||
|     }); | ||||
| }; | ||||
| @ -2989,9 +2992,13 @@ function run() { | ||||
|                 } | ||||
|             } | ||||
|             try { | ||||
|                 const cacheEntry = yield cacheHttpClient.getCacheEntry(keys); | ||||
|                 if (!cacheEntry) { | ||||
|                     core.info(`Cache not found for input keys: ${JSON.stringify(keys)}.`); | ||||
|                     return; | ||||
|                 } | ||||
|                 let archivePath = path.join(yield utils.createTempDirectory(), "cache.tgz"); | ||||
|                 core.debug(`Archive Path: ${archivePath}`); | ||||
|                 const cacheEntry = yield cacheHttpClient.getCacheEntry(keys); | ||||
|                 // Store the cache result | ||||
|                 utils.setCacheState(cacheEntry); | ||||
|                 // Download the cache from the cache entry | ||||
| @ -3014,14 +3021,7 @@ function run() { | ||||
|                 yield exec_1.exec(`"${tarPath}"`, args); | ||||
|                 const isExactKeyMatch = utils.isExactKeyMatch(primaryKey, cacheEntry); | ||||
|                 utils.setCacheHitOutput(isExactKeyMatch); | ||||
|                 core.info(`Cache restored from key:${cacheEntry && cacheEntry.cacheKey}`); | ||||
|                 try { | ||||
|                     core.info("Cache Checksum:"); | ||||
|                     yield exec_1.exec(`md5sum`, [`${archivePath}`]); | ||||
|                 } | ||||
|                 catch (error) { | ||||
|                     core.debug(`Failed to checkum with ${error}`); | ||||
|                 } | ||||
|                 core.info(`Cache restored from key: ${cacheEntry && cacheEntry.cacheKey}`); | ||||
|             } | ||||
|             catch (error) { | ||||
|                 core.warning(error.message); | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Josh Gross
					Josh Gross