From 19f6e8d43c09b2399fef9553c2d8b731447e0ee6 Mon Sep 17 00:00:00 2001 From: Ognjen Andjelic <89692428+crni99@users.noreply.github.com> Date: Tue, 17 Sep 2024 11:11:52 +0200 Subject: [PATCH] Add Cache NuGet packages - dotnet.yml --- .github/workflows/dotnet.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 1163c30..503bee2 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -14,6 +14,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, windows-latest, macos-latest] + dotnet-version: [8.0.x, 6.0.x] runs-on: ${{ matrix.os }} steps: @@ -22,9 +23,15 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v4 with: - dotnet-version: | - 8.0.x - 6.0.x + dotnet-version: ${{ matrix.dotnet-version }} + + - name: Cache NuGet packages + uses: actions/cache@v3 + with: + path: ~/.nuget/packages + key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }} + restore-keys: | + ${{ runner.os }}-nuget- - name: Restore dependencies working-directory: ./AirportAutomation @@ -37,5 +44,3 @@ jobs: - name: Test working-directory: ./AirportAutomation run: dotnet test AirportAutomation.sln --no-build --verbosity normal - -