Skip to content

Commit

Permalink
Cache .NET SDKs and Tools
Browse files Browse the repository at this point in the history
- Cache everything under '$(Agent.ToolsDirectory)/dotnet'
  directory to speed up build. Check for changes in .NET SDK Version
  variable '$(DotNetVersion)' to invalidate and rebuild the cache next build.
  • Loading branch information
Nirmal4G committed Sep 21, 2022
1 parent 09af5cf commit e91c609
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,30 @@ pool:

variables:
BuildConfiguration: Release
BuildTools: $(Agent.ToolsDirectory)/dotnet
DotNetVersion: 7.0.x

jobs:
- job: BuildBits
displayName: Build and Test solution
timeoutInMinutes: 60
steps:

# Cache .NET SDKs and Tools across pipeline runs
- task: Cache@2
displayName: Cache .NET SDKs
inputs:
key: 'dotnet | "$(Agent.OS)" | "$(DotNetVersion)"'
restoreKeys: |
dotnet | "$(Agent.OS)"
dotnet
path: $(BuildTools)

# Install the .NET 7 SDK (Fixes dotnet/roslyn#63780)
- task: UseDotNet@2
displayName: Install the .NET 7 SDK
inputs:
version: 7.0.x
version: $(DotNetVersion)
includePreviewVersions: true
performMultiLevelLookup: true

Expand Down

0 comments on commit e91c609

Please sign in to comment.