Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Travis support #37

Merged
merged 2 commits into from
Nov 11, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,16 @@ install:
- unzip dart.zip
- export PATH="$PATH:`pwd`/dart-sdk/bin"
- pub get
- SASS_SPEC_REF=`tool/sass-spec-ref.sh`
- git init sass-spec
- git -C sass-spec fetch git://github.com/sass/sass-spec "$SASS_SPEC_REF" --depth 1
- git -C sass-spec checkout FETCH_HEAD
- (cd sass-spec; bundle install --jobs=3 --retry=3)

script: ./tool/travis.sh
script:
- if [ "$ANALYZE" != false ]; then
dartanalyzer --fatal-warnings lib/;
fi

- ./tool/assert-formatted.sh
- (cd sass-spec; bundle exec sass-spec.rb --dart ..)
31 changes: 31 additions & 0 deletions tool/sass-spec-ref.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash -e
# Copyright 2016 Google Inc. Use of this source code is governed by an MIT-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/MIT.

# Echoes the sass-spec Git ref that should be checked out for the current Travis
# run. If we're running specs for a pull request which refers to a sass-spec
# pull request, we'll run against the latter rather than sass-spec master.

default=dart-sass

if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
>&2 echo "Ref: $default."
echo "$default"
exit 0
fi

>&2 echo "Fetching pull request $TRAVIS_PULL_REQUEST..."

JSON=$(curl -L -sS https://api.github.com/repos/sass/dart-sass/pulls/$TRAVIS_PULL_REQUEST)

RE_SPEC_PR="sass\/sass-spec(#|\/pull\/)([0-9]+)"

if [[ $JSON =~ $RE_SPEC_PR ]]; then
ref="pull/${BASH_REMATCH[2]}/head"
>&2 echo "Ref: $ref."
echo "$ref"
else
>&2 echo "Ref: $default."
echo "$default"
fi
42 changes: 0 additions & 42 deletions tool/travis.sh

This file was deleted.