Skip to content

Commit 8003390

Browse files
github-actions[bot]Copilot
authored andcommitted
ci: cache NuGet packages to speed up builds
Add actions/cache@v4 to cache the ~/.nuget/packages directory, keyed on paket.lock hash. This avoids re-downloading packages on every CI run, which should significantly reduce build times on cache hits. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 0d5b58c commit 8003390

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

.github/workflows/dotnet.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@ jobs:
3939
uses: actions/setup-dotnet@v5
4040
with:
4141
dotnet-version: ${{ matrix.dotnet }}
42+
- name: Cache NuGet packages
43+
uses: actions/cache@v4
44+
with:
45+
path: ~/.nuget/packages
46+
key: ${{ runner.os }}-nuget-${{ hashFiles('**/paket.lock') }}
47+
restore-keys: |
48+
${{ runner.os }}-nuget-
4249
- name: Install local tools
4350
run: dotnet tool restore
4451
- name: Paket Restore

0 commit comments

Comments
 (0)