diff --git a/ci/build-local-canton.yml b/ci/build-local-canton.yml new file mode 100644 index 00000000000..114c2ef01cc --- /dev/null +++ b/ci/build-local-canton.yml @@ -0,0 +1,45 @@ +# Copyright (c) 2023 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +jobs: +- job: build_canton + timeoutInMinutes: 60 + pool: + name: 'ubuntu_20_04' + demands: assignment -equals default + steps: + - checkout: self + - bash: | + set -euo pipefail + touch canton_sha + if [ -f arbitrary_canton_sha ]; then + cp arbitrary_canton_sha canton_sha + fi + - task: Cache@2 + inputs: + key: '"canton-v3-" | ./canton_sha' + path: $(Build.StagingDirectory)/canton_lib + - bash: | + set -euo pipefail + mkdir -p "$(Build.StagingDirectory)/canton_lib" + touch "$(Build.StagingDirectory)/canton_lib/.keep" + if [ -f arbitrary_canton_sha ] && ! [ -f "$(Build.StagingDirectory)/canton_lib/canton.jar" ]; then + sha=$(cat arbitrary_canton_sha) + cd $(mktemp -d) + git clone https://$GITHUB_TOKEN@github.com/DACH-NY/canton + cd canton + git checkout $sha + sed -i 's|git@github.com:|https://github.com/|' .gitmodules + git submodule init + git submodule update + nix-shell --max-jobs 2 --run "sbt community-app/assembly" + cp community/app/target/scala-*/canton-open-source-*.jar "$(Build.StagingDirectory)/canton_lib/canton.jar" + nix-shell --max-jobs 2 --run "sbt enterprise-app/assembly" + cp enterprise/app/target/scala-*/canton-enterprise-*.jar "$(Build.StagingDirectory)/canton_lib/canton-ee.jar" + fi + env: + GITHUB_TOKEN: $(CANTON_READONLY_TOKEN) + - task: PublishBuildArtifacts@1 + inputs: + pathToPublish: $(Build.StagingDirectory)/canton_lib + artifactName: canton_jar diff --git a/ci/build.yml b/ci/build.yml index 71a2d01fda5..8a6acc57caa 100644 --- a/ci/build.yml +++ b/ci/build.yml @@ -25,47 +25,7 @@ jobs: fi name: out -- job: build_canton - timeoutInMinutes: 60 - pool: - name: 'ubuntu_20_04' - demands: assignment -equals default - steps: - - checkout: self - - bash: | - set -euo pipefail - touch canton_sha - if [ -f arbitrary_canton_sha ]; then - cp arbitrary_canton_sha canton_sha - fi - - task: Cache@2 - inputs: - key: '"canton-v3-" | ./canton_sha' - path: $(Build.StagingDirectory)/canton_lib - - bash: | - set -euo pipefail - mkdir -p "$(Build.StagingDirectory)/canton_lib" - touch "$(Build.StagingDirectory)/canton_lib/.keep" - if [ -f arbitrary_canton_sha ] && ! [ -f "$(Build.StagingDirectory)/canton_lib/canton.jar" ]; then - sha=$(cat arbitrary_canton_sha) - cd $(mktemp -d) - git clone https://$GITHUB_TOKEN@github.com/DACH-NY/canton - cd canton - git checkout $sha - sed -i 's|git@github.com:|https://github.com/|' .gitmodules - git submodule init - git submodule update - nix-shell --max-jobs 2 --run "sbt community-app/assembly" - cp community/app/target/scala-*/canton-open-source-*.jar "$(Build.StagingDirectory)/canton_lib/canton.jar" - nix-shell --max-jobs 2 --run "sbt enterprise-app/assembly" - cp enterprise/app/target/scala-*/canton-enterprise-*.jar "$(Build.StagingDirectory)/canton_lib/canton-ee.jar" - fi - env: - GITHUB_TOKEN: $(CANTON_READONLY_TOKEN) - - task: PublishBuildArtifacts@1 - inputs: - pathToPublish: $(Build.StagingDirectory)/canton_lib - artifactName: canton_jar +- template: build-local-canton.yml - job: Linux dependsOn: diff --git a/ci/cron/daily-compat.yml b/ci/cron/daily-compat.yml index 9211a2ca8f0..c9493fd8a60 100644 --- a/ci/cron/daily-compat.yml +++ b/ci/cron/daily-compat.yml @@ -23,6 +23,7 @@ schedules: always: true jobs: + - template: ../build-local-canton.yml - job: compatibility_ts_libs timeoutInMinutes: 60 pool: @@ -34,7 +35,9 @@ jobs: - template: ../compatibility_ts_libs.yml - job: compatibility - dependsOn: compatibility_ts_libs + dependsOn: + - compatibility_ts_libs + - build_canton timeoutInMinutes: 720 strategy: matrix: @@ -47,19 +50,23 @@ jobs: demands: assignment -equals default steps: - checkout: self + - template: ../get-local-canton.yml - ${{ if eq(variables['pool'], 'macos-pool') }}: - template: ../clear-shared-segments-macos.yml - template: ../clean-up.yml - template: ../compatibility.yml - job: compatibility_windows - dependsOn: compatibility_ts_libs + dependsOn: + - compatibility_ts_libs + - build_canton timeoutInMinutes: 720 pool: name: windows-pool demands: assignment -equals default steps: - checkout: self + - template: ../get-local-canton.yml - template: ../compatibility-windows.yml - task: PublishBuildArtifacts@1 condition: succeededOrFailed()