mirror of
				https://github.com/actions/cache.git
				synced 2025-11-04 15:48:39 +08:00 
			
		
		
		
	Add example for C++ vcpkg
This commit is contained in:
		
							parent
							
								
									67b6d52d50
								
							
						
					
					
						commit
						5460e17bf7
					
				| 
						 | 
					@ -86,6 +86,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++ - vcpkg](./examples.md#c++---vcpkg)
 | 
				
			||||||
- [C# - Nuget](./examples.md#c---nuget)
 | 
					- [C# - Nuget](./examples.md#c---nuget)
 | 
				
			||||||
- [D - DUB](./examples.md#d---dub)
 | 
					- [D - DUB](./examples.md#d---dub)
 | 
				
			||||||
- [Elixir - Mix](./examples.md#elixir---mix)
 | 
					- [Elixir - Mix](./examples.md#elixir---mix)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										28
									
								
								examples.md
									
									
									
									
									
								
							
							
						
						
									
										28
									
								
								examples.md
									
									
									
									
									
								
							| 
						 | 
					@ -1,5 +1,6 @@
 | 
				
			||||||
# Examples
 | 
					# Examples
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- [C++ - vcpkg](#c++---vcpkg)
 | 
				
			||||||
- [C# - NuGet](#c---nuget)
 | 
					- [C# - NuGet](#c---nuget)
 | 
				
			||||||
- [D - DUB](#d---dub)
 | 
					- [D - DUB](#d---dub)
 | 
				
			||||||
  - [POSIX](#posix)
 | 
					  - [POSIX](#posix)
 | 
				
			||||||
| 
						 | 
					@ -37,6 +38,33 @@
 | 
				
			||||||
- [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++ - vcpkg
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Using [vcpkg](https://vcpkg.io/en/getting-started.html):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```yaml
 | 
				
			||||||
 | 
					# Set the build type environment variable
 | 
				
			||||||
 | 
					env:
 | 
				
			||||||
 | 
					  BUILD_TYPE: Debug
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```yaml
 | 
				
			||||||
 | 
					    - name: Cache
 | 
				
			||||||
 | 
					      uses: actions/cache@v2
 | 
				
			||||||
 | 
					      with:
 | 
				
			||||||
 | 
					        # Assuming that vcpkg is installed in `~/vcpkg`
 | 
				
			||||||
 | 
					        # Assuming that the build directory is `./build`
 | 
				
			||||||
 | 
					        path: |
 | 
				
			||||||
 | 
					          ~/vcpkg 
 | 
				
			||||||
 | 
					          ./build/vcpkg_installed
 | 
				
			||||||
 | 
					          ${{ env.HOME }}/.cache/vcpkg/archives
 | 
				
			||||||
 | 
					          ${{ env.XDG_CACHE_HOME }}/vcpkg/archives
 | 
				
			||||||
 | 
					          ${{ env.LOCALAPPDATA }}\vcpkg\archives
 | 
				
			||||||
 | 
					          ${{ env.APPDATA }}\vcpkg\archives
 | 
				
			||||||
 | 
					        key: ${{ runner.os }}-${{ env.BUILD_TYPE }}-${{ hashFiles('**/CMakeLists.txt') }}-${{ hashFiles('./vcpkg.json')}}
 | 
				
			||||||
 | 
					        restore-keys: |
 | 
				
			||||||
 | 
					          ${{ runner.os }}-${{ env.BUILD_TYPE }}
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
## 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…
	
		Reference in New Issue
	
	Block a user