diff --git a/.circleci/config.yml b/.circleci/config.yml index 8b6f4db0..617c3bb7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -10,7 +10,7 @@ jobs: # Set up dendrite - run: name: Build Dendrite - command: ./build.sh + command: ./build.sh -r - run: name: Copy dummy keys to root command: | diff --git a/build.sh b/build.sh index 9a8050f3..95157007 100755 --- a/build.sh +++ b/build.sh @@ -1,3 +1,25 @@ #!/bin/sh -GOBIN=$PWD/`dirname $0`/bin go install -v ./cmd/... +ARGS="-v ./cmd/..." + +usage() { + echo "Usage: $0 [-r]" 1>&2 + echo + echo "-r" + echo " Build with race condition detection" + exit 1 +} + +while getopts ":r" o; do + case "${o}" in + r) + # Turn on race condition detection + ARGS="-race $ARGS" + ;; + *) + usage + ;; + esac +done + +GOBIN=$PWD/`dirname $0`/bin go install $ARGS