Skip to content

Commit

Permalink
Update building-and-testing-net.md (github#32613)
Browse files Browse the repository at this point in the history
Co-authored-by: Siara <108543037+SiaraMist@users.noreply.github.com>
  • Loading branch information
2 people authored and pull[bot] committed Jun 19, 2024
1 parent 490363c commit b0d92b1
Showing 1 changed file with 3 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ steps:

### Caching dependencies

You can cache NuGet dependencies using a unique key, which allows you to restore the dependencies for future workflows with the [`cache`](https://github.com/marketplace/actions/cache) action. For example, the YAML below installs the `Newtonsoft` package.
You can cache NuGet dependencies for future workflows using the optional `cache` input. For example, the YAML below caches the NuGet `global-packages` folder, and then installs the `Newtonsoft` package. A second optional input, `cache-dependency-path`, can be used to specify the path to a dependency file: `packages.lock.json`.

For more information, see "[AUTOTITLE](/actions/using-workflows/caching-dependencies-to-speed-up-workflows)."

Expand All @@ -149,14 +149,8 @@ steps:
- name: Setup dotnet
uses: {% data reusables.actions.action-setup-dotnet %}
with:
dotnet-version: '6.0.x'
- uses: {% data reusables.actions.action-cache %}
with:
path: ~/.nuget/packages
# Look to see if there is a cache hit for the corresponding requirements file
key: {% raw %}${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
restore-keys: |
${{ runner.os }}-nuget{% endraw %}
dotnet-version: '6.x'
cache: true
- name: Install dependencies
run: dotnet add package Newtonsoft.Json --version 12.0.1
```
Expand Down

0 comments on commit b0d92b1

Please sign in to comment.