mirror of
				https://github.com/actions/cache.git
				synced 2025-10-31 20:08:36 +08:00 
			
		
		
		
	Merge branch 'master' into rust-example
This commit is contained in:
		
						commit
						aea825e76e
					
				
							
								
								
									
										2
									
								
								.github/workflows/workflow.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.github/workflows/workflow.yml
									
									
									
									
										vendored
									
									
								
							|  | @ -5,7 +5,7 @@ on: | ||||||
|     branches: |     branches: | ||||||
|       - master |       - master | ||||||
|     paths-ignore: |     paths-ignore: | ||||||
|       - '**/*.md' |       - '**.md' | ||||||
| 
 | 
 | ||||||
| jobs: | jobs: | ||||||
|   test: |   test: | ||||||
|  |  | ||||||
|  | @ -59,7 +59,7 @@ See [Examples](examples.md) | ||||||
| 
 | 
 | ||||||
| ## Cache Limits | ## Cache Limits | ||||||
| 
 | 
 | ||||||
| Individual caches are limited to 200MB and a repository can have up to 2GB of caches. Once the 2GB limit is reached, older caches will be evicted based on when the cache was last accessed. | Individual caches are limited to 200MB and a repository can have up to 2GB of caches. Once the 2GB limit is reached, older caches will be evicted based on when the cache was last accessed.  Caches that are not accessed within the last week will also be evicted. | ||||||
| 
 | 
 | ||||||
| ## Skipping steps based on cache-hit | ## Skipping steps based on cache-hit | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
							
								
								
									
										12
									
								
								examples.md
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								examples.md
									
									
									
									
									
								
							|  | @ -8,6 +8,7 @@ | ||||||
| - [Swift, Objective-C - Carthage](#swift-objective-c---carthage) | - [Swift, Objective-C - Carthage](#swift-objective-c---carthage) | ||||||
| - [Swift, Objective-C - CocoaPods](#swift-objective-c---cocoapods) | - [Swift, Objective-C - CocoaPods](#swift-objective-c---cocoapods) | ||||||
| - [Ruby - Gem](#ruby---gem) | - [Ruby - Gem](#ruby---gem) | ||||||
|  | - [Go - Modules](#go---modules) | ||||||
| - [Rust - Cargo](#rust---cargo) | - [Rust - Cargo](#rust---cargo) | ||||||
| 
 | 
 | ||||||
| ## Node - npm | ## Node - npm | ||||||
|  | @ -98,6 +99,17 @@ uses: actions/cache@preview | ||||||
|       ${{ runner.os }}-gem- |       ${{ runner.os }}-gem- | ||||||
| ``` | ``` | ||||||
| 
 | 
 | ||||||
|  | ## Go - Modules | ||||||
|  | 
 | ||||||
|  | ```yaml | ||||||
|  | - uses: actions/cache@preview | ||||||
|  |   with: | ||||||
|  |     path: ~/go/pkg/mod | ||||||
|  |     key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||||||
|  |     restore-keys: | | ||||||
|  |       ${{ runner.os }}-go- | ||||||
|  | ``` | ||||||
|  | 
 | ||||||
| ## Rust - Cargo | ## Rust - Cargo | ||||||
| 
 | 
 | ||||||
| ``` | ``` | ||||||
|  |  | ||||||
|  | @ -94,13 +94,6 @@ async function run() { | ||||||
|             core.info( |             core.info( | ||||||
|                 `Cache restored from key:${cacheEntry && cacheEntry.cacheKey}` |                 `Cache restored from key:${cacheEntry && cacheEntry.cacheKey}` | ||||||
|             ); |             ); | ||||||
| 
 |  | ||||||
|             try { |  | ||||||
|                 core.info("Cache Checksum:"); |  | ||||||
|                 await exec(`md5sum`, [`${archivePath}`]); |  | ||||||
|             } catch (error) { |  | ||||||
|                 core.debug(`Failed to checkum with ${error}`); |  | ||||||
|             } |  | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             core.warning(error.message); |             core.warning(error.message); | ||||||
|             utils.setCacheHitOutput(false); |             utils.setCacheHitOutput(false); | ||||||
|  |  | ||||||
|  | @ -66,13 +66,6 @@ async function run() { | ||||||
| 
 | 
 | ||||||
|         const stream = fs.createReadStream(archivePath); |         const stream = fs.createReadStream(archivePath); | ||||||
|         await cacheHttpClient.saveCache(stream, primaryKey); |         await cacheHttpClient.saveCache(stream, primaryKey); | ||||||
| 
 |  | ||||||
|         try { |  | ||||||
|             core.info("Cache Checksum:"); |  | ||||||
|             await exec(`md5sum`, [`${archivePath}`]); |  | ||||||
|         } catch (error) { |  | ||||||
|             core.debug(`Failed to checkum with ${error}`); |  | ||||||
|         } |  | ||||||
|     } catch (error) { |     } catch (error) { | ||||||
|         core.warning(error.message); |         core.warning(error.message); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  | @ -72,7 +72,7 @@ export function resolvePath(filePath: string): string { | ||||||
|     if (filePath[0] === "~") { |     if (filePath[0] === "~") { | ||||||
|         const home = os.homedir(); |         const home = os.homedir(); | ||||||
|         if (!home) { |         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)); |         return path.join(home, filePath.slice(1)); | ||||||
|     } |     } | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Linda_pp
						Linda_pp