File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change 1
1
name : $(TeamProject)_$(Build.DefinitionName)_$(SourceBranchName)_$(Date:yyyyMMdd)$(Rev:.r)
2
2
3
3
parameters :
4
+ - name : cache_npm
5
+ displayName : Cache NPM packages
6
+ type : boolean
7
+ default : true
4
8
- name : cache_nuget
5
9
displayName : Cache NuGet packages
6
10
type : boolean
@@ -19,6 +23,7 @@ stages:
19
23
- stage : Build
20
24
variables :
21
25
NUGET_PACKAGES : $(Pipeline.Workspace)/.nuget/packages
26
+ npm_config_cache : $(Pipeline.Workspace)/.npm_client
22
27
jobs :
23
28
- job : Build
24
29
pool :
@@ -32,11 +37,27 @@ stages:
32
37
- task : NuGetAuthenticate@1
33
38
displayName : Authenticate NuGet
34
39
40
+ - task : NodeTool@0
41
+ displayName : Use Node.js $(nodeVersion)
42
+ inputs :
43
+ versionSpec : $(nodeVersion)
44
+
35
45
- task : UseDotNet@2
36
46
displayName : Use .NET SDK from global.json
37
47
inputs :
38
48
useGlobalJson : true
39
49
50
+ # Cache and restore NPM packages
51
+ - task : Cache@2
52
+ condition : ${{ parameters.cache_npm }}
53
+ displayName : Cache NPM packages
54
+ inputs :
55
+ key : ' npm | "$(Agent.OS)" | **/package-lock.json, !**/node_modules/**'
56
+ restoreKeys : |
57
+ npm | "$(Agent.OS)"
58
+ npm
59
+ path : $(npm_config_cache)
60
+
40
61
# Cache and restore NuGet packages
41
62
- task : Cache@2
42
63
condition : ${{ parameters.cache_nuget }}
You can’t perform that action at this time.
0 commit comments