From 03f71b300094ac8111d4b94b6ccdab62e4330d53 Mon Sep 17 00:00:00 2001 From: Rick van Dam Date: Fri, 24 May 2024 15:08:14 +0200 Subject: [PATCH] cache nuget packages in build --- .github/workflows/dotnet.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index af3af75..9f0003d 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -19,9 +19,17 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v4 with: - dotnet-version: | - 8.0.x + global-json-file: global.json + - name: Cache nuget packages + id: cache-nuget + uses: actions/cache@v4 + with: + path: | + ~/.nuget/packages + **/obj/* + key: ${{ runner.os }}-nuget_obj-${{ hashFiles('**/*.csproj', 'global.json', 'Directory.Build.props') }} - name: Restore dependencies + if: steps.cache-nuget.outputs.cache-hit != 'true' run: dotnet restore - name: Build run: dotnet build --no-restore