From ea5bf5dd0fb8151982dbe7ee0173d92a00c5ecab Mon Sep 17 00:00:00 2001 From: David Federman Date: Thu, 2 May 2024 07:59:37 -0700 Subject: [PATCH] Cache nuget packages using pipeline caching (#32677) --- .../ci/templates/build-powertoys-steps.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.pipelines/ci/templates/build-powertoys-steps.yml b/.pipelines/ci/templates/build-powertoys-steps.yml index 882e21dd12..f1f3dbe048 100644 --- a/.pipelines/ci/templates/build-powertoys-steps.yml +++ b/.pipelines/ci/templates/build-powertoys-steps.yml @@ -83,6 +83,24 @@ steps: - task: VisualStudioTestPlatformInstaller@1 displayName: Ensure VSTest Platform +- task: Cache@2 + displayName: 'Cache nuget packages (PackageReference)' + inputs: + key: '"PackageReference" | "$(Agent.OS)" | Directory.Packages.props' + restoreKeys: | + "PackageReference" | "$(Agent.OS)" + "PackageReference" + path: $(NUGET_PACKAGES) + +- task: Cache@2 + displayName: 'Cache nuget packages (packages.config)' + inputs: + key: '"packages.config" | "$(Agent.OS)" | **/packages.config' + restoreKeys: | + "packages.config" | "$(Agent.OS)" + "packages.config" + path: packages + - ${{ if eq(parameters.enableCaching, true) }}: - task: NuGetToolInstaller@1 displayName: Install NuGet