daml/ci/build-windows.yml
Moritz Kiefer 4f97a4da8e
Avoid test log collisions across platforms (#9763)
Currently they overwrite each other which is clearly not helpful.

changelog_begin
changelog_end
2021-05-21 09:11:16 +02:00

64 lines
2.4 KiB
YAML

# Copyright (c) 2021 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
parameters:
release_tag: ''
is_release: ''
steps:
- bash: ci/configure-bazel.sh
displayName: 'Configure Bazel'
env:
IS_FORK: $(System.PullRequest.IsFork)
# to upload to the bazel cache
GOOGLE_APPLICATION_CREDENTIALS_CONTENT: $(GOOGLE_APPLICATION_CREDENTIALS_CONTENT)
- powershell: '.\ci\windows-diagnostics.ps1'
displayName: 'Agent diagnostics'
- powershell: '.\build.ps1'
displayName: 'Build'
env:
DAML_SDK_RELEASE_VERSION: ${{parameters.release_tag}}
# On release, we want to skip testing because:
# - Caching on Windows is keyed on full path, and full path is somewhat
# random (for a given machine, each pipeline has a its own workdir, but
# they are not the same across machines).
# - In the specific case of a release commit on `main`, the exact same
# code has already been tested twice: once as part of the target
# commit's own build (albeit with 0.0.0 as version number), and once as
# part of the release PR that triggered the build (with correct version
# number).
SKIP_TESTS: ${{and(eq(parameters.is_release, 'true'),
eq(variables['Build.SourceBranchName'], 'main'))}}
- task: PublishBuildArtifacts@1
condition: failed()
displayName: 'Publish the bazel test logs'
inputs:
pathtoPublish: 'bazel-testlogs/'
artifactName: 'Test logs Windows'
- template: bash-lib.yml
parameters:
var_name: bash-lib
- bash: |
set -euo pipefail
mkdir -p '$(Build.StagingDirectory)'/release
./ci/copy-windows-release-artifacts.sh ${{parameters.release_tag}} '$(Build.StagingDirectory)'/release
name: publish
env:
SIGNING_KEY: $(microsoft-code-signing)
DAML_SDK_RELEASE_VERSION: ${{parameters.release_tag}}
condition: and(succeeded(),
eq(${{parameters.is_release}}, 'true'),
eq(variables['Build.SourceBranchName'], 'main'))
- task: PublishPipelineArtifact@0
condition: and(succeeded(),
eq(${{parameters.is_release}}, 'true'),
eq(variables['Build.SourceBranchName'], 'main'))
inputs:
targetPath: $(Build.StagingDirectory)/release
artifactName: windows-release