2019-04-04 11:33:38 +03:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
# Copyright (c) 2019 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
|
|
|
|
2019-07-05 14:18:12 +03:00
|
|
|
set -euo pipefail
|
2019-04-04 11:33:38 +03:00
|
|
|
|
2019-04-10 15:22:35 +03:00
|
|
|
eval "$($(dirname "$0")/dev-env/bin/dade-assist)"
|
|
|
|
|
2019-04-04 11:33:38 +03:00
|
|
|
execution_log_postfix=${1:-}
|
|
|
|
|
|
|
|
export LC_ALL=en_US.UTF-8
|
|
|
|
|
2019-04-16 18:43:29 +03:00
|
|
|
ARTIFACT_DIRS="${BUILD_ARTIFACTSTAGINGDIRECTORY:-$PWD}"
|
2019-04-04 11:33:38 +03:00
|
|
|
|
|
|
|
# Bazel test only builds targets that are dependencies of a test suite
|
|
|
|
# so do a full build first.
|
|
|
|
(
|
|
|
|
cd compiler
|
|
|
|
# Bazel also limits cache downloads by -j so increasing this to a ridiculous value
|
|
|
|
# helps. Bazel separately controls the number of jobs using CPUs so this should not
|
|
|
|
# overload machines.
|
2019-04-17 10:46:43 +03:00
|
|
|
# This also appears to be what Google uses internally, see
|
|
|
|
# https://github.com/bazelbuild/bazel/issues/6394#issuecomment-436234594.
|
2019-04-16 18:43:29 +03:00
|
|
|
bazel build -j 200 //... --experimental_execution_log_file "$ARTIFACT_DIRS/build_execution${execution_log_postfix}.log"
|
2019-04-04 11:33:38 +03:00
|
|
|
)
|
2019-05-23 11:21:20 +03:00
|
|
|
tag_filter=""
|
|
|
|
if [[ "$execution_log_postfix" == "_Darwin" ]]; then
|
|
|
|
tag_filter="-dont-run-on-darwin"
|
|
|
|
fi
|
|
|
|
bazel test -j 200 //... --test_tag_filters "$tag_filter" --experimental_execution_log_file "$ARTIFACT_DIRS/test_execution${execution_log_postfix}.log"
|
2019-04-04 11:33:38 +03:00
|
|
|
# Make sure that Bazel query works.
|
|
|
|
bazel query 'deps(//...)' > /dev/null
|
|
|
|
# Check that we can load damlc in ghci
|
2019-06-26 15:53:13 +03:00
|
|
|
da-ghci --data yes //:repl -e '()'
|
2019-07-01 18:30:13 +03:00
|
|
|
# Check that our IDE works on our codebase
|
2019-07-08 12:40:48 +03:00
|
|
|
./compiler/hie-core/hie-core-daml.sh compiler/damlc/exe/Main.hs 2>&1 | tee ide-log
|
2019-07-01 18:30:13 +03:00
|
|
|
grep -q "Files that failed: 0" ide-log
|