[ci]Fix OutOfMemory in download by separating test-only artifacts and filtering unused files before publishing (#37403)

* chunk download

* change pipeline

* update pipeline

* filter

* for testing

* use Variable

* rebase file

* add new line

* rebase the pipeline
This commit is contained in:
leileizhang
2025-02-13 01:06:11 +08:00
committed by GitHub
parent c19c4b0353
commit e0cb4018ab
2 changed files with 23 additions and 7 deletions

View File

@@ -456,6 +456,12 @@ jobs:
Copy-Item src\gpo\assets\* "$(JobOutputDirectory)/gpo" -Recurse
displayName: Stage GPO files
- ${{ if eq(parameters.publishArtifacts, true) }}:
- publish: $(JobOutputDirectory)
artifact: $(JobOutputArtifactName)
displayName: Publish all outputs
condition: always()
# Running the tests may result in future jobs consuming artifacts out of this build
- ${{ if eq(parameters.runTests, true) }}:
- task: CopyFiles@2
@@ -465,8 +471,17 @@ jobs:
contents: '$(BuildPlatform)/$(BuildConfiguration)/**/*'
targetFolder: '$(JobOutputDirectory)\$(BuildPlatform)\$(BuildConfiguration)'
- ${{ if eq(parameters.publishArtifacts, true) }}:
- publish: $(JobOutputDirectory)
artifact: $(JobOutputArtifactName)
displayName: Publish all outputs
- task: CopyFiles@2
displayName: Stage entire build output
inputs:
sourceFolder: $(JobOutputDirectory)
contents: |-
**
!**\*.pdb
!**\*.lib
targetFolder: '$(JobOutputDirectory)\TestArtifacts'
- publish: $(JobOutputDirectory)\TestArtifacts
artifact: $(JobOutputArtifactName)-TestArtifacts
displayName: Publish all outputs for testing
condition: always()

View File

@@ -19,6 +19,7 @@ jobs:
BuildPlatform: ${{ parameters.platform }}
BuildConfiguration: ${{ parameters.configuration }}
SrcPath: $(Build.Repository.LocalPath)
TestArtifactsName: build-${{ parameters.platform }}-${{ parameters.configuration }}${{ parameters.inputArtifactStem }}-TestArtifacts
pool:
${{ if eq(variables['System.CollectionId'], 'cb55739e-4afe-46a3-970f-1b49d8ee7564') }}:
${{ if ne(parameters.platform, 'ARM64') }}:
@@ -59,10 +60,10 @@ jobs:
- script:
reg add "HKLM\Software\Policies\Microsoft\Edge\WebView2\ReleaseChannels" /v PowerToys.exe /t REG_SZ /d "3"
displayName: "Enable WebView2 Canary Channel"
- download: current
displayName: Download artifacts
artifact: build-${{ parameters.platform }}-${{ parameters.configuration }}${{ parameters.inputArtifactStem }}
artifact: $(TestArtifactsName)
patterns: |-
**
!**\*.pdb
@@ -91,7 +92,7 @@ jobs:
platform: '$(BuildPlatform)'
configuration: '$(BuildConfiguration)'
testSelector: 'testAssemblies'
searchFolder: '$(Pipeline.Workspace)\build-${{ parameters.platform }}-${{ parameters.configuration }}${{ parameters.inputArtifactStem }}'
searchFolder: '$(Pipeline.Workspace)\$(TestArtifactsName)'
vsTestVersion: 'toolsInstaller'
uiTests: true
rerunFailedTests: true