2019-04-04 11:33:38 +03:00
|
|
|
#!/usr/bin/env bash
|
2020-01-02 23:21:13 +03:00
|
|
|
# Copyright (c) 2020 The DAML Authors. All rights reserved.
|
2019-04-04 11:33:38 +03:00
|
|
|
# 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
|
|
|
|
2020-02-14 17:08:24 +03:00
|
|
|
tag_filter=""
|
|
|
|
if [[ "$execution_log_postfix" == "_Darwin" ]]; then
|
2020-02-26 17:52:08 +03:00
|
|
|
tag_filter="-dont-run-on-darwin,-scaladoc,-pdfdocs"
|
2020-02-14 17:08:24 +03:00
|
|
|
fi
|
|
|
|
|
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
|
2020-03-02 20:53:18 +03:00
|
|
|
bazel build //... --build_tag_filters "$tag_filter"
|
2019-04-04 11:33:38 +03:00
|
|
|
)
|
2020-03-02 20:53:18 +03:00
|
|
|
bazel test //... --build_tag_filters "$tag_filter" --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-11-26 20:47:39 +03:00
|
|
|
GHCI_SCRIPT=$(mktemp)
|
|
|
|
function cleanup {
|
|
|
|
rm -rf "$GHCI_SCRIPT"
|
|
|
|
}
|
|
|
|
trap cleanup EXIT
|
2020-01-09 16:49:38 +03:00
|
|
|
# Disabled on darwin since it sometimes seem to hang and this only
|
|
|
|
# tests our dev setup rather than our code so issues are not critical.
|
|
|
|
if [[ "$(uname)" != "Darwin" ]]; then
|
|
|
|
da-ghci --data yes //compiler/damlc:damlc -e ':main --help'
|
|
|
|
fi
|
2019-07-01 18:30:13 +03:00
|
|
|
# Check that our IDE works on our codebase
|
2019-09-11 09:57:48 +03:00
|
|
|
./compiler/ghcide-daml.sh compiler/damlc/exe/Main.hs 2>&1 | tee ide-log
|
2019-10-02 16:08:07 +03:00
|
|
|
grep -q "1 file worked, 0 files failed" ide-log
|