Skip to content

Commit 31113ad

Browse files
committed
WIP: pipelines
1 parent c749bba commit 31113ad

File tree

3 files changed

+32
-3
lines changed

3 files changed

+32
-3
lines changed

azure-pipelines.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ stages:
2727
strategy:
2828
parallel: 2
2929
steps:
30+
- task: Cache@2
31+
inputs:
32+
key: $(Agent.OS) | **/global.json, **/*.csproj
33+
restoreKeys: $(Agent.OS)
34+
path: $(Pipeline.Workspace)/../../.nuget/packages
3035
- task: CmdLine@2
3136
inputs:
3237
script: './build.cmd Restore Compile Test --skip --partition $(System.JobPositionInPhase)/2'
@@ -42,6 +47,11 @@ stages:
4247
displayName: '📦 Pack'
4348
dependsOn: [ ]
4449
steps:
50+
- task: Cache@2
51+
inputs:
52+
key: $(Agent.OS) | **/global.json, **/*.csproj
53+
restoreKeys: $(Agent.OS)
54+
path: $(Pipeline.Workspace)/../../.nuget/packages
4555
- task: CmdLine@2
4656
inputs:
4757
script: './build.cmd Restore Compile Pack --skip'
@@ -65,6 +75,11 @@ stages:
6575
strategy:
6676
parallel: 2
6777
steps:
78+
- task: Cache@2
79+
inputs:
80+
key: $(Agent.OS) | **/global.json, **/*.csproj
81+
restoreKeys: $(Agent.OS)
82+
path: $(Pipeline.Workspace)/../../.nuget/packages
6883
- task: CmdLine@2
6984
inputs:
7085
script: './build.cmd Restore Compile Test --skip --partition $(System.JobPositionInPhase)/2'
@@ -80,6 +95,11 @@ stages:
8095
displayName: '📦 Pack'
8196
dependsOn: [ ]
8297
steps:
98+
- task: Cache@2
99+
inputs:
100+
key: $(Agent.OS) | **/global.json, **/*.csproj
101+
restoreKeys: $(Agent.OS)
102+
path: $(Pipeline.Workspace)/../../.nuget/packages
83103
- task: CmdLine@2
84104
inputs:
85105
script: './build.cmd Restore Compile Pack --skip'
@@ -103,6 +123,11 @@ stages:
103123
strategy:
104124
parallel: 2
105125
steps:
126+
- task: Cache@2
127+
inputs:
128+
key: $(Agent.OS) | **/global.json, **/*.csproj
129+
restoreKeys: $(Agent.OS)
130+
path: $(Pipeline.Workspace)/../../.nuget/packages
106131
- task: CmdLine@2
107132
inputs:
108133
script: './build.cmd Restore Compile Test --skip --partition $(System.JobPositionInPhase)/2'
@@ -118,6 +143,11 @@ stages:
118143
displayName: '📦 Pack'
119144
dependsOn: [ ]
120145
steps:
146+
- task: Cache@2
147+
inputs:
148+
key: $(Agent.OS) | **/global.json, **/*.csproj
149+
restoreKeys: $(Agent.OS)
150+
path: $(Pipeline.Workspace)/../../.nuget/packages
121151
- task: CmdLine@2
122152
inputs:
123153
script: './build.cmd Restore Compile Pack --skip'

build/Build.CI.AzurePipelines.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@
3333
#endif
3434
InvokedTargets = new[] { nameof(ITest.Test), nameof(IPack.Pack) },
3535
NonEntryTargets = new[] { nameof(IRestore.Restore), nameof(ICompile.Compile), nameof(InstallFonts), nameof(ReleaseImage) },
36-
ExcludedTargets = new[] { nameof(Clean), nameof(ISignPackages.SignPackages) },
37-
CacheKeyFiles = new string[0])]
36+
ExcludedTargets = new[] { nameof(Clean), nameof(ISignPackages.SignPackages) })]
3837
partial class Build
3938
{
4039
public class AzurePipelinesAttribute : Nuke.Common.CI.AzurePipelines.AzurePipelinesAttribute

source/Nuke.Common/CI/AzurePipelines/AzurePipelinesAttribute.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public bool TriggerBatch
9090
public string[] PullRequestsPathsExclude { get; set; } = new string[0];
9191

9292
public string[] CacheKeyFiles { get; set; } = { "**/global.json", "**/*.csproj" };
93-
public string CachePath { get; set; } = "~/.nuget/packages";
93+
public string CachePath { get; set; } = "$(Pipeline.Workspace)/.nuget/packages";
9494

9595
public string[] ImportVariableGroups { get; set; } = new string[0];
9696
public string[] ImportSecrets { get; set; } = new string[0];

0 commit comments

Comments
 (0)