Skip to content
This repository was archived by the owner on Dec 6, 2017. It is now read-only.

Commit

Permalink
chore(travis): initial travis setup
Browse files Browse the repository at this point in the history
  • Loading branch information
mvuksano authored and mhevery committed Feb 5, 2014
1 parent 91c35c0 commit bee06b5
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
language: node_js
node_js:
- 0.10

env:
matrix:
- JOB=unit-stable
- JOB=unit-dev

before_script:
- ./scripts/travis/setup.sh

script:
- ./scripts/travis/build.sh

after_success:
- ./scripts/travis/benchmark.sh
23 changes: 23 additions & 0 deletions scripts/env.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/sh
set -e

if [ -n "$DART_SDK" ]; then
DARTSDK=$DART_SDK
else
echo "sdk=== $DARTSDK"
DART=`which dart|cat` # pipe to cat to ignore the exit code
DARTSDK=`which dart | sed -e 's/\/bin\/dart$/\//'`
if [ -z "$DARTSDK" ]; then
DARTSDK="`pwd`/dart-sdk"
fi
fi

export DART_SDK="$DARTSDK"
export DART=${DART:-"$DARTSDK/bin/dart"}
export PUB=${PUB:-"$DARTSDK/bin/pub"}
export DARTANALYZER=${DARTANALYZER:-"$DARTSDK/bin/dartanalyzer"}
export DARTDOC=${DARTDOC:-"$DARTSDK/bin/dartdoc"}


export DART_FLAGS='--enable_type_checks --enable_asserts'
export PATH=$PATH:$DARTSDK/bin
5 changes: 5 additions & 0 deletions scripts/travis/benchmark.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
set -e
. ./scripts/env.sh

./run-benchmarks.sh
5 changes: 5 additions & 0 deletions scripts/travis/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
set -e
. ./scripts/env.sh

./run-tests.sh
27 changes: 27 additions & 0 deletions scripts/travis/setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash

set -e

case $( uname -s ) in
Linux)
DART_SDK_ZIP=dartsdk-linux-x64-release.zip
;;
Darwin)
DART_SDK_ZIP=dartsdk-macos-x64-release.zip
;;
esac

CHANNEL=`echo $JOB | cut -f 2 -d -`
echo Fetch Dart channel: $CHANNEL

echo http://storage.googleapis.com/dart-archive/channels/$CHANNEL/release/latest/sdk/$DART_SDK_ZIP
curl http://storage.googleapis.com/dart-archive/channels/$CHANNEL/release/latest/sdk/$DART_SDK_ZIP > $DART_SDK_ZIP
echo Fetched new dart version $(unzip -p $DART_SDK_ZIP dart-sdk/version)
rm -rf dart-sdk
unzip $DART_SDK_ZIP > /dev/null
rm $DART_SDK_ZIP

echo =============================================================================
. ./scripts/env.sh
$DART --version
$PUB install

0 comments on commit bee06b5

Please sign in to comment.