mirror of
				https://github.com/actions/cache.git
				synced 2025-11-04 04:54:01 +00:00 
			
		
		
		
	Merge 5d6684a94a69207249646041c79f5d51b37a8cfd into c1a5de879eb890d062a85ee0252d6036480b1fe2
This commit is contained in:
		
						commit
						c718199da4
					
				@ -98,6 +98,7 @@ Every programming language and framework has its own way of caching.
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
See [Examples](examples.md) for a list of `actions/cache` implementations for use with:
 | 
					See [Examples](examples.md) for a list of `actions/cache` implementations for use with:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- [C++ - Conan](./examples.md#c---conan)
 | 
				
			||||||
- [C# - NuGet](./examples.md#c---nuget)
 | 
					- [C# - NuGet](./examples.md#c---nuget)
 | 
				
			||||||
- [Clojure - Lein Deps](./examples.md#clojure---lein-deps)
 | 
					- [Clojure - Lein Deps](./examples.md#clojure---lein-deps)
 | 
				
			||||||
- [D - DUB](./examples.md#d---dub)
 | 
					- [D - DUB](./examples.md#d---dub)
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										50
									
								
								examples.md
									
									
									
									
									
								
							
							
						
						
									
										50
									
								
								examples.md
									
									
									
									
									
								
							@ -1,5 +1,6 @@
 | 
				
			|||||||
# Examples
 | 
					# Examples
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- [C++ - Conan](#c---conan)
 | 
				
			||||||
- [C# - NuGet](#c---nuget)
 | 
					- [C# - NuGet](#c---nuget)
 | 
				
			||||||
- [Clojure - Lein Deps](#clojure---lein-deps)
 | 
					- [Clojure - Lein Deps](#clojure---lein-deps)
 | 
				
			||||||
- [D - DUB](#d---dub)
 | 
					- [D - DUB](#d---dub)
 | 
				
			||||||
@ -39,6 +40,55 @@
 | 
				
			|||||||
- [Swift, Objective-C - CocoaPods](#swift-objective-c---cocoapods)
 | 
					- [Swift, Objective-C - CocoaPods](#swift-objective-c---cocoapods)
 | 
				
			||||||
- [Swift - Swift Package Manager](#swift---swift-package-manager)
 | 
					- [Swift - Swift Package Manager](#swift---swift-package-manager)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					## C++ - Conan
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Using [Conan Lockfiles](https://docs.conan.io/en/latest/versioning/lockfiles.html):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```yaml
 | 
				
			||||||
 | 
					- name: create conan cache keys
 | 
				
			||||||
 | 
					  run: |
 | 
				
			||||||
 | 
					    conan lock create conanfile.py --build missing
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					- uses: actions/cache@v3
 | 
				
			||||||
 | 
					  with:
 | 
				
			||||||
 | 
					    path: |
 | 
				
			||||||
 | 
					      ~/.conan/data
 | 
				
			||||||
 | 
					    key: conan-${{ hashFiles('conan.lock') }}
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					  run: |
 | 
				
			||||||
 | 
					    conan install . --lockfile conan.lock --build missing
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					For Windows, use
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```yaml
 | 
				
			||||||
 | 
					- uses: actions/cache@v3
 | 
				
			||||||
 | 
					  if: runner.os == 'Windows'
 | 
				
			||||||
 | 
					  with:
 | 
				
			||||||
 | 
					    path: |
 | 
				
			||||||
 | 
					      ~/.conan/data
 | 
				
			||||||
 | 
					      C:/.conan
 | 
				
			||||||
 | 
					    key: conan-${{ hashFiles('conan.lock') }}
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Using a custom cache location, and a profile as a partial cache key:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```yaml
 | 
				
			||||||
 | 
					  env: 
 | 
				
			||||||
 | 
					    CONAN_USER_HOME: /tmp/
 | 
				
			||||||
 | 
					    PROFILE: my_profile
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					- name: create lockfile
 | 
				
			||||||
 | 
					  run: |
 | 
				
			||||||
 | 
					    conan lock create conanfile.py -pr $PROFILE --build missing
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					- uses: actions/cache@v3
 | 
				
			||||||
 | 
					  with:
 | 
				
			||||||
 | 
					    path: |
 | 
				
			||||||
 | 
					      ${{ env.CONAN_USER_HOME }}/.conan/data
 | 
				
			||||||
 | 
					    key: conan-${{ env.PROFILE }}-${{ hashFiles('conan.lock') }}
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## C# - NuGet
 | 
					## C# - NuGet
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Using [NuGet lock files](https://docs.microsoft.com/nuget/consume-packages/package-references-in-project-files#locking-dependencies):
 | 
					Using [NuGet lock files](https://docs.microsoft.com/nuget/consume-packages/package-references-in-project-files#locking-dependencies):
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user