2018-10-19 15:25:29 -04:00
|
|
|
# Copyright 2018 the Deno authors. All rights reserved. MIT license.
|
2018-05-29 01:35:06 -04:00
|
|
|
language: c++
|
2018-09-22 02:50:28 -04:00
|
|
|
matrix:
|
|
|
|
include:
|
|
|
|
- os: linux
|
2018-09-22 02:58:31 -04:00
|
|
|
env: BENCHMARK=1
|
2018-09-24 18:12:52 -04:00
|
|
|
sudo: required
|
2018-09-22 02:50:28 -04:00
|
|
|
- os: osx
|
2018-05-23 14:29:14 -04:00
|
|
|
env:
|
|
|
|
global:
|
2018-09-26 01:50:08 -04:00
|
|
|
- CARGO_HOME=$HOME/.cargo/
|
|
|
|
- RUSTUP_HOME=$HOME/.rustup/
|
2018-10-03 03:06:41 -04:00
|
|
|
- RUST_BACKTRACE=1
|
2018-11-01 01:06:55 -04:00
|
|
|
- CARGO_TARGET_DIR=$HOME/target
|
2018-09-26 01:50:08 -04:00
|
|
|
- PATH=$TRAVIS_BUILD_DIR/third_party/llvm-build/Release+Asserts/bin:$CARGO_HOME/bin:$PATH
|
2018-12-18 03:00:19 -05:00
|
|
|
- RUSTC_WRAPPER=sccache
|
|
|
|
- SCCACHE_BUCKET=deno-sccache
|
|
|
|
- AWS_ACCESS_KEY_ID=AKIAIPOYFUDOPCMWRVZA
|
|
|
|
# AWS_SECRET_ACCESS_KEY=...
|
|
|
|
- secure: "hlQoMNDWgsdFPDAIwE4VCr21w6ftD8BGLNE8w23+9wCqMs8TXCGzdzpTYzSePmToUfF1WjGQTF3advifzg7pdrUp41ThWzRkEjiRoXEORkKFuZENgLdi4ZZsvOYIfX5dfTcw7wkLEuGkywy1D9s/4uJydiVqYYM3fWI7U2ax8+wpenRH59moUeHqGGzPk8Hy4wcD7SoP+fvuOYJ+KjU2urbddwrVus9jnmXbx0Srq/L/ayBr0aLpZXcYZ3nSMnXpc9mo3YuVZQR42+ARHI5R7V1wrCa/025/O4kpSry/bipyN7Oyry/WY+9Hu3EDdlIUosJsWVHhv5s8ZuZWJG/0VITUP+MnDexGNkbbbDzzwk/7dDhTo1DRpT7fmSFVzr6J9bw4JEU9k//znLuCOnRLoWagysQUVUZQXDh7TTfMmGP0wdsUggfr8azrkZF3hjg+g+aOlz0ZpVtYQ8hdhvLQRp4pmxyQlsKygf0fFXWJvAp40KXIkrKXJ6hXIGdfWirZ3dgc8rCgVdOKi6Hy39EKOiIdP3j2J2tv3NTPkUi7z+BaDc5cPCaarR8ZvLLkv1lvYTFap/fk+TXpM3AS0hs1o91fyJ0l/P0KKTp7V8MoNC7iXhzCK/InNgpcs0rK7w7QOlEHihRlY3Ya4m3KvSRbL/P55TneX5xwr6yP719ARs4="
|
2018-08-17 11:54:36 -04:00
|
|
|
cache:
|
|
|
|
directories:
|
2018-09-26 01:50:08 -04:00
|
|
|
- "$CARGO_HOME"
|
|
|
|
- "$RUSTUP_HOME"
|
2018-08-21 08:42:23 -04:00
|
|
|
- third_party/v8/build/linux/debian_sid_amd64-sysroot/
|
|
|
|
- third_party/v8/third_party/llvm-build/
|
2018-09-22 02:50:28 -04:00
|
|
|
install:
|
2018-10-11 19:32:57 -04:00
|
|
|
- nvm install v8
|
|
|
|
- nvm use --delete-prefix v8
|
|
|
|
- node -v
|
2018-09-22 02:50:28 -04:00
|
|
|
- |-
|
2018-08-01 19:58:11 -04:00
|
|
|
# Install Rust.
|
2018-09-22 02:50:28 -04:00
|
|
|
# TODO(ry) Include rustc in third_party.
|
|
|
|
# https://github.com/denoland/deno/issues/386
|
2018-11-30 16:37:39 -05:00
|
|
|
if [ ! $(rustc --version | grep 1.30.0) ]; then
|
2018-10-26 13:09:38 -04:00
|
|
|
curl -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain 1.30.0
|
2018-11-30 16:37:39 -05:00
|
|
|
rustup default 1.30.0
|
2018-08-01 19:58:11 -04:00
|
|
|
fi
|
2018-09-22 02:50:28 -04:00
|
|
|
rustc --version
|
|
|
|
cargo --version
|
2018-09-22 02:58:31 -04:00
|
|
|
- |-
|
2018-09-25 21:57:19 -04:00
|
|
|
# Install and start sccache.
|
2018-12-18 03:00:19 -05:00
|
|
|
mkdir -p $HOME/bin
|
|
|
|
export PATH="$HOME/bin:$PATH"
|
2018-09-25 21:57:19 -04:00
|
|
|
if [ ! $(which sccache) ]; then
|
2018-12-18 03:00:19 -05:00
|
|
|
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
|
|
|
|
curl -fo $HOME/bin/sccache https://s3-us-west-1.amazonaws.com/rust-lang-ci2/rust-ci-mirror/2018-04-02-sccache-x86_64-apple-darwin
|
|
|
|
else
|
|
|
|
curl -fo $HOME/bin/sccache https://s3-us-west-1.amazonaws.com/rust-lang-ci2/rust-ci-mirror/2018-04-02-sccache-x86_64-unknown-linux-musl
|
|
|
|
fi
|
|
|
|
chmod +x $HOME/bin/sccache
|
2018-09-25 21:57:19 -04:00
|
|
|
fi
|
|
|
|
sccache --version
|
|
|
|
sccache --start-server
|
|
|
|
- |-
|
|
|
|
# Install hyperfine (if benchmarking is enabled for this build).
|
2018-09-22 02:58:31 -04:00
|
|
|
if [ $BENCHMARK ]; then
|
|
|
|
if [ ! $(which hyperfine) ]; then
|
|
|
|
cargo install hyperfine
|
|
|
|
fi
|
|
|
|
hyperfine --version
|
|
|
|
fi
|
2018-09-26 01:12:25 -04:00
|
|
|
- |-
|
|
|
|
# Remove unnnecessary cargo and rustup directories.
|
|
|
|
# This keeps the Travis CI cache small and fast.
|
|
|
|
rm -rf "$CARGO_HOME"registry
|
|
|
|
rm -rf "$RUSTUP_HOME"downloads
|
|
|
|
rm -rf "$RUSTUP_HOME"tmp
|
|
|
|
rm -rf "$RUSTUP_HOME"toolchains/*/etc
|
|
|
|
rm -rf "$RUSTUP_HOME"toolchains/*/share
|
2018-08-17 11:54:36 -04:00
|
|
|
before_script:
|
2018-09-22 02:50:28 -04:00
|
|
|
- ./tools/setup.py
|
2018-05-14 03:06:09 -04:00
|
|
|
script:
|
2018-11-08 12:19:37 -05:00
|
|
|
- |-
|
2018-12-03 13:30:47 -05:00
|
|
|
# Check lint and format.
|
|
|
|
set -e # Fail immediately if any of the following fail.
|
2018-11-08 12:19:37 -05:00
|
|
|
./tools/lint.py
|
|
|
|
./tools/test_format.py
|
2018-12-03 13:30:47 -05:00
|
|
|
|
|
|
|
- |-
|
2018-12-03 19:57:34 -05:00
|
|
|
# LSAN build. We are in the process of getting a completely clean LSAN build,
|
|
|
|
# but it will take some work. So for now we just run a subset of the tests.
|
2018-12-03 13:30:47 -05:00
|
|
|
echo is_asan=true >> target/debug/args.gn
|
|
|
|
echo is_lsan=true >> target/debug/args.gn
|
2018-12-03 19:57:34 -05:00
|
|
|
# We want to detect leaks during the build process as well as when executing
|
|
|
|
# the tests. So set the ASAN_OPTIONS env var before build.py is run.
|
|
|
|
export ASAN_OPTIONS=detect_leaks=1
|
|
|
|
./tools/build.py -C target/debug -j2
|
|
|
|
./target/debug/test_cc
|
2018-12-03 13:30:47 -05:00
|
|
|
|
|
|
|
- |-
|
|
|
|
# Release build and test
|
2018-12-03 19:57:34 -05:00
|
|
|
./tools/build.py -C target/release -j2
|
2018-12-03 13:30:47 -05:00
|
|
|
DENO_BUILD_MODE=release ./tools/test.py
|
|
|
|
|
|
|
|
- |-
|
|
|
|
# Cargo check
|
2018-12-18 03:00:19 -05:00
|
|
|
cargo check -j2 --release
|
2018-12-03 13:30:47 -05:00
|
|
|
|
2018-09-22 02:50:28 -04:00
|
|
|
after_success:
|
|
|
|
- |
|
|
|
|
# Run benchmarks and publish the result to github pages.
|
|
|
|
if [ $BENCHMARK ]; then
|
2018-12-03 13:30:47 -05:00
|
|
|
./tools/benchmark.py target/release &&
|
2018-09-22 02:50:28 -04:00
|
|
|
cp -r website/* gh-pages/
|
|
|
|
fi
|
|
|
|
before_deploy:
|
2018-12-03 13:30:47 -05:00
|
|
|
- gzip -c target/release/deno > target/release/deno_${TRAVIS_OS_NAME}_x64.gz
|
2018-08-21 08:42:23 -04:00
|
|
|
deploy:
|
2018-09-22 02:50:28 -04:00
|
|
|
- provider: releases
|
2018-09-22 02:58:31 -04:00
|
|
|
api_key: &github-token
|
2018-08-21 08:42:23 -04:00
|
|
|
secure: RIwv515oDcPAlEvt7uG8FeSFi6Tz6ODJUOXcFj6FYUPszxJ7Cg1kBLKln+fNW5OeOc52VsaZb/vPZ85skyEM6zk2ijL9FcSnnfNEm548w77iH6G0sk09NgBTy6KRXES6NZHD9jN1YTWYkT2G1NQi7mLqxR8a8pnWTbeK5HhtSWGsZPtXqf5iQbvnWsmKA0/w+FIgKupU0xe/qsYjh0eMLYpZDUWoKO0VxBKJ/ix5Uz91aJTjMIcHHij+ALg4pk+FkDotdyx39XB9b25KDxGuaI7NxWjSPzDxs/ZBHP6QYDLO0ti93ftvLAxRoBKPFoZrXqAu3KG9anr9WvxE40DO9OdV0VX2ZUatMUQm3DpSheN8ml2sErFqjIInqlpkdOVDYORz7FikPxkb9DKt+iuyFfxPRa4YWJv2tg8+Hy/nRCQw69OoKqrSNJ8KJDB3OjYbRBtdHz79RLJhTsGZla6RiyXfM7crR7CbFjbwdbW3Pt60t24fhvXQ0SwR0QTgzS/ieYEQHq/9GtSQA/Tn4kdIkyN6BdOMrQd/aUtgKmNdqbSlfmWGNyNZIxHdB+3RrTNT1tagkRI4UHEUfEujpIdYKwLjv0Xmi/VtTM+zOSkzHsIWGPfHBmIGnXfAItUHqivQYJ15E+dzg3T1CEbBxkDQtvwien9Fa8/pBsMkyovl8ps=
|
2018-12-03 13:30:47 -05:00
|
|
|
file: "target/release/deno_${TRAVIS_OS_NAME}_x64.gz"
|
2018-08-21 08:42:23 -04:00
|
|
|
on:
|
|
|
|
tags: true
|
|
|
|
repo: denoland/deno
|
2018-09-22 02:50:28 -04:00
|
|
|
skip-cleanup: true
|
2018-09-22 02:58:31 -04:00
|
|
|
- provider: pages
|
|
|
|
github-token: *github-token
|
|
|
|
keep-history: true
|
|
|
|
local-dir: gh-pages
|
|
|
|
on:
|
|
|
|
branch: master
|
2018-09-22 06:10:14 -04:00
|
|
|
condition: $BENCHMARK == 1
|
2018-09-22 02:58:31 -04:00
|
|
|
repo: denoland/deno
|
|
|
|
skip-cleanup: true
|