Skip to content

Commit 36d7799

Browse files
authored
only dump package list if the run failed (#8320)
1 parent 5a01170 commit 36d7799

File tree

2 files changed

+25
-6
lines changed

2 files changed

+25
-6
lines changed

azure-pipelines.yml

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -187,14 +187,17 @@ stages:
187187
publishLocation: Container
188188
continueOnError: true
189189
condition: eq(variables['_testKind'], 'testFSharpQA')
190+
- script: dotnet build $(Build.SourcesDirectory)/eng/DumpPackageRoot/DumpPackageRoot.csproj
191+
displayName: Dump NuGet cache contents
192+
condition: failed()
190193
- task: PublishBuildArtifacts@1
191194
displayName: Publish NuGet cache contents
192195
inputs:
193196
PathtoPublish: '$(Build.SourcesDirectory)\artifacts\NugetPackageRootContents'
194197
ArtifactName: 'NuGetPackageContents Windows $(_testKind)'
195198
publishLocation: Container
196199
continueOnError: true
197-
condition: always()
200+
condition: failed()
198201

199202
# Linux
200203
- job: Linux
@@ -216,14 +219,17 @@ stages:
216219
searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)'
217220
continueOnError: true
218221
condition: always()
222+
- script: dotnet build $(Build.SourcesDirectory)/eng/DumpPackageRoot/DumpPackageRoot.csproj
223+
displayName: Dump NuGet cache contents
224+
condition: failed()
219225
- task: PublishBuildArtifacts@1
220226
displayName: Publish NuGet cache contents
221227
inputs:
222228
PathtoPublish: '$(Build.SourcesDirectory)/artifacts/NugetPackageRootContents'
223229
ArtifactName: 'NuGetPackageContents Linux'
224230
publishLocation: Container
225231
continueOnError: true
226-
condition: always()
232+
condition: failed()
227233

228234
# MacOS
229235
- job: MacOS
@@ -245,14 +251,17 @@ stages:
245251
searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)'
246252
continueOnError: true
247253
condition: always()
254+
- script: dotnet build $(Build.SourcesDirectory)/eng/DumpPackageRoot/DumpPackageRoot.csproj
255+
displayName: Dump NuGet cache contents
256+
condition: failed()
248257
- task: PublishBuildArtifacts@1
249258
displayName: Publish NuGet cache contents
250259
inputs:
251260
PathtoPublish: '$(Build.SourcesDirectory)/artifacts/NugetPackageRootContents'
252261
ArtifactName: 'NuGetPackageContents Mac'
253262
publishLocation: Container
254263
continueOnError: true
255-
condition: always()
264+
condition: failed()
256265

257266
# Source Build Linux
258267
- job: SourceBuild_Linux
@@ -263,14 +272,17 @@ stages:
263272
clean: true
264273
- script: ./eng/cibuild.sh --configuration Release /p:DotNetBuildFromSource=true /p:FSharpSourceBuild=true
265274
displayName: Build
275+
- script: dotnet build $(Build.SourcesDirectory)/eng/DumpPackageRoot/DumpPackageRoot.csproj
276+
displayName: Dump NuGet cache contents
277+
condition: failed()
266278
- task: PublishBuildArtifacts@1
267279
displayName: Publish NuGet cache contents
268280
inputs:
269281
PathtoPublish: '$(Build.SourcesDirectory)/artifacts/NugetPackageRootContents'
270282
ArtifactName: 'NuGetPackageContents SourceBuild_Linux'
271283
publishLocation: Container
272284
continueOnError: true
273-
condition: always()
285+
condition: failed()
274286

275287
# Source Build Windows
276288
- job: SourceBuild_Windows
@@ -281,14 +293,17 @@ stages:
281293
clean: true
282294
- script: eng\CIBuild.cmd -configuration Release -noSign /p:DotNetBuildFromSource=true /p:FSharpSourceBuild=true
283295
displayName: Build
296+
- script: dotnet build $(Build.SourcesDirectory)/eng/DumpPackageRoot/DumpPackageRoot.csproj
297+
displayName: Dump NuGet cache contents
298+
condition: failed()
284299
- task: PublishBuildArtifacts@1
285300
displayName: Publish NuGet cache contents
286301
inputs:
287302
PathtoPublish: '$(Build.SourcesDirectory)\artifacts\NugetPackageRootContents'
288303
ArtifactName: 'NuGetPackageContents SourceBuild_Windows'
289304
publishLocation: Container
290305
continueOnError: true
291-
condition: always()
306+
condition: failed()
292307

293308
# Up-to-date
294309
- job: UpToDate_Windows

eng/AfterSolutionBuild.targets renamed to eng/DumpPackageRoot/DumpPackageRoot.csproj

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1-
<Project>
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<!-- Used as a diagnostic tool to view the state of the NuGet package cache as it existed immediately after a restore/build. -->
44

5+
<PropertyGroup>
6+
<TargetFramework>netcoreapp3.1</TargetFramework>
7+
</PropertyGroup>
8+
59
<ItemGroup>
610
<PackageRootFiles Include="$(NuGetPackageRoot)/**" />
711
</ItemGroup>

0 commit comments

Comments
 (0)