Skip to content

Commit

Permalink
Revert original C# Example
Browse files Browse the repository at this point in the history
* Treat "Use Personal Cache Folder" way as another C# example
* Describe the situation in which another example should be used
  • Loading branch information
Nogic authored and GitHub committed Dec 13, 2019
1 parent 002d3a7 commit 0188dff
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,20 @@
## C# - NuGet
Using [NuGet lock files](https://docs.microsoft.com/nuget/consume-packages/package-references-in-project-files#locking-dependencies):

```yaml
- uses: actions/cache@v1
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
${{ runner.os }}-nuget-
```
Depending on the environment, huge packages might be pre-installed in the global cache folder.
If you do not want to include them, consider to move the cache folder like below.
>Note: This workflow does not work for projects that require files to be placed in the global.
```yaml
env:
# Use personal cache folder because global cache may have huge packages like Xamarin.
# Learn more, see issue #115.
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages
steps:
- uses: actions/cache@v1
Expand Down

0 comments on commit 0188dff

Please sign in to comment.