From 002d3a77f4c5d6c87f0444cd90c0464892209ff7 Mon Sep 17 00:00:00 2001 From: Nogic <24802730+nogic1008@users.noreply.github.com> Date: Tue, 10 Dec 2019 09:21:47 +0900 Subject: [PATCH 1/3] Use Personal Cache Folder in C# Example Ref: #115 --- examples.md | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/examples.md b/examples.md index 716f2bb..cc5da9e 100644 --- a/examples.md +++ b/examples.md @@ -1,6 +1,6 @@ # Examples -- [C# - Nuget](#c---nuget) +- [C# - NuGet](#c---nuget) - [Elixir - Mix](#elixir---mix) - [Go - Modules](#go---modules) - [Java - Gradle](#java---gradle) @@ -14,16 +14,21 @@ - [Swift, Objective-C - Carthage](#swift-objective-c---carthage) - [Swift, Objective-C - CocoaPods](#swift-objective-c---cocoapods) -## C# - Nuget +## 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- +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 + with: + path: ${{ github.workspace }}/.nuget/packages + key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }} + restore-keys: | + ${{ runner.os }}-nuget- ``` ## Elixir - Mix From 0188dffc5a9973623bf3323af68a20d0ea5d4b4c Mon Sep 17 00:00:00 2001 From: Nogic <24802730+nogic1008@users.noreply.github.com> Date: Fri, 13 Dec 2019 10:03:43 +0900 Subject: [PATCH 2/3] Revert original C# Example * Treat "Use Personal Cache Folder" way as another C# example * Describe the situation in which another example should be used --- examples.md | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/examples.md b/examples.md index cc5da9e..7552281 100644 --- a/examples.md +++ b/examples.md @@ -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 From decbafc35082cddd7c1407de0e333c053d7ac180 Mon Sep 17 00:00:00 2001 From: Nogic <24802730+nogic1008@users.noreply.github.com> Date: Mon, 16 Dec 2019 09:45:29 +0900 Subject: [PATCH 3/3] Update examples.md Co-Authored-By: Chris Patterson --- examples.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples.md b/examples.md index 7552281..948179c 100644 --- a/examples.md +++ b/examples.md @@ -28,7 +28,7 @@ Using [NuGet lock files](https://docs.microsoft.com/nuget/consume-packages/packa 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. +>Note: This workflow does not work for projects that require files to be placed in user profile package folder ```yaml env: NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages