From 2683943ee599c7c10b265c27046e99f334b08fb5 Mon Sep 17 00:00:00 2001 From: Nogic <24802730+nogic1008@users.noreply.github.com> Date: Thu, 27 Apr 2023 08:35:44 +0900 Subject: [PATCH] docs: add simple cache example --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index 3561e6d..cf6f12c 100644 --- a/README.md +++ b/README.md @@ -88,6 +88,16 @@ The action searches for [NuGet Lock files](https://learn.microsoft.com/nuget/con > **Warning:** Caching NuGet packages is available since .NET SDK 2.1.500 and 2.2.100 as the NuGet lock file [is available](https://learn.microsoft.com/nuget/consume-packages/package-references-in-project-files#locking-dependencies) only for NuGet 4.9 and above. +```yaml +steps: +- uses: actions/checkout@v3 +- uses: actions/setup-dotnet@v3 + with: + dotnet-version: 6.x + cache: true +- run: dotnet restore --locked-mode +``` + **Note:** Use [`NUGET_PACKAGES`](https://learn.microsoft.com/nuget/reference/cli-reference/cli-ref-environment-variables) environment variable if available. Some action runners already has huge libraries. (ex. Xamarin) ```yaml