2015-07-28 22:16:16 +00:00
|
|
|
language: go
|
2018-07-07 17:23:19 +00:00
|
|
|
go_import_path: github.com/prysmaticlabs/geth-sharding
|
2015-07-28 22:16:16 +00:00
|
|
|
sudo: false
|
2018-01-13 22:31:28 +00:00
|
|
|
matrix:
|
|
|
|
include:
|
|
|
|
- os: linux
|
2018-05-02 06:17:17 +00:00
|
|
|
go: 1.10.x
|
2018-01-13 22:31:28 +00:00
|
|
|
env:
|
|
|
|
- lint
|
|
|
|
script:
|
2018-07-07 17:23:19 +00:00
|
|
|
-
|
|
|
|
go get github.com/alecthomas/gometalinter && gometalinter --install && gometalinter
|
|
|
|
- os: linux
|
|
|
|
env: V=0.15.0
|
|
|
|
before_install:
|
2018-07-07 20:01:58 +00:00
|
|
|
# Install Bazel
|
2018-07-07 17:23:19 +00:00
|
|
|
- |
|
|
|
|
if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
|
|
|
|
OS=darwin
|
|
|
|
else
|
|
|
|
sysctl kernel.unprivileged_userns_clone=1
|
|
|
|
OS=linux
|
|
|
|
fi
|
|
|
|
if [[ "${V}" == "HEAD" ]]; then
|
|
|
|
# Determine last successful build number. This may change while we are
|
|
|
|
# downloading, so it's important to determine ahead of time, in case
|
|
|
|
# we need to resume the download.
|
|
|
|
CI_BASE="http://ci.bazel.io/view/Bazel%20bootstrap%20and%20maintenance/job/Bazel/PLATFORM_NAME=${OS}-x86_64/"
|
|
|
|
CI_INDEX_URL="${CI_BASE}/lastSuccessfulBuild/"
|
|
|
|
wget -q -O build-index.html "${CI_INDEX_URL}"
|
|
|
|
CI_BUILD=$(grep '<title>' build-index.html | sed -e 's/^.*#\([0-9]*\).*$/\1/')
|
|
|
|
# Determine the artifact name. This is normally, bazel--installer.sh,
|
|
|
|
# but it may be, for example, bazel-0.5rc2-installer.sh before a release.
|
|
|
|
CI_ARTIFACT=$(grep -o 'bazel-[^\"-]*-installer.sh' build-index.html | head -n 1)
|
|
|
|
URL="${CI_BASE}/${CI_BUILD}/artifact/output/ci/${CI_ARTIFACT}"
|
|
|
|
rm build-index.html
|
|
|
|
else
|
|
|
|
URL="https://github.com/bazelbuild/bazel/releases/download/${V}/bazel-${V}-installer-${OS}-x86_64.sh"
|
|
|
|
fi
|
|
|
|
wget -O install.sh "${URL}"
|
|
|
|
chmod +x install.sh
|
|
|
|
./install.sh --user
|
|
|
|
rm -f install.sh
|
2018-07-08 19:22:41 +00:00
|
|
|
# Decrypt service account (only works on prysmaticlabs branches)
|
2018-07-08 21:23:24 +00:00
|
|
|
- if [[ $encrypted_64ca747eb448_iv ]]; then
|
|
|
|
openssl aes-256-cbc -K $encrypted_64ca747eb448_key -iv $encrypted_64ca747eb448_iv
|
|
|
|
-in service-account.json.enc -out /tmp/service-account.json -d;
|
|
|
|
REMOTE_FLAGS=--config=remote;
|
|
|
|
fi
|
2018-07-07 17:23:19 +00:00
|
|
|
|
|
|
|
install: true # Skip install go packages.
|
|
|
|
|
|
|
|
script:
|
|
|
|
# Run all tests.
|
|
|
|
- |
|
|
|
|
bazel \
|
|
|
|
--bazelrc=.travis-bazelrc \
|
|
|
|
test \
|
2018-07-08 21:23:24 +00:00
|
|
|
//... $REMOTE_FLAGS
|
2018-07-07 17:23:19 +00:00
|
|
|
|
|
|
|
# Check that BUILD files are formatted correctly.
|
|
|
|
- ./check_gazelle.sh
|
|
|
|
|
|
|
|
# Shutdown must be last.
|
|
|
|
- bazel shutdown
|
|
|
|
|
|
|
|
notifications:
|
|
|
|
email: false
|