diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 50c4cc5..a6cd779 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -32,6 +32,7 @@ jobs: env: IS_COVERAGE_ALLOWED: ${{ secrets.CODACY_PROJECT_TOKEN != '' }} + NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages steps: - uses: actions/checkout@v4 @@ -51,6 +52,18 @@ jobs: # queries: security-extended,security-and-quality queries: security-extended + - name: Cache NuGet + id: cache-nuget + uses: actions/cache@v3 + with: + path: ${{ env.NUGET_PACKAGES }} + key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj', '**/global.json', '**/Directory.Packages.props', '**/Packages.props') }} + restore-keys: | + ${{ runner.os }}-nuget- + + - name: Debug Cache + run: echo "Cache hit ${{ steps.cache-nuget.outputs.cache-hit }}" + - name: Setup .NET uses: actions/setup-dotnet@v4 with: @@ -109,6 +122,7 @@ jobs: - name: Upload packages uses: actions/upload-artifact@v4 + if: success() with: name: packages-${{ matrix.os }} path: | diff --git a/build/targets/compiler/Compiler.props b/build/targets/compiler/Compiler.props index e0cf891..db6ac9b 100644 --- a/build/targets/compiler/Compiler.props +++ b/build/targets/compiler/Compiler.props @@ -19,5 +19,5 @@ <_Parameter1>false - +