mirror of
				https://github.com/Swatinem/rust-cache.git
				synced 2025-10-31 19:13:50 +00:00 
			
		
		
		
	
							parent
							
								
									cbcc887094
								
							
						
					
					
						commit
						2639a56bb8
					
				| @ -20,10 +20,11 @@ export const stateKey = "RUST_CACHE_KEY"; | ||||
| const stateHash = "RUST_CACHE_HASH"; | ||||
| 
 | ||||
| const home = os.homedir(); | ||||
| const cargoHome = process.env.CARGO_HOME || path.join(home, ".cargo"); | ||||
| export const paths = { | ||||
|   index: path.join(home, ".cargo/registry/index"), | ||||
|   cache: path.join(home, ".cargo/registry/cache"), | ||||
|   git: path.join(home, ".cargo/git"), | ||||
|   index: path.join(cargoHome, "registry/index"), | ||||
|   cache: path.join(cargoHome, "registry/cache"), | ||||
|   git: path.join(cargoHome, "git"), | ||||
|   target: "target", | ||||
| }; | ||||
| 
 | ||||
|  | ||||
| @ -9,6 +9,7 @@ async function run() { | ||||
|     const { paths, key, restoreKeys } = await getCacheConfig(); | ||||
| 
 | ||||
|     core.info(`Restoring paths:\n    ${paths.join("\n    ")}`); | ||||
|     core.info(`In directory:\n    ${process.cwd()}`); | ||||
|     core.info(`Using keys:\n    ${[key, ...restoreKeys].join("\n    ")}`); | ||||
|     const restoreKey = await cache.restoreCache(paths, key, restoreKeys); | ||||
|     if (restoreKey) { | ||||
|  | ||||
| @ -35,7 +35,8 @@ async function run() { | ||||
|     } catch {} | ||||
| 
 | ||||
|     core.info(`Saving paths:\n    ${savePaths.join("\n    ")}`); | ||||
|     core.info(`Using key "${key}".`); | ||||
|     core.info(`In directory:\n    ${process.cwd()}`); | ||||
|     core.info(`Using key:\n    ${key}`); | ||||
|     await cache.saveCache(savePaths, key); | ||||
|   } catch (e) { | ||||
|     core.info(`[warning] ${e.message}`); | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user