summaryrefslogtreecommitdiff
path: root/.travis.yml
blob: 3d56623493e27a6d939b834ad80489dbc269f395 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
# Copyright 2018 the Deno authors. All rights reserved. MIT license.
language: c++
matrix:
  include:
  - os: linux
    env: BENCHMARK=1
    sudo: required
  - os: osx
env:
  global:
  - CARGO_HOME=$HOME/.cargo/
  - RUSTUP_HOME=$HOME/.rustup/
  - RUST_BACKTRACE=1
  - HOMEBREW_PATH=$HOME/homebrew/
  - CARGO_TARGET_DIR=$HOME/target
  - PATH=$TRAVIS_BUILD_DIR/third_party/llvm-build/Release+Asserts/bin:$CARGO_HOME/bin:$PATH
  - CCACHE_CPP2=yes
  - CCACHE_SLOPPINESS=time_macros
  - SCCACHE_DIR=$HOME/.sccache/
  - SCCACHE_CACHE_SIZE=1G
  - SCCACHE_IDLE_TIMEOUT=0
cache:
  ccache: true
  directories:
  - "$CARGO_HOME"
  - "$RUSTUP_HOME"
  - "$HOMEBREW_PATH"
  - "$SCCACHE_DIR"
  - third_party/v8/build/linux/debian_sid_amd64-sysroot/
  - third_party/v8/third_party/llvm-build/
install:
- nvm install v8
- nvm use --delete-prefix v8
- node -v
- |-
  # OS X: install a private copy of homebrew.
  if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
    export BREW="${HOMEBREW_PATH}bin/brew"
    export PATH="${HOMEBREW_PATH}bin:$PATH"
    if [[ ! -x "$BREW" ]]; then
      git clone git://github.com/homebrew/brew "$HOMEBREW_PATH"
    fi
    "$BREW" --version
  fi
- |-
  # Install ccache (if necessary) and set it up.
  if [[ "$TRAVIS_OS_NAME" == "osx" && ! $(which ccache) ]]; then
    "$BREW" install ccache
  fi
  ccache --version | head -n 1
  ccache --max-size=1G
- |-
  # Install Rust.
  # TODO(ry) Include rustc in third_party.
  # https://github.com/denoland/deno/issues/386
  if [ ! $(rustc --version | grep 1.30.0) ]; then
    curl -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain 1.30.0
    rustup default 1.30.0
  fi
  rustc --version
  cargo --version
- |-
  # Install and start sccache.
  if [ ! $(which sccache) ]; then
    cargo install sccache
  fi
  sccache --version
  sccache --start-server
- |-
  # Install hyperfine (if benchmarking is enabled for this build).
  if [ $BENCHMARK ]; then
    if [ ! $(which hyperfine) ]; then
      cargo install hyperfine
    fi
    hyperfine --version
  fi
- |-
  # 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
before_script:
- ./tools/setup.py
script:
- |-
  # Check lint and format.
  set -e # Fail immediately if any of the following fail.
  ./tools/lint.py
  ./tools/test_format.py

- |-
  # 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.
  echo is_asan=true >> target/debug/args.gn
  echo is_lsan=true >> target/debug/args.gn
  # 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

- |-
  # Release build and test
  bash -c "sleep 2100; pkill ninja; pkill cargo" &
  ./tools/build.py -C target/release -j2
  DENO_BUILD_MODE=release ./tools/test.py

- |-
  # Cargo check
  RUSTC_WRAPPER=sccache cargo check -j2 --release

after_script:
- ccache --show-stats
- sccache --stop-server
after_success:
- |
  # Run benchmarks and publish the result to github pages.
  if [ $BENCHMARK ]; then
    ./tools/benchmark.py target/release &&
    cp -r website/* gh-pages/
  fi
before_deploy:
- gzip -c target/release/deno > target/release/deno_${TRAVIS_OS_NAME}_x64.gz
deploy:
- provider: releases
  api_key: &github-token
    secure: RIwv515oDcPAlEvt7uG8FeSFi6Tz6ODJUOXcFj6FYUPszxJ7Cg1kBLKln+fNW5OeOc52VsaZb/vPZ85skyEM6zk2ijL9FcSnnfNEm548w77iH6G0sk09NgBTy6KRXES6NZHD9jN1YTWYkT2G1NQi7mLqxR8a8pnWTbeK5HhtSWGsZPtXqf5iQbvnWsmKA0/w+FIgKupU0xe/qsYjh0eMLYpZDUWoKO0VxBKJ/ix5Uz91aJTjMIcHHij+ALg4pk+FkDotdyx39XB9b25KDxGuaI7NxWjSPzDxs/ZBHP6QYDLO0ti93ftvLAxRoBKPFoZrXqAu3KG9anr9WvxE40DO9OdV0VX2ZUatMUQm3DpSheN8ml2sErFqjIInqlpkdOVDYORz7FikPxkb9DKt+iuyFfxPRa4YWJv2tg8+Hy/nRCQw69OoKqrSNJ8KJDB3OjYbRBtdHz79RLJhTsGZla6RiyXfM7crR7CbFjbwdbW3Pt60t24fhvXQ0SwR0QTgzS/ieYEQHq/9GtSQA/Tn4kdIkyN6BdOMrQd/aUtgKmNdqbSlfmWGNyNZIxHdB+3RrTNT1tagkRI4UHEUfEujpIdYKwLjv0Xmi/VtTM+zOSkzHsIWGPfHBmIGnXfAItUHqivQYJ15E+dzg3T1CEbBxkDQtvwien9Fa8/pBsMkyovl8ps=
  file: "target/release/deno_${TRAVIS_OS_NAME}_x64.gz"
  on:
    tags: true
    repo: denoland/deno
  skip-cleanup: true
- provider: pages
  github-token: *github-token
  keep-history: true
  local-dir: gh-pages
  on:
    branch: master
    condition: $BENCHMARK == 1
    repo: denoland/deno
  skip-cleanup: true