File tree 2 files changed +51
-8
lines changed
2 files changed +51
-8
lines changed Original file line number Diff line number Diff line change 1
1
language : dart
2
- sudo : false
3
2
dart :
4
3
- dev
4
+ cache :
5
+ directories :
6
+ - $HOME/.npm
7
+ - $HOME/.nvm
8
+ - $HOME/.pub-cache/hosted
9
+ - $HOME/.chrome/canary
10
+ - node_modules
5
11
before_install :
6
12
- pub global activate dart_coveralls
7
- - export CHROME_URL=https://storage.googleapis.com/chromium-browser-snapshots/Linux_x64
8
- - export CHROME_REV=$(curl -s ${CHROME_URL}/LAST_CHANGE)
9
- - curl ${CHROME_URL}/${CHROME_REV}/chrome-linux.zip --create-dirs -o out/chrome-linux.zip
10
- - unzip out/chrome-linux.zip -d out
11
- - export CHROME_CANARY_BIN=$PWD/out/chrome-linux/chrome
13
+ - export CHROME_CANARY_BIN=`./tool/get_chrome_canary.sh`
12
14
- export DISPLAY=:99.0
13
15
- sh -e /etc/init.d/xvfb start
14
16
before_script :
15
17
- npm install
16
18
script :
17
- - ./tool/presubmit.sh
18
- - ./tool/coverage.sh
19
+ - ./tool/presubmit.sh && ./tool/coverage.sh
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ #
3
+ # Ensures the latest Chrome Canary is available, downloading it
4
+ # if necessary.
5
+ #
6
+ # Directory ~/.chrome/canary can safely be cached as the existing
7
+ # version will be checked before reusing a previously downloaded
8
+ # canary.
9
+ #
10
+
11
+ set -eu
12
+
13
+ readonly CHROME_URL=https://storage.googleapis.com/chromium-browser-snapshots/Linux_x64
14
+ readonly CHROME_REV=$( curl -s ${CHROME_URL} /LAST_CHANGE)
15
+
16
+ readonly CHROME_CANARY_DIR=$HOME /.chrome/canary
17
+ readonly CHROME_CANARY_BIN=$CHROME_CANARY_DIR /chrome-linux/chrome
18
+ readonly CHROME_CANARY_REV_FILE=$CHROME_CANARY_DIR /VERSION
19
+
20
+ function getCanary() {
21
+ local existing_version=" "
22
+ if [[ -f $CHROME_CANARY_REV_FILE && -x $CHROME_CANARY_BIN ]]; then
23
+ existing_version=` cat $CHROME_CANARY_REV_FILE `
24
+ echo " Found cached Chrome Canary version: $existing_version "
25
+ fi
26
+
27
+ if [[ " $existing_version " != " $CHROME_REV " ]]; then
28
+ echo " Downloading Chrome Canary version: $CHROME_REV "
29
+ rm -fR $CHROME_CANARY_DIR
30
+ mkdir -p $CHROME_CANARY_DIR
31
+
32
+ local file=chrome-linux.zip
33
+ curl ${CHROME_URL} /${CHROME_REV} /$file -o $file
34
+ unzip $file -d $CHROME_CANARY_DIR
35
+ rm $file
36
+ echo $CHROME_REV > $CHROME_CANARY_REV_FILE
37
+ fi
38
+ }
39
+
40
+ getCanary >&2
41
+
42
+ echo $CHROME_CANARY_BIN
You can’t perform that action at this time.
0 commit comments