ci: enable M1 CI node (#14622)

CHANGELOG_BEGIN
CHANGELOG_END
This commit is contained in:
Gary Verhaegen 2022-08-16 07:54:58 +02:00 committed by GitHub
parent b8a17e5dac
commit 2da2557363
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 66 additions and 41 deletions

View File

@ -28,8 +28,14 @@ if [ -n "$SANDBOX_PID" ]; then
echo $SANDBOX_PID | xargs kill
fi
if [ "$1" = "_m1" ]; then
bazel="arch -arm64 bazel"
else
bazel=bazel
fi
# Bazel test only builds targets that are dependencies of a test suite so do a full build first.
bazel build //... \
$bazel build //... \
--build_tag_filters "$tag_filter" \
--profile build-profile.json \
--experimental_profile_include_target_label \
@ -68,7 +74,7 @@ stop_postgresql # in case it's running from a previous build
start_postgresql
# Run the tests.
bazel test //... \
$bazel test //... \
--build_tag_filters "$tag_filter" \
--test_tag_filters "$tag_filter" \
--test_env "POSTGRESQL_HOST=${POSTGRESQL_HOST}" \
@ -82,7 +88,7 @@ bazel test //... \
--experimental_execution_log_file "$ARTIFACT_DIRS/logs/test_execution${execution_log_postfix}.log"
# Make sure that Bazel query works.
bazel query 'deps(//...)' >/dev/null
$bazel query 'deps(//...)' >/dev/null
# Check that we can load damlc in ghci
# Disabled on darwin since it sometimes seem to hang and this only

View File

@ -104,43 +104,15 @@ jobs:
trigger_sha: '$(trigger_sha)'
- template: report-end.yml
- job: macOS
dependsOn:
- check_for_release
timeoutInMinutes: 360
pool:
name: macOS-pool
demands: assignment -equals default
variables:
- 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
steps:
- template: report-start.yml
- template: clear-shared-segments-macos.yml
- checkout: self
- bash: |
set -euo pipefail
git checkout $(release_sha)
name: checkout_release
condition: and(succeeded(), eq(variables.is_release, 'true'))
- template: clean-up.yml
- template: build-unix.yml
- template: macOS.yml
parameters:
release_tag: $(release_tag)
name: macos
is_release: variables.is_release
- template: upload-bazel-metrics.yml
- template: tell-slack-failed.yml
name: macOS
assignment: default
- template: macOS.yml
parameters:
trigger_sha: '$(trigger_sha)'
- template: report-end.yml
name: m1
assignment: m1-builds
- job: Windows
dependsOn:

View File

@ -5,7 +5,7 @@ variables:
- name: pipeline_timestamp
value: $[ format('{0:yyyy}-{0:MM}-{0:dd}T{0:HH}:{0:mm}:{0:ss}.{0:fffffff}', pipeline.startTime) ]
- name: pipeline_id
value: $(pipeline_timestamp)-$(System.JobDisplayName)-$(System.JobId)-$(System.JobAttempt)
value: $(pipeline_timestamp)-$(System.JobName)-$(System.JobId)-$(System.JobAttempt)
- name: git_branch_sha
value: $[ dependencies.git_sha.outputs['out.branch'] ]
- name: git_main_sha

47
ci/macOS.yml Normal file
View File

@ -0,0 +1,47 @@
# Copyright (c) 2022 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
parameters:
- name: name
- name: assignment
jobs:
- job: ${{parameters.name}}
dependsOn:
- check_for_release
timeoutInMinutes: 360
pool:
name: macOS-pool
demands: assignment -equals ${{parameters.assignment}}
condition: or(eq('${{parameters.name}}', 'macOS'),
eq(variables['Build.SourceBranchName'], 'main'))
variables:
- 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
steps:
- template: report-start.yml
- template: clear-shared-segments-macos.yml
- checkout: self
- bash: |
set -euo pipefail
git checkout $(release_sha)
name: checkout_release
condition: and(succeeded(), eq(variables.is_release, 'true'))
- template: clean-up.yml
- template: build-unix.yml
parameters:
release_tag: $(release_tag)
name: ${{parameters.name}}
is_release: variables.is_release
- template: upload-bazel-metrics.yml
- template: tell-slack-failed.yml
parameters:
trigger_sha: '$(trigger_sha)'
- template: report-end.yml