2021-01-04 22:45:30 +03:00
|
|
|
|
# Copyright (c) 2021 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
|
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
|
|
|
|
|
jobs:
|
2021-05-19 15:24:47 +03:00
|
|
|
|
|
|
|
|
|
- job: fix_bazel_cache
|
|
|
|
|
timeoutInMinutes: 120
|
2021-06-08 11:47:42 +03:00
|
|
|
|
condition: eq(variables['System.PullRequest.IsFork'], 'False')
|
2021-05-19 15:24:47 +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'
|
|
|
|
|
- template: bash-lib.yml
|
|
|
|
|
parameters:
|
|
|
|
|
var_name: bash-lib
|
|
|
|
|
- bash: |
|
|
|
|
|
set -euo pipefail
|
|
|
|
|
eval "$(dev-env/bin/dade assist)"
|
|
|
|
|
|
|
|
|
|
bazel build //ci/cron:cron
|
|
|
|
|
|
|
|
|
|
key=$(mktemp)
|
|
|
|
|
cleanup="rm -rf $key ~/.config/gcloud"
|
|
|
|
|
trap "$cleanup" EXIT
|
|
|
|
|
echo "$GCRED" > $key
|
|
|
|
|
gcloud auth activate-service-account --key-file=$key
|
|
|
|
|
export BOTO_CONFIG=/dev/null
|
|
|
|
|
# 90 minutes should provide enough overlap for an hourly
|
|
|
|
|
# cronjob.
|
|
|
|
|
./bazel-bin/ci/cron/cron bazel-cache --age 90 --delete
|
|
|
|
|
env:
|
|
|
|
|
GCRED: $(GOOGLE_APPLICATION_CREDENTIALS_CONTENT)
|
|
|
|
|
- template: tell-slack-failed.yml
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
- template: da-ghc-lib/compile.yml
|
|
|
|
|
parameters:
|
|
|
|
|
final_job_name: da_ghc_lib
|
|
|
|
|
|
|
|
|
|
- job: Linux
|
|
|
|
|
dependsOn:
|
|
|
|
|
- da_ghc_lib
|
|
|
|
|
- check_for_release
|
2021-06-11 13:16:08 +03:00
|
|
|
|
- git_sha
|
2021-01-04 22:45:30 +03:00
|
|
|
|
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
|
2021-01-04 22:45:30 +03:00
|
|
|
|
timeoutInMinutes: 360
|
|
|
|
|
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
|
|
|
|
|
- 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:
|
|
|
|
|
release_tag: $(release_tag)
|
|
|
|
|
name: 'linux'
|
|
|
|
|
is_release: variables.is_release
|
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'))
|
2021-01-11 16:30:51 +03:00
|
|
|
|
- task: PublishBuildArtifacts@1
|
|
|
|
|
inputs:
|
|
|
|
|
pathtoPublish: 'bazel-bin/docs/html.tar.gz'
|
|
|
|
|
artifactName: 'Docs bundle'
|
2021-01-04 22:45:30 +03:00
|
|
|
|
- template: tell-slack-failed.yml
|
|
|
|
|
parameters:
|
|
|
|
|
trigger_sha: '$(trigger_sha)'
|
|
|
|
|
- template: report-end.yml
|
|
|
|
|
|
2021-05-17 18:04:53 +03:00
|
|
|
|
- job: Linux_scala_2_12
|
2021-06-10 15:02:43 +03:00
|
|
|
|
# We disable this for release builds. The actual release happens via the regular Linux builds
|
|
|
|
|
# and running tests on two scala versions doesn’t add any value if the tests already
|
|
|
|
|
# passed on the respective PRs that added the changes. The only difference here
|
|
|
|
|
# is the release version which should not affect things differently depending on the
|
|
|
|
|
# Scala version.
|
|
|
|
|
condition: and(succeeded(),
|
|
|
|
|
eq(dependencies.check_for_release.outputs['out.is_release'], 'false'))
|
2021-02-17 16:32:04 +03:00
|
|
|
|
dependsOn:
|
|
|
|
|
- da_ghc_lib
|
|
|
|
|
- check_for_release
|
2021-06-11 13:16:08 +03:00
|
|
|
|
- git_sha
|
2021-02-17 16:32:04 +03:00
|
|
|
|
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: $[ eq(dependencies.check_for_release.outputs['out.is_release'], 'true') ]
|
|
|
|
|
- template: job-variables.yml
|
2021-02-17 16:32:04 +03:00
|
|
|
|
timeoutInMinutes: 360
|
|
|
|
|
pool:
|
|
|
|
|
name: 'ubuntu_20_04'
|
|
|
|
|
demands: assignment -equals default
|
|
|
|
|
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-02-17 16:32:04 +03:00
|
|
|
|
- template: clean-up.yml
|
|
|
|
|
- template: build-unix.yml
|
|
|
|
|
parameters:
|
|
|
|
|
release_tag: $(release_tag)
|
2021-05-17 18:04:53 +03:00
|
|
|
|
name: 'linux-scala-2.12'
|
2021-02-17 16:32:04 +03:00
|
|
|
|
is_release: variables.is_release
|
2021-08-12 17:25:53 +03:00
|
|
|
|
scala_version: "2.12.14"
|
2021-06-11 13:16:08 +03:00
|
|
|
|
- template: upload-bazel-metrics.yml
|
2021-02-17 16:32:04 +03:00
|
|
|
|
- template: tell-slack-failed.yml
|
|
|
|
|
parameters:
|
|
|
|
|
trigger_sha: '$(trigger_sha)'
|
|
|
|
|
- template: report-end.yml
|
|
|
|
|
|
2021-01-04 22:45:30 +03:00
|
|
|
|
- job: macOS
|
|
|
|
|
dependsOn:
|
|
|
|
|
- da_ghc_lib
|
|
|
|
|
- check_for_release
|
2021-06-11 13:16:08 +03:00
|
|
|
|
- git_sha
|
2021-01-04 22:45:30 +03:00
|
|
|
|
timeoutInMinutes: 360
|
|
|
|
|
pool:
|
|
|
|
|
name: macOS-pool
|
|
|
|
|
demands: assignment -equals default
|
|
|
|
|
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
|
2021-01-04 22:45:30 +03:00
|
|
|
|
steps:
|
|
|
|
|
- template: report-start.yml
|
|
|
|
|
- template: clear-shared-segments-macos.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:
|
|
|
|
|
release_tag: $(release_tag)
|
|
|
|
|
name: macos
|
|
|
|
|
is_release: variables.is_release
|
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
|
|
|
|
|
|
|
|
|
|
- template: patch_bazel_windows/compile.yml
|
|
|
|
|
parameters:
|
|
|
|
|
final_job_name: patch_bazel_windows
|
|
|
|
|
|
|
|
|
|
- job: Windows
|
|
|
|
|
dependsOn:
|
|
|
|
|
- da_ghc_lib
|
|
|
|
|
- check_for_release
|
|
|
|
|
- patch_bazel_windows
|
2021-06-11 13:16:08 +03:00
|
|
|
|
- git_sha
|
2021-01-04 22:45:30 +03:00
|
|
|
|
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'] ]
|
|
|
|
|
- name: skip_tests
|
|
|
|
|
value: $[ and(eq(variables.is_release, 'true'),
|
2021-06-03 12:24:52 +03:00
|
|
|
|
eq(variables['Build.SourceBranchName'], 'main')) ]
|
2021-06-11 13:16:08 +03:00
|
|
|
|
- template: job-variables.yml
|
2021-01-04 22:45:30 +03:00
|
|
|
|
timeoutInMinutes: 360
|
|
|
|
|
pool:
|
|
|
|
|
name: 'windows-pool'
|
|
|
|
|
demands: assignment -equals default
|
|
|
|
|
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-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
|
2021-06-11 13:16:08 +03:00
|
|
|
|
- template: upload-bazel-metrics.yml
|
2021-01-04 22:45:30 +03:00
|
|
|
|
- task: PublishBuildArtifacts@1
|
|
|
|
|
condition: succeededOrFailed()
|
|
|
|
|
inputs:
|
2021-03-11 13:44:02 +03:00
|
|
|
|
pathtoPublish: '$(Build.StagingDirectory)/logs'
|
2021-01-04 22:45:30 +03:00
|
|
|
|
artifactName: 'Bazel Logs'
|
|
|
|
|
- template: tell-slack-failed.yml
|
|
|
|
|
parameters:
|
|
|
|
|
trigger_sha: '$(trigger_sha)'
|
|
|
|
|
- template: report-end.yml
|
|
|
|
|
|
2021-02-05 19:36:56 +03:00
|
|
|
|
- job: Linux_oracle
|
|
|
|
|
dependsOn:
|
|
|
|
|
- da_ghc_lib
|
|
|
|
|
timeoutInMinutes: 360
|
|
|
|
|
pool:
|
|
|
|
|
name: 'ubuntu_20_04'
|
|
|
|
|
demands: assignment -equals default
|
|
|
|
|
steps:
|
|
|
|
|
- template: report-start.yml
|
|
|
|
|
- checkout: self
|
|
|
|
|
- bash: ci/dev-env-install.sh
|
|
|
|
|
displayName: 'Build/Install the Developer Environment'
|
|
|
|
|
- template: clean-up.yml
|
|
|
|
|
- bash: |
|
|
|
|
|
source dev-env/lib/ensure-nix
|
|
|
|
|
ci/dev-env-push.py
|
|
|
|
|
displayName: 'Push Developer Environment build results'
|
2021-03-12 09:13:26 +03:00
|
|
|
|
condition: and(succeeded(), eq(variables['System.PullRequest.IsFork'], 'False'))
|
2021-02-05 19:36:56 +03:00
|
|
|
|
env:
|
|
|
|
|
# to upload to the Nix cache
|
|
|
|
|
GOOGLE_APPLICATION_CREDENTIALS_CONTENT: $(GOOGLE_APPLICATION_CREDENTIALS_CONTENT)
|
|
|
|
|
NIX_SECRET_KEY_CONTENT: $(NIX_SECRET_KEY_CONTENT)
|
|
|
|
|
- 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)
|
|
|
|
|
- bash: |
|
|
|
|
|
set -euo pipefail
|
|
|
|
|
eval "$(./dev-env/bin/dade-assist)"
|
2021-03-26 16:43:04 +03:00
|
|
|
|
docker login --username "$DOCKER_LOGIN" --password "$DOCKER_PASSWORD"
|
2021-08-17 16:28:26 +03:00
|
|
|
|
IMAGE=$(cat ci/oracle_image)
|
2021-03-26 16:43:04 +03:00
|
|
|
|
docker pull $IMAGE
|
2021-02-05 19:36:56 +03:00
|
|
|
|
# Cleanup stray containers that might still be running from
|
|
|
|
|
# another build that didn’t get shut down cleanly.
|
|
|
|
|
docker rm -f oracle || true
|
2021-03-29 17:56:30 +03:00
|
|
|
|
# Oracle does not like if you connect to it via localhost if it’s running in the container.
|
|
|
|
|
# Interestingly it works if you use the external IP of the host so the issue is
|
|
|
|
|
# not the host it is listening on (it claims for that to be 0.0.0.0).
|
|
|
|
|
# --network host is a cheap escape hatch for this.
|
|
|
|
|
docker run -d --rm --name oracle --network host -e ORACLE_PWD=$ORACLE_PWD $IMAGE
|
2021-02-05 19:36:56 +03:00
|
|
|
|
function cleanup() {
|
|
|
|
|
docker rm -f oracle
|
|
|
|
|
}
|
|
|
|
|
trap cleanup EXIT
|
|
|
|
|
testConnection() {
|
2021-04-28 07:10:43 +03:00
|
|
|
|
docker exec oracle bash -c 'sqlplus -L '"$ORACLE_USERNAME"'/'"$ORACLE_PWD"'@//localhost:'"$ORACLE_PORT"'/ORCLPDB1 <<< "select * from dba_users;"; exit $?' >/dev/null
|
2021-02-05 19:36:56 +03:00
|
|
|
|
}
|
|
|
|
|
until testConnection
|
|
|
|
|
do
|
|
|
|
|
echo "Could not connect to Oracle, trying again..."
|
|
|
|
|
sleep 1
|
|
|
|
|
done
|
2021-02-17 11:50:35 +03:00
|
|
|
|
# Actually run some tests
|
2021-04-28 07:10:43 +03:00
|
|
|
|
bazel test \
|
|
|
|
|
--config=oracle \
|
2021-03-31 19:39:08 +03:00
|
|
|
|
//ledger-service/http-json-oracle/... \
|
2021-04-27 01:34:17 +03:00
|
|
|
|
//triggers/service:test-oracle \
|
2021-06-29 01:51:48 +03:00
|
|
|
|
//ledger/participant-integration-api:participant-integration-api-tests-oracle \
|
|
|
|
|
//ledger/ledger-on-sql:conformance-test-oracle \
|
2021-09-14 15:00:30 +03:00
|
|
|
|
//ledger/ledger-on-sql:conformance-test-append-only-oracle
|
2021-02-05 19:36:56 +03:00
|
|
|
|
env:
|
2021-03-26 16:43:04 +03:00
|
|
|
|
DOCKER_LOGIN: $(DOCKER_LOGIN)
|
|
|
|
|
DOCKER_PASSWORD: $(DOCKER_PASSWORD)
|
2021-02-05 19:36:56 +03:00
|
|
|
|
displayName: 'Build'
|
2021-03-12 09:13:26 +03:00
|
|
|
|
condition: and(succeeded(), eq(variables['System.PullRequest.IsFork'], 'False'))
|
2021-07-29 13:58:44 +03:00
|
|
|
|
|
|
|
|
|
- task: PublishBuildArtifacts@1
|
|
|
|
|
condition: failed()
|
|
|
|
|
displayName: 'Publish the bazel test logs'
|
|
|
|
|
inputs:
|
|
|
|
|
pathtoPublish: 'bazel-testlogs/'
|
|
|
|
|
artifactName: 'Test logs Oracle'
|
|
|
|
|
|
2021-02-05 19:36:56 +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
|
|
|
|
|
dependsOn:
|
|
|
|
|
- Windows
|
|
|
|
|
- Linux
|
|
|
|
|
- macOS
|
|
|
|
|
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:
|
|
|
|
|
artifactName: platform-independence-dar-linux
|
|
|
|
|
targetPath: $(Build.StagingDirectory)/platform-independence/linux/
|
|
|
|
|
- task: DownloadPipelineArtifact@2
|
|
|
|
|
inputs:
|
|
|
|
|
artifactName: platform-independence-dar-windows
|
|
|
|
|
targetPath: $(Build.StagingDirectory)/platform-independence/windows/
|
|
|
|
|
- task: DownloadPipelineArtifact@2
|
|
|
|
|
inputs:
|
|
|
|
|
artifactName: platform-independence-dar-macos
|
|
|
|
|
targetPath: $(Build.StagingDirectory)/platform-independence/macos/
|
|
|
|
|
- bash: |
|
|
|
|
|
set -euo pipefail
|
|
|
|
|
eval "$(./dev-env/bin/dade-assist)"
|
|
|
|
|
|
|
|
|
|
DIR1=$(mktemp -d)
|
|
|
|
|
DIR2=$(mktemp -d)
|
|
|
|
|
DIR3=$(mktemp -d)
|
|
|
|
|
trap "rm -rf $DIR1; rm -rf $DIR2; rm -rf $DIR3" EXIT
|
|
|
|
|
|
|
|
|
|
unzip -d $DIR1 $(Build.StagingDirectory)/platform-independence/linux/platform-independence.dar
|
|
|
|
|
unzip -d $DIR2 $(Build.StagingDirectory)/platform-independence/windows/platform-independence.dar
|
|
|
|
|
unzip -d $DIR3 $(Build.StagingDirectory)/platform-independence/macos/platform-independence.dar
|
|
|
|
|
|
|
|
|
|
# hie/hi files may differ.
|
|
|
|
|
diff -r --strip-trailing-cr -x '*.hie' -x '*.hi' $DIR1 $DIR2
|
|
|
|
|
diff -r --strip-trailing-cr -x '*.hie' -x '*.hi' $DIR1 $DIR3
|
|
|
|
|
displayName: 'Compare platform-independence dars of different platforms.'
|
|
|
|
|
|
2021-01-04 22:45:30 +03:00
|
|
|
|
- job: compatibility_ts_libs
|
|
|
|
|
dependsOn:
|
|
|
|
|
- da_ghc_lib
|
|
|
|
|
- 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')))
|
2021-01-04 22:45:30 +03:00
|
|
|
|
timeoutInMinutes: 360
|
|
|
|
|
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:
|
|
|
|
|
- da_ghc_lib
|
|
|
|
|
- check_for_release
|
|
|
|
|
- compatibility_ts_libs
|
|
|
|
|
timeoutInMinutes: 360
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
- job: check_for_release
|
|
|
|
|
dependsOn:
|
|
|
|
|
- git_sha
|
|
|
|
|
variables:
|
|
|
|
|
branch_sha: $[ dependencies.git_sha.outputs['out.branch'] ]
|
|
|
|
|
fork_sha: $[ dependencies.git_sha.outputs['out.fork_point'] ]
|
|
|
|
|
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-17 16:32:04 +03:00
|
|
|
|
eval "$(./dev-env/bin/dade-assist)"
|
2021-02-09 13:42:34 +03:00
|
|
|
|
source $(bash-lib)
|
2021-01-04 22:45:30 +03:00
|
|
|
|
|
|
|
|
|
./release.sh check
|
|
|
|
|
|
|
|
|
|
changes_release_files() {
|
|
|
|
|
changed="$(git diff-tree --no-commit-id --name-only -r $(fork_sha) $(branch_sha) | sort)"
|
|
|
|
|
[ "LATEST" = "$changed" ]
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
changes_one_line_in_latest() {
|
|
|
|
|
changed="$(git diff-tree --no-commit-id --numstat -r $(fork_sha) $(branch_sha) -- LATEST | awk '{print $1 "_" $2}')"
|
|
|
|
|
add_one="1_0"
|
|
|
|
|
change_one="1_1"
|
|
|
|
|
[[ "$add_one" == "$changed" || "$change_one" == "$changed" ]]
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
added_line() {
|
|
|
|
|
echo "$(git diff $(fork_sha) $(branch_sha) -- LATEST | tail -n+6 | grep '^\+' | cut -c2-)"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if changes_release_files; then
|
|
|
|
|
if changes_one_line_in_latest; then
|
|
|
|
|
setvar is_release true
|
|
|
|
|
setvar trigger_sha $(branch_sha)
|
|
|
|
|
setvar release_sha "$(added_line | awk '{print $1}')"
|
2021-02-17 16:32:04 +03:00
|
|
|
|
RELEASE_TAG="$(added_line | awk '{print $2}')"
|
|
|
|
|
setvar release_tag "$RELEASE_TAG"
|
2021-01-04 22:45:30 +03:00
|
|
|
|
else
|
|
|
|
|
echo "Release commit should only add one version."
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
else
|
2021-02-17 16:32:04 +03:00
|
|
|
|
RELEASE_TAG="0.0.0"
|
2021-01-04 22:45:30 +03:00
|
|
|
|
setvar is_release false
|
|
|
|
|
fi
|
2021-02-17 16:32:04 +03:00
|
|
|
|
|
|
|
|
|
# This is the last snapshot that does not support Scala 2.13.
|
2021-02-17 17:23:58 +03:00
|
|
|
|
CMP="$(semver compare "$RELEASE_TAG" '1.11.0-snapshot.20210212.6300.0.ad161d7f')"
|
|
|
|
|
|
|
|
|
|
if [[ $CMP == '1' || "$RELEASE_TAG" == '0.0.0' ]]; then
|
2021-02-17 16:32:04 +03:00
|
|
|
|
setvar scala_2_13 true
|
|
|
|
|
else
|
|
|
|
|
setvar scala_2_13 false
|
|
|
|
|
fi
|
2021-01-04 22:45:30 +03:00
|
|
|
|
name: out
|
|
|
|
|
|
|
|
|
|
- job: collect_build_data
|
|
|
|
|
condition: always()
|
|
|
|
|
dependsOn:
|
|
|
|
|
- Linux
|
2021-03-26 18:26:24 +03:00
|
|
|
|
- Linux_oracle
|
2021-05-17 18:04:53 +03:00
|
|
|
|
- Linux_scala_2_12
|
2021-01-04 22:45:30 +03:00
|
|
|
|
- macOS
|
|
|
|
|
- Windows
|
|
|
|
|
- release
|
|
|
|
|
- git_sha
|
|
|
|
|
- compatibility_linux
|
2021-03-24 14:18:58 +03:00
|
|
|
|
- check_for_release
|
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
|
|
|
|
|
variables:
|
|
|
|
|
Linux.start: $[ dependencies.Linux.outputs['start.time'] ]
|
|
|
|
|
Linux.machine: $[ dependencies.Linux.outputs['start.machine'] ]
|
|
|
|
|
Linux.end: $[ dependencies.Linux.outputs['end.time'] ]
|
|
|
|
|
Linux.status: $[ dependencies.Linux.result ]
|
2021-03-26 18:26:24 +03:00
|
|
|
|
Linux_oracle.start: $[ dependencies.Linux_oracle.outputs['start.time'] ]
|
|
|
|
|
Linux_oracle.machine: $[ dependencies.Linux_oracle.outputs['start.machine'] ]
|
|
|
|
|
Linux_oracle.end: $[ dependencies.Linux_oracle.outputs['end.time'] ]
|
|
|
|
|
Linux_oracle.status: $[ dependencies.Linux_oracle.result ]
|
2021-05-17 18:04:53 +03:00
|
|
|
|
Linux_scala_2_12.start: $[ dependencies.Linux_scala_2_12.outputs['start.time'] ]
|
|
|
|
|
Linux_scala_2_12.machine: $[ dependencies.Linux_scala_2_12.outputs['start.machine'] ]
|
|
|
|
|
Linux_scala_2_12.end: $[ dependencies.Linux_scala_2_12.outputs['end.time'] ]
|
|
|
|
|
Linux_scala_2_12.status: $[ dependencies.Linux_scala_2_12.result ]
|
2021-01-04 22:45:30 +03:00
|
|
|
|
macOS.start: $[ dependencies.macOS.outputs['start.time'] ]
|
|
|
|
|
macOS.machine: $[ dependencies.macOS.outputs['start.machine'] ]
|
|
|
|
|
macOS.end: $[ dependencies.macOS.outputs['end.time'] ]
|
|
|
|
|
macOS.status: $[ dependencies.macOS.result ]
|
|
|
|
|
Windows.start: $[ dependencies.Windows.outputs['start.time'] ]
|
|
|
|
|
Windows.machine: $[ dependencies.Windows.outputs['start.machine'] ]
|
|
|
|
|
Windows.end: $[ dependencies.Windows.outputs['end.time'] ]
|
|
|
|
|
Windows.status: $[ dependencies.Windows.result ]
|
|
|
|
|
release.start: $[ dependencies.release.outputs['start.time'] ]
|
|
|
|
|
release.machine: $[ dependencies.release.outputs['start.machine'] ]
|
|
|
|
|
release.end: $[ dependencies.release.outputs['end.time'] ]
|
|
|
|
|
release.status: $[ dependencies.release.result ]
|
|
|
|
|
compatibility_linux.start: $[ dependencies.compatibility_linux.outputs['start.time'] ]
|
|
|
|
|
compatibility_linux.machine: $[ dependencies.compatibility_linux.outputs['start.machine'] ]
|
|
|
|
|
compatibility_linux.end: $[ dependencies.compatibility_linux.outputs['end.time'] ]
|
|
|
|
|
compatibility_linux.status: $[ dependencies.compatibility_linux.result ]
|
|
|
|
|
|
|
|
|
|
branch_sha: $[ dependencies.git_sha.outputs['out.branch'] ]
|
|
|
|
|
main_sha: $[ dependencies.git_sha.outputs['out.main'] ]
|
|
|
|
|
fork_sha: $[ dependencies.git_sha.outputs['out.fork_point'] ]
|
|
|
|
|
|
2021-03-24 14:18:58 +03:00
|
|
|
|
is_release: $[ dependencies.check_for_release.outputs['out.is_release'] ]
|
|
|
|
|
|
2021-01-04 22:45:30 +03:00
|
|
|
|
# Using expression syntax so we get an empty string if not set, rather
|
|
|
|
|
# than the raw $(VarName) string. Expression syntax works on the
|
|
|
|
|
# variables key, but not on the env one, so we need an extra indirection.
|
|
|
|
|
# Note: These Azure variables are only set for PR builds.
|
|
|
|
|
pr.num: $[ variables['System.PullRequest.PullRequestNumber'] ]
|
|
|
|
|
pr.branch: $[ variables['System.PullRequest.SourceBranch'] ]
|
|
|
|
|
steps:
|
|
|
|
|
- template: bash-lib.yml
|
|
|
|
|
parameters:
|
|
|
|
|
var_name: bash_lib
|
|
|
|
|
- bash: |
|
|
|
|
|
set -euo pipefail
|
|
|
|
|
|
|
|
|
|
eval "$(./dev-env/bin/dade-assist)"
|
|
|
|
|
source $(bash_lib)
|
|
|
|
|
|
|
|
|
|
REPORT=$(mktemp)
|
|
|
|
|
cat >$REPORT <<END
|
|
|
|
|
{"jobs": {"Linux": {"start": "$(Linux.start)",
|
|
|
|
|
"machine": "$(Linux.machine)",
|
|
|
|
|
"end": "$(Linux.end)",
|
|
|
|
|
"status": "$(Linux.status)"},
|
2021-03-26 18:26:24 +03:00
|
|
|
|
"Linux_oracle": {"start": "$(Linux_oracle.start)",
|
|
|
|
|
"machine": "$(Linux_oracle.machine)",
|
|
|
|
|
"end": "$(Linux_oracle.end)",
|
|
|
|
|
"status": "$(Linux_oracle.status)"},
|
2021-05-17 18:04:53 +03:00
|
|
|
|
"Linux_scala_2_12": {"start": "$(Linux_scala_2_12.start)",
|
|
|
|
|
"machine": "$(Linux_scala_2_12.machine)",
|
|
|
|
|
"end": "$(Linux_scala_2_12.end)",
|
|
|
|
|
"status": "$(Linux_scala_2_12.status)"},
|
2021-01-04 22:45:30 +03:00
|
|
|
|
"macOS": {"start": "$(macOS.start)",
|
|
|
|
|
"machine": "$(macOS.machine)",
|
|
|
|
|
"end": "$(macOS.end)",
|
|
|
|
|
"status": "$(macOS.status)"},
|
|
|
|
|
"Windows": {"start": "$(Windows.start)",
|
|
|
|
|
"machine": "$(Windows.machine)",
|
|
|
|
|
"end": "$(Windows.end)",
|
|
|
|
|
"status": "$(Windows.status)"},
|
|
|
|
|
"release": {"start": "$(release.start)",
|
|
|
|
|
"machine": "$(release.machine)",
|
|
|
|
|
"end": "$(release.end)",
|
|
|
|
|
"status": "$(release.status)"},
|
|
|
|
|
"compatibility_linux": {"start": "$(compatibility_linux.start)",
|
|
|
|
|
"machine": "$(compatibility_linux.machine)",
|
|
|
|
|
"end": "$(compatibility_linux.end)",
|
2021-05-20 13:37:59 +03:00
|
|
|
|
"status": "$(compatibility_linux.status)"}},
|
2021-01-04 22:45:30 +03:00
|
|
|
|
"id": "$(Build.BuildId)",
|
|
|
|
|
"url": "https://dev.azure.com/digitalasset/daml/_build/results?buildId=$(Build.BuildId)",
|
|
|
|
|
"name": "$(Build.DefinitionName)",
|
|
|
|
|
"version": "$(Build.DefinitionVersion)",
|
|
|
|
|
"queued_by": "$(Build.QueuedBy)",
|
|
|
|
|
"reason": "$(Build.Reason)",
|
|
|
|
|
"branch": "$(Build.SourceBranch)",
|
|
|
|
|
"merge_commit": "$(Build.SourceVersion)",
|
|
|
|
|
"branch_commit": "$(branch_sha)",
|
|
|
|
|
"main_commit": "$(main_sha)",
|
|
|
|
|
"fork_point_commit": "$(fork_sha)",
|
|
|
|
|
"commit_message": $(echo -n "$COMMIT_MSG" | jq -sR),
|
|
|
|
|
"is_fork": "$(System.PullRequest.IsFork)",
|
|
|
|
|
"pr": "$PR_NUM",
|
|
|
|
|
"pr_url": "https://github.com/digital-asset/daml/pull/$PR_NUM",
|
2021-03-24 14:18:58 +03:00
|
|
|
|
"pr_source_branch": "$PR_BRANCH",
|
|
|
|
|
"is_release": $(is_release)}
|
2021-01-04 22:45:30 +03:00
|
|
|
|
END
|
|
|
|
|
# Test above JSON is well formed
|
|
|
|
|
cat $REPORT | jq '.'
|
|
|
|
|
REPORT_GZ=$(mktemp)
|
|
|
|
|
cat $REPORT | gzip -9 > $REPORT_GZ
|
|
|
|
|
# Application credentials will not be set for forks. We give up on
|
|
|
|
|
# tracking those for now. "Not set" in Azure world means set to the
|
|
|
|
|
# expression Azure would otherwise substitute, i.e. the literal value
|
|
|
|
|
# of the string in the `env:` block below.
|
|
|
|
|
if [[ "${GCRED:1:${#GCRED}-1}" != '(GOOGLE_APPLICATION_CREDENTIALS_CONTENT)' ]]; then
|
|
|
|
|
gcs "$GCRED" cp "$REPORT_GZ" "gs://daml-data/builds/$(Build.BuildId)_$(date -u +%Y%m%d_%H%M%SZ).json.gz"
|
|
|
|
|
else
|
|
|
|
|
echo "Could not save build data: no credentials."
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# Linux, macOS and Windows are always required and should always
|
|
|
|
|
# succeed.
|
|
|
|
|
#
|
|
|
|
|
# release only run on releases and is skipped otherwise.
|
2021-07-14 17:29:52 +03:00
|
|
|
|
if [[ !("$(Linux.status)" == "Succeeded" || "$(Linux.status)" == "SucceededWithIssues")
|
2021-03-26 18:26:24 +03:00
|
|
|
|
|| "$(Linux_oracle.status)" != "Succeeded"
|
2021-07-14 17:29:52 +03:00
|
|
|
|
|| !("$(macOS.status)" == "Succeeded" || "$(macOS.status)" == "SucceededWithIssues")
|
2021-01-04 22:45:30 +03:00
|
|
|
|
|| "$(Windows.status)" != "Succeeded"
|
2021-03-24 14:18:58 +03:00
|
|
|
|
|| ("$(is_release)" == "false" && "$(compatibility_linux.status)" != "Succeeded")
|
2021-06-10 16:19:34 +03:00
|
|
|
|
|| ("$(is_release)" == "false" && "$(Linux_scala_2_12.status)" != "Succeeded")
|
2021-01-04 22:45:30 +03:00
|
|
|
|
|| "$(release.status)" == "Canceled" ]]; then
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
env:
|
|
|
|
|
GCRED: $(GOOGLE_APPLICATION_CREDENTIALS_CONTENT)
|
|
|
|
|
# Commit message is always set
|
|
|
|
|
COMMIT_MSG: $(Build.SourceVersionMessage)
|
|
|
|
|
# Because these variables are always set (in the variables block),
|
|
|
|
|
# hopefully these should be set as expected (i.e. either correct
|
|
|
|
|
# value or empty string, but not $(Azure.Variable.Name)).
|
|
|
|
|
PR_NUM: $(pr.num)
|
|
|
|
|
PR_BRANCH: $(pr.branch)
|