2024-01-15 22:27:42 +03:00
|
|
|
|
# Copyright (c) 2024 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
2021-01-04 22:45:30 +03:00
|
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
|
2023-12-04 12:52:33 +03:00
|
|
|
|
parameters:
|
|
|
|
|
test_mode: ''
|
2021-05-19 15:24:47 +03:00
|
|
|
|
|
2023-12-04 12:52:33 +03:00
|
|
|
|
jobs:
|
2021-01-04 22:45:30 +03:00
|
|
|
|
- job: git_sha
|
|
|
|
|
pool:
|
2021-01-27 19:38:34 +03:00
|
|
|
|
name: 'ubuntu_20_04'
|
2021-01-04 22:45:30 +03:00
|
|
|
|
demands: assignment -equals default
|
|
|
|
|
steps:
|
2021-02-09 13:42:34 +03:00
|
|
|
|
- template: bash-lib.yml
|
|
|
|
|
parameters:
|
|
|
|
|
var_name: bash-lib
|
2021-01-04 22:45:30 +03:00
|
|
|
|
- bash: |
|
|
|
|
|
set -euo pipefail
|
2021-02-09 13:42:34 +03:00
|
|
|
|
source $(bash-lib)
|
2021-01-04 22:45:30 +03:00
|
|
|
|
if [ "$(Build.Reason)" == "PullRequest" ]; then
|
2021-02-09 13:42:34 +03:00
|
|
|
|
setvar branch "$(git rev-parse HEAD^2)"
|
|
|
|
|
setvar main "$(git rev-parse HEAD^1)"
|
|
|
|
|
setvar fork_point "$(git merge-base $(git rev-parse HEAD^1) $(git rev-parse HEAD^2))"
|
2021-01-04 22:45:30 +03:00
|
|
|
|
else
|
2021-02-09 13:42:34 +03:00
|
|
|
|
setvar branch "$(git rev-parse HEAD)"
|
|
|
|
|
setvar main "$(git rev-parse HEAD^1)"
|
|
|
|
|
setvar fork_point "$(git rev-parse HEAD^1)"
|
2021-01-04 22:45:30 +03:00
|
|
|
|
fi
|
|
|
|
|
name: out
|
|
|
|
|
|
|
|
|
|
- job: Linux
|
|
|
|
|
dependsOn:
|
|
|
|
|
- check_for_release
|
|
|
|
|
variables:
|
2021-06-11 13:16:08 +03:00
|
|
|
|
- name: release_sha
|
|
|
|
|
value: $[ dependencies.check_for_release.outputs['out.release_sha'] ]
|
|
|
|
|
- name: release_tag
|
|
|
|
|
value: $[ coalesce(dependencies.check_for_release.outputs['out.release_tag'], '0.0.0') ]
|
|
|
|
|
- name: trigger_sha
|
|
|
|
|
value: $[ dependencies.check_for_release.outputs['out.trigger_sha'] ]
|
|
|
|
|
- name: is_release
|
|
|
|
|
value: $[ dependencies.check_for_release.outputs['out.is_release'] ]
|
|
|
|
|
- template: job-variables.yml
|
2023-09-01 16:15:36 +03:00
|
|
|
|
timeoutInMinutes: 240
|
2024-02-25 17:43:12 +03:00
|
|
|
|
strategy:
|
|
|
|
|
matrix:
|
|
|
|
|
intel:
|
|
|
|
|
assignment: default
|
|
|
|
|
name: linux-intel
|
|
|
|
|
arm:
|
|
|
|
|
assignment: arm
|
|
|
|
|
name: linux-arm
|
2021-01-04 22:45:30 +03:00
|
|
|
|
pool:
|
2021-01-27 19:38:34 +03:00
|
|
|
|
name: 'ubuntu_20_04'
|
2024-02-25 17:43:12 +03:00
|
|
|
|
demands: assignment -equals $(assignment)
|
2021-01-04 22:45:30 +03:00
|
|
|
|
steps:
|
|
|
|
|
- template: report-start.yml
|
|
|
|
|
- checkout: self
|
|
|
|
|
- bash: |
|
|
|
|
|
set -euo pipefail
|
|
|
|
|
git checkout $(release_sha)
|
|
|
|
|
name: checkout_release
|
2021-03-12 09:13:26 +03:00
|
|
|
|
condition: and(succeeded(), eq(variables.is_release, 'true'))
|
2021-01-20 19:22:53 +03:00
|
|
|
|
- template: clean-up.yml
|
2021-01-04 22:45:30 +03:00
|
|
|
|
- template: build-unix.yml
|
|
|
|
|
parameters:
|
2024-02-28 19:37:30 +03:00
|
|
|
|
# The syntax required to inline a variable changes based on context
|
|
|
|
|
# (`$(var)` in strings, `variables.var` in expressions). Template
|
|
|
|
|
# parameters are inlined before evaluation. This is a bit like lazy
|
|
|
|
|
# function arguments, but at the syntax level.
|
|
|
|
|
#
|
|
|
|
|
# The result is that we need to know what context the parameter will be
|
|
|
|
|
# used in, which is why `release_tag` and `is_release` use different
|
|
|
|
|
# syntaxes, and why we need to passe `name` twice.
|
2021-01-04 22:45:30 +03:00
|
|
|
|
release_tag: $(release_tag)
|
2024-02-28 19:37:30 +03:00
|
|
|
|
name_str: $(name)
|
|
|
|
|
name_exp: variables.name
|
2021-01-04 22:45:30 +03:00
|
|
|
|
is_release: variables.is_release
|
2023-12-04 12:52:33 +03:00
|
|
|
|
test_mode: ${{parameters.test_mode}}
|
2021-06-11 13:16:08 +03:00
|
|
|
|
- template: upload-bazel-metrics.yml
|
2021-01-04 22:45:30 +03:00
|
|
|
|
- bash: |
|
|
|
|
|
set -euo pipefail
|
|
|
|
|
eval "$(./dev-env/bin/dade-assist)"
|
|
|
|
|
bazel build //release:release
|
|
|
|
|
./bazel-bin/release/release --release-dir "$(mktemp -d)"
|
|
|
|
|
condition: and(succeeded(), ne(variables['is_release'], 'true'))
|
|
|
|
|
- template: tell-slack-failed.yml
|
|
|
|
|
parameters:
|
|
|
|
|
trigger_sha: '$(trigger_sha)'
|
|
|
|
|
- template: report-end.yml
|
|
|
|
|
|
2022-08-16 08:54:58 +03:00
|
|
|
|
- template: macOS.yml
|
|
|
|
|
parameters:
|
2022-08-19 14:09:03 +03:00
|
|
|
|
job_name: macOS
|
|
|
|
|
name: macos
|
2022-08-16 08:54:58 +03:00
|
|
|
|
assignment: default
|
2023-12-04 12:52:33 +03:00
|
|
|
|
test_mode: ${{parameters.test_mode}}
|
2022-08-16 08:54:58 +03:00
|
|
|
|
|
|
|
|
|
- template: macOS.yml
|
|
|
|
|
parameters:
|
2022-08-19 14:09:03 +03:00
|
|
|
|
job_name: m1
|
2022-08-16 08:54:58 +03:00
|
|
|
|
name: m1
|
|
|
|
|
assignment: m1-builds
|
2023-12-04 12:52:33 +03:00
|
|
|
|
test_mode: ${{parameters.test_mode}}
|
2021-01-04 22:45:30 +03:00
|
|
|
|
|
2023-09-14 23:29:39 +03:00
|
|
|
|
- template: blackduck.yml
|
|
|
|
|
|
2021-01-04 22:45:30 +03:00
|
|
|
|
- job: Windows
|
|
|
|
|
dependsOn:
|
|
|
|
|
- check_for_release
|
|
|
|
|
variables:
|
2021-06-11 13:16:08 +03:00
|
|
|
|
- name: release_sha
|
|
|
|
|
value: $[ dependencies.check_for_release.outputs['out.release_sha'] ]
|
|
|
|
|
- name: release_tag
|
|
|
|
|
value: $[ coalesce(dependencies.check_for_release.outputs['out.release_tag'], '0.0.0') ]
|
|
|
|
|
- name: trigger_sha
|
|
|
|
|
value: $[ dependencies.check_for_release.outputs['out.trigger_sha'] ]
|
|
|
|
|
- name: is_release
|
|
|
|
|
value: $[ dependencies.check_for_release.outputs['out.is_release'] ]
|
2022-01-25 18:29:57 +03:00
|
|
|
|
- name: is_split_release
|
|
|
|
|
value: $[ dependencies.check_for_release.outputs['out.split_release_process'] ]
|
2021-06-11 13:16:08 +03:00
|
|
|
|
- name: skip_tests
|
|
|
|
|
value: $[ and(eq(variables.is_release, 'true'),
|
2024-01-15 13:55:40 +03:00
|
|
|
|
in(variables['Build.SourceBranchName'], 'main', 'main-2.x')) ]
|
2021-06-11 13:16:08 +03:00
|
|
|
|
- template: job-variables.yml
|
2023-09-01 16:15:36 +03:00
|
|
|
|
timeoutInMinutes: 240
|
2021-01-04 22:45:30 +03:00
|
|
|
|
pool:
|
|
|
|
|
name: 'windows-pool'
|
|
|
|
|
demands: assignment -equals default
|
|
|
|
|
steps:
|
|
|
|
|
- template: report-start.yml
|
|
|
|
|
- checkout: self
|
2022-01-26 17:46:35 +03:00
|
|
|
|
- bash: |
|
|
|
|
|
set -euo pipefail
|
|
|
|
|
|
|
|
|
|
for f in $(find /d/a/SourceRootMapping -type f); do
|
|
|
|
|
echo "-----"
|
|
|
|
|
echo $f
|
|
|
|
|
echo "-----"
|
|
|
|
|
cat $f
|
|
|
|
|
echo "-----"
|
|
|
|
|
done
|
2022-02-14 21:49:32 +03:00
|
|
|
|
name: workdirs
|
2021-01-04 22:45:30 +03:00
|
|
|
|
- bash: |
|
|
|
|
|
set -euo pipefail
|
|
|
|
|
git checkout $(release_sha)
|
|
|
|
|
name: checkout_release
|
2021-03-12 09:13:26 +03:00
|
|
|
|
condition: and(succeeded(), eq(variables.is_release, 'true'))
|
2021-01-04 22:45:30 +03:00
|
|
|
|
- template: build-windows.yml
|
|
|
|
|
parameters:
|
|
|
|
|
release_tag: $(release_tag)
|
2021-06-03 12:24:52 +03:00
|
|
|
|
# Azure pipeline’s variable and parameter expansion is utter garbage.
|
|
|
|
|
# For whatever reason `env` values only seem to be able to use macro syntax
|
|
|
|
|
# and not runtime expression. is_release however is a runtime variable
|
|
|
|
|
# so template conditions won’t work. Therefore we define the variable here
|
|
|
|
|
# with a runtime expression, set the parameter to the (unexpanded) string "$(skip_tests)"
|
|
|
|
|
# and then splice that in via a template parameter.
|
|
|
|
|
skip_tests: $(skip_tests)
|
2021-01-04 22:45:30 +03:00
|
|
|
|
is_release: variables.is_release
|
2022-01-26 16:57:39 +03:00
|
|
|
|
is_split_release: $(is_split_release)
|
2023-12-04 12:52:33 +03:00
|
|
|
|
test_mode: ${{parameters.test_mode}}
|
2021-06-11 13:16:08 +03:00
|
|
|
|
- template: upload-bazel-metrics.yml
|
2021-01-04 22:45:30 +03:00
|
|
|
|
- template: tell-slack-failed.yml
|
|
|
|
|
parameters:
|
|
|
|
|
trigger_sha: '$(trigger_sha)'
|
|
|
|
|
- template: report-end.yml
|
|
|
|
|
|
2021-08-17 19:59:12 +03:00
|
|
|
|
- job: platform_independence_test
|
2021-11-10 15:55:33 +03:00
|
|
|
|
condition: and(succeeded(),
|
|
|
|
|
eq(dependencies.check_for_release.outputs['out.is_release'], 'false'))
|
2021-08-17 19:59:12 +03:00
|
|
|
|
dependsOn:
|
|
|
|
|
- Windows
|
|
|
|
|
- Linux
|
2024-03-11 12:58:22 +03:00
|
|
|
|
- macOS
|
2021-08-17 19:59:12 +03:00
|
|
|
|
pool:
|
|
|
|
|
name: 'ubuntu_20_04'
|
|
|
|
|
demands: assignment -equals default
|
|
|
|
|
steps:
|
|
|
|
|
- checkout: self
|
|
|
|
|
- bash: ci/dev-env-install.sh
|
|
|
|
|
displayName: 'Build/Install the Developer Environment'
|
|
|
|
|
- task: DownloadPipelineArtifact@2
|
|
|
|
|
inputs:
|
2024-02-25 17:43:12 +03:00
|
|
|
|
artifactName: platform-independence-dar-linux-intel
|
|
|
|
|
targetPath: $(Build.StagingDirectory)/platform-independence/linux-intel/
|
|
|
|
|
- task: DownloadPipelineArtifact@2
|
|
|
|
|
inputs:
|
|
|
|
|
artifactName: platform-independence-dar-linux-arm
|
|
|
|
|
targetPath: $(Build.StagingDirectory)/platform-independence/linux-arm/
|
2021-08-17 19:59:12 +03:00
|
|
|
|
- task: DownloadPipelineArtifact@2
|
|
|
|
|
inputs:
|
|
|
|
|
artifactName: platform-independence-dar-windows
|
|
|
|
|
targetPath: $(Build.StagingDirectory)/platform-independence/windows/
|
2024-03-11 12:58:22 +03:00
|
|
|
|
- task: DownloadPipelineArtifact@2
|
|
|
|
|
inputs:
|
|
|
|
|
artifactName: platform-independence-dar-macos
|
|
|
|
|
targetPath: $(Build.StagingDirectory)/platform-independence/macos/
|
2021-08-17 19:59:12 +03:00
|
|
|
|
- bash: |
|
|
|
|
|
set -euo pipefail
|
|
|
|
|
eval "$(./dev-env/bin/dade-assist)"
|
|
|
|
|
|
|
|
|
|
DIR1=$(mktemp -d)
|
|
|
|
|
DIR2=$(mktemp -d)
|
|
|
|
|
DIR3=$(mktemp -d)
|
2024-02-25 17:43:12 +03:00
|
|
|
|
DIR4=$(mktemp -d)
|
|
|
|
|
trap "rm -rf $DIR1 $DIR2 $DIR3 $DIR4" EXIT
|
2021-08-17 19:59:12 +03:00
|
|
|
|
|
2024-02-25 17:43:12 +03:00
|
|
|
|
unzip -d $DIR1 $(Build.StagingDirectory)/platform-independence/linux-intel/platform-independence.dar
|
2021-08-17 19:59:12 +03:00
|
|
|
|
unzip -d $DIR2 $(Build.StagingDirectory)/platform-independence/windows/platform-independence.dar
|
2024-03-11 12:58:22 +03:00
|
|
|
|
unzip -d $DIR3 $(Build.StagingDirectory)/platform-independence/macos/platform-independence.dar
|
2024-02-25 17:43:12 +03:00
|
|
|
|
unzip -d $DIR4 $(Build.StagingDirectory)/platform-independence/linux-arm/platform-independence.dar
|
2021-08-17 19:59:12 +03:00
|
|
|
|
|
|
|
|
|
# hie/hi files may differ.
|
|
|
|
|
diff -r --strip-trailing-cr -x '*.hie' -x '*.hi' $DIR1 $DIR2
|
2024-03-11 12:58:22 +03:00
|
|
|
|
diff -r --strip-trailing-cr -x '*.hie' -x '*.hi' $DIR1 $DIR3
|
2024-02-25 17:43:12 +03:00
|
|
|
|
diff -r --strip-trailing-cr -x '*.hie' -x '*.hi' $DIR1 $DIR4
|
2021-08-17 19:59:12 +03:00
|
|
|
|
displayName: 'Compare platform-independence dars of different platforms.'
|
|
|
|
|
|
2021-01-04 22:45:30 +03:00
|
|
|
|
- job: compatibility_ts_libs
|
|
|
|
|
dependsOn:
|
|
|
|
|
- check_for_release
|
2021-03-17 16:33:20 +03:00
|
|
|
|
condition: and(succeeded(),
|
|
|
|
|
not(eq(dependencies.check_for_release.outputs['out.is_release'], 'true')))
|
2023-09-01 16:15:36 +03:00
|
|
|
|
timeoutInMinutes: 240
|
2021-01-04 22:45:30 +03:00
|
|
|
|
pool:
|
2021-01-27 19:38:34 +03:00
|
|
|
|
name: ubuntu_20_04
|
2021-01-04 22:45:30 +03:00
|
|
|
|
demands: assignment -equals default
|
|
|
|
|
steps:
|
|
|
|
|
- template: report-start.yml
|
|
|
|
|
- checkout: self
|
2021-01-20 19:22:53 +03:00
|
|
|
|
- template: clean-up.yml
|
2021-01-04 22:45:30 +03:00
|
|
|
|
- template: compatibility_ts_libs.yml
|
|
|
|
|
- template: tell-slack-failed.yml
|
|
|
|
|
- template: report-end.yml
|
|
|
|
|
|
|
|
|
|
- job: compatibility_linux
|
|
|
|
|
dependsOn:
|
|
|
|
|
- check_for_release
|
|
|
|
|
- compatibility_ts_libs
|
2023-09-01 16:15:36 +03:00
|
|
|
|
timeoutInMinutes: 240
|
2021-01-04 22:45:30 +03:00
|
|
|
|
pool:
|
2021-01-27 19:38:34 +03:00
|
|
|
|
name: ubuntu_20_04
|
2021-01-04 22:45:30 +03:00
|
|
|
|
demands: assignment -equals default
|
|
|
|
|
steps:
|
|
|
|
|
- template: report-start.yml
|
|
|
|
|
- checkout: self
|
2021-01-20 19:22:53 +03:00
|
|
|
|
- template: clean-up.yml
|
2021-01-04 22:45:30 +03:00
|
|
|
|
- template: compatibility.yml
|
|
|
|
|
parameters:
|
|
|
|
|
test_flags: '--quick'
|
|
|
|
|
- template: tell-slack-failed.yml
|
|
|
|
|
- template: report-end.yml
|
|
|
|
|
|
2021-10-07 11:55:38 +03:00
|
|
|
|
# For main and PRs targeting main, we simply check against the most recent stable tag.
|
2021-09-23 18:50:33 +03:00
|
|
|
|
- job: compatibility_stable_protobuf
|
|
|
|
|
pool:
|
|
|
|
|
name: ubuntu_20_04
|
|
|
|
|
demands: assignment -equals default
|
|
|
|
|
steps:
|
|
|
|
|
- checkout: self
|
2022-11-17 17:58:49 +03:00
|
|
|
|
fetchTags: true
|
2021-10-04 21:10:41 +03:00
|
|
|
|
- bash: ci/check-protobuf-stability.sh
|
2021-09-23 18:50:33 +03:00
|
|
|
|
- template: tell-slack-failed.yml
|
|
|
|
|
|
2022-11-14 18:06:34 +03:00
|
|
|
|
- job: collect_build_data_failed
|
|
|
|
|
condition: failed()
|
2021-01-04 22:45:30 +03:00
|
|
|
|
dependsOn:
|
|
|
|
|
- Linux
|
|
|
|
|
- macOS
|
|
|
|
|
- Windows
|
|
|
|
|
- release
|
|
|
|
|
- git_sha
|
|
|
|
|
- compatibility_linux
|
2021-09-23 18:50:33 +03:00
|
|
|
|
- compatibility_stable_protobuf
|
2021-03-24 14:18:58 +03:00
|
|
|
|
- check_for_release
|
2022-11-15 15:52:40 +03:00
|
|
|
|
pool:
|
|
|
|
|
name: "ubuntu_20_04"
|
|
|
|
|
demands: assignment -equals default
|
2022-11-14 18:06:34 +03:00
|
|
|
|
|
|
|
|
|
- job: collect_build_data
|
|
|
|
|
condition: always()
|
|
|
|
|
dependsOn:
|
|
|
|
|
- collect_build_data_failed
|
|
|
|
|
variables:
|
|
|
|
|
failed_result: $[ dependencies.collect_build_data_failed.result ]
|
2022-11-15 15:52:40 +03:00
|
|
|
|
pool:
|
|
|
|
|
name: "ubuntu_20_04"
|
|
|
|
|
demands: assignment -equals default
|
2022-11-14 18:06:34 +03:00
|
|
|
|
steps:
|
|
|
|
|
- bash: "exit 1"
|
|
|
|
|
# Since 'collect_build_data_failed' only runs when 'failed()', if it was
|
|
|
|
|
# successful that means at least one of its dependencies failed, so we set
|
|
|
|
|
# the result of 'collect_build_data' to 'Failed' with 'exit 1'
|
|
|
|
|
condition: eq(variables.failed_result, 'Succeeded')
|