-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #318 from dart-lang/travis-runner2
Speed Travis CI up with some caching & faster fails
- Loading branch information
Showing
2 changed files
with
51 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,19 @@ | ||
language: dart | ||
sudo: false | ||
dart: | ||
- dev | ||
cache: | ||
directories: | ||
- $HOME/.npm | ||
- $HOME/.nvm | ||
- $HOME/.pub-cache/hosted | ||
- $HOME/.chrome/canary | ||
- node_modules | ||
before_install: | ||
- pub global activate dart_coveralls | ||
- export CHROME_URL=https://storage.googleapis.com/chromium-browser-snapshots/Linux_x64 | ||
- export CHROME_REV=$(curl -s ${CHROME_URL}/LAST_CHANGE) | ||
- curl ${CHROME_URL}/${CHROME_REV}/chrome-linux.zip --create-dirs -o out/chrome-linux.zip | ||
- unzip out/chrome-linux.zip -d out | ||
- export CHROME_CANARY_BIN=$PWD/out/chrome-linux/chrome | ||
- export CHROME_CANARY_BIN=`./tool/get_chrome_canary.sh` | ||
- export DISPLAY=:99.0 | ||
- sh -e /etc/init.d/xvfb start | ||
before_script: | ||
- npm install | ||
script: | ||
- ./tool/presubmit.sh | ||
- ./tool/coverage.sh | ||
- ./tool/presubmit.sh && ./tool/coverage.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/bin/bash | ||
# | ||
# Ensures the latest Chrome Canary is available, downloading it | ||
# if necessary. | ||
# | ||
# Directory ~/.chrome/canary can safely be cached as the existing | ||
# version will be checked before reusing a previously downloaded | ||
# canary. | ||
# | ||
|
||
set -eu | ||
|
||
readonly CHROME_URL=https://storage.googleapis.com/chromium-browser-snapshots/Linux_x64 | ||
readonly CHROME_REV=$(curl -s ${CHROME_URL}/LAST_CHANGE) | ||
|
||
readonly CHROME_CANARY_DIR=$HOME/.chrome/canary | ||
readonly CHROME_CANARY_BIN=$CHROME_CANARY_DIR/chrome-linux/chrome | ||
readonly CHROME_CANARY_REV_FILE=$CHROME_CANARY_DIR/VERSION | ||
|
||
function getCanary() { | ||
local existing_version="" | ||
if [[ -f $CHROME_CANARY_REV_FILE && -x $CHROME_CANARY_BIN ]]; then | ||
existing_version=`cat $CHROME_CANARY_REV_FILE` | ||
echo "Found cached Chrome Canary version: $existing_version" | ||
fi | ||
|
||
if [[ "$existing_version" != "$CHROME_REV" ]]; then | ||
echo "Downloading Chrome Canary version: $CHROME_REV" | ||
rm -fR $CHROME_CANARY_DIR | ||
mkdir -p $CHROME_CANARY_DIR | ||
|
||
local file=chrome-linux.zip | ||
curl ${CHROME_URL}/${CHROME_REV}/$file -o $file | ||
unzip $file -d $CHROME_CANARY_DIR | ||
rm $file | ||
echo $CHROME_REV > $CHROME_CANARY_REV_FILE | ||
fi | ||
} | ||
|
||
getCanary >&2 | ||
|
||
echo $CHROME_CANARY_BIN |