From e509c8080a41e1cfeaf942542b4e214c971cd56e Mon Sep 17 00:00:00 2001 From: Peter Collins Date: Mon, 8 Aug 2022 17:28:07 -0400 Subject: [PATCH] [ci] Upload test assemblies after signing We've recently seen a handful of build timeouts and/or failures during signing. The ESRP signing service seems to be much less performant and more error prone on macOS. In these failure cases, rebuild attempts would also fail when they got to the "upload test assembly step": [error]Artifact test-assemblies already exists for build 6522654. Improve this by uploading test assemblies and build inventory data at the end of the build, and by increasing the overall timeout of the job. --- build-tools/automation/azure-pipelines.yaml | 2 +- .../yaml-templates/commercial-build.yaml | 39 ++++++++++--------- 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/build-tools/automation/azure-pipelines.yaml b/build-tools/automation/azure-pipelines.yaml index 6d8f8cdeb4e..ec81d6b51d2 100644 --- a/build-tools/automation/azure-pipelines.yaml +++ b/build-tools/automation/azure-pipelines.yaml @@ -92,7 +92,7 @@ stages: vmImage: $(MacBuildPoolImage) ${{ if eq(variables['MacBuildPoolName'], 'VSEng-Xamarin-RedmondMac-Android-Untrusted') }}: demands: macOS.Name -equals Monterey - timeoutInMinutes: 180 + timeoutInMinutes: 240 cancelTimeoutInMinutes: 5 workspace: clean: all diff --git a/build-tools/automation/yaml-templates/commercial-build.yaml b/build-tools/automation/yaml-templates/commercial-build.yaml index 34eaaaad11b..94e5b3e358f 100644 --- a/build-tools/automation/yaml-templates/commercial-build.yaml +++ b/build-tools/automation/yaml-templates/commercial-build.yaml @@ -49,29 +49,11 @@ steps: workingDirectory: ${{ parameters.xaSourcePath }} displayName: make jenkins -- task: PublishPipelineArtifact@1 - displayName: upload build tools inventory - inputs: - artifactName: BuildToolsInventory - targetPath: ${{ parameters.xaSourcePath }}/bin/Build$(XA.Build.Configuration)/buildtoolsinventory.csv - -# Build and package test assemblies +# Build test assemblies - script: make all-tests CONFIGURATION=$(XA.Build.Configuration) workingDirectory: ${{ parameters.xaSourcePath }} displayName: make all-tests -- script: > - cp -r bin/$(XA.Build.Configuration)/bcl-tests bin/Test$(XA.Build.Configuration)/bcl-tests && - cp bin/Build$(XA.Build.Configuration)/ProfileAssemblies.projitems bin/Test$(XA.Build.Configuration)/bcl-tests/ - workingDirectory: ${{ parameters.xaSourcePath }} - displayName: copy bcl-tests assemblies - -- task: PublishPipelineArtifact@1 - displayName: upload test assemblies - inputs: - artifactName: $(TestAssembliesArtifactName) - targetPath: ${{ parameters.xaSourcePath }}/bin/Test$(XA.Build.Configuration) - # Restore needs to be executed first or MicroBuild targets won't be imported in time - task: MSBuild@1 displayName: msbuild /t:Restore sign-content.proj @@ -119,3 +101,22 @@ steps: inputs: artifactName: $(InstallerArtifactName) targetPath: ${{ parameters.xaSourcePath }}/bin/Build$(XA.Build.Configuration)/$(InstallerArtifactName) + +# Upload test assemblies +- script: > + cp -r bin/$(XA.Build.Configuration)/bcl-tests bin/Test$(XA.Build.Configuration)/bcl-tests && + cp bin/Build$(XA.Build.Configuration)/ProfileAssemblies.projitems bin/Test$(XA.Build.Configuration)/bcl-tests/ + workingDirectory: ${{ parameters.xaSourcePath }} + displayName: copy bcl-tests assemblies + +- task: PublishPipelineArtifact@1 + displayName: upload test assemblies + inputs: + artifactName: $(TestAssembliesArtifactName) + targetPath: ${{ parameters.xaSourcePath }}/bin/Test$(XA.Build.Configuration) + +- task: PublishPipelineArtifact@1 + displayName: upload build tools inventory + inputs: + artifactName: BuildToolsInventory + targetPath: ${{ parameters.xaSourcePath }}/bin/Build$(XA.Build.Configuration)/buildtoolsinventory.csv