Add MacOS to travis CI (#491)

* cleanup bazel install script, bump to 0.16.0, add osx to build/test

* add osx as a different entry in the build matrix

* reorganize build matrix
This commit is contained in:
Preston Van Loon 2018-09-09 22:50:04 -04:00 committed by GitHub
parent db1138ae1f
commit ab3c0efdba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -17,32 +17,17 @@ matrix:
- ./scripts/coverage.sh
- bash <(curl -s https://codecov.io/bash)
- os: linux
env: V=0.15.0
env: V=0.16.0
before_install:
# Install Bazel
- |
- |
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
URL="https://github.com/bazelbuild/bazel/releases/download/${V}/bazel-${V}-installer-${OS}-x86_64.sh"
wget -O install.sh "${URL}"
chmod +x install.sh
./install.sh --user
@ -79,19 +64,48 @@ matrix:
# Shutdown must be last.
- bazel shutdown
- os: osx
env: V=0.16.0
before_install:
# Install Bazel
- |
if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
OS=darwin
else
sysctl kernel.unprivileged_userns_clone=1
OS=linux
fi
URL="https://github.com/bazelbuild/bazel/releases/download/${V}/bazel-${V}-installer-${OS}-x86_64.sh"
wget -O install.sh "${URL}"
chmod +x install.sh
./install.sh --user
rm -f install.sh
# Decrypt service account (only works on prysmaticlabs branches)
# TODO(#282): enable remote caching / execution
#- 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
notifications:
email: false
install: true # Skip install go packages.
after_success:
- wget https://raw.githubusercontent.com/k3rn31p4nic/travis-ci-discord-webhook/master/send.sh
- chmod +x send.sh
- ./send.sh success $WEBHOOK_URL
after_failure:
- wget https://raw.githubusercontent.com/k3rn31p4nic/travis-ci-discord-webhook/master/send.sh
- chmod +x send.sh
- ./send.sh failure $WEBHOOK_URL
script:
# Ensure everything builds.
- |
bazel \
--bazelrc=.travis-bazelrc \
build \
//...
# Run all tests.
- |
bazel \
--bazelrc=.travis-bazelrc \
test \
//... $REMOTE_FLAGS
# Shutdown must be last.
- bazel shutdown
- language: node_js
os: linux
env:
@ -104,3 +118,15 @@ matrix:
script:
# Check solidity linter.
- solium -d contracts/
notifications:
email: false
after_success:
- wget https://raw.githubusercontent.com/k3rn31p4nic/travis-ci-discord-webhook/master/send.sh
- chmod +x send.sh
- ./send.sh success $WEBHOOK_URL
after_failure:
- wget https://raw.githubusercontent.com/k3rn31p4nic/travis-ci-discord-webhook/master/send.sh
- chmod +x send.sh
- ./send.sh failure $WEBHOOK_URL