dart-sass/.travis.yml
Natalie Weizenbaum e3df2f18be Revert "debug"
This reverts commit 9c3911b5b5.
2018-02-03 19:42:33 -08:00

135 lines
5.5 KiB
YAML

## Testing
# Set the language to Ruby so that we can run sass-spec tests.
language: ruby
env:
# Language specs, defined in sass/sass-spec
- TASK=specs DART_CHANNEL=dev DART_VERSION=latest
- TASK=specs DART_CHANNEL=stable DART_VERSION=latest
- TASK=specs DART_CHANNEL=stable DART_VERSION=latest ASYNC=true
# Unit tests, defined in test/.
- TASK=tests DART_CHANNEL=dev DART_VERSION=latest
- TASK=tests DART_CHANNEL=stable DART_VERSION=latest
- TASK=tests DART_CHANNEL=dev DART_VERSION=latest NODE_VERSION=stable
- TASK=tests DART_CHANNEL=dev DART_VERSION=latest NODE_VERSION=v6.9.1
- TASK=tests DART_CHANNEL=dev DART_VERSION=latest NODE_VERSION=v4.6.2
# Miscellaneous checks.
- TASK=analyze DART_CHANNEL=dev DART_VERSION=latest
- TASK=format DART_CHANNEL=dev DART_VERSION=latest
rvm:
- 2.3.1
# Only building master means that we don't run two builds for each pull request.
branches:
only: [master, "/^feature\\..*/", "/^\\d+\\.\\d+\\.\\d+([+-].*)?$/"]
cache:
directories:
- $HOME/.pub-cache
install:
- bold=$(tput bold)
- none=$(tput sgr0)
# Install the Dart SDK.
- curl -o dart.zip "https://storage.googleapis.com/dart-archive/channels/$DART_CHANNEL/release/$DART_VERSION/sdk/dartsdk-linux-x64-release.zip"
- unzip dart.zip
- export PATH="$PATH:`pwd`/dart-sdk/bin"
- pub get
# Install the Node SDK if we're running Node tests.
- if-node() { if [ ! -z "$NODE_VERSION" ]; then "$@"; fi }
- if-node . "$HOME/.nvm/nvm.sh"
- if-node nvm install "$NODE_VERSION"
- if-node nvm use "$NODE_VERSION"
- SASS_MINIFY_JS=false if-node pub run grinder before_test
# Download sass-spec and install its dependencies if we're running specs.
- if-specs() { if [ "$TASK" = specs ]; then "$@"; fi }
- if-specs export sass_spec_ref=`tool/sass-spec-ref.sh`
- if-specs git init sass-spec
- if-specs git -C sass-spec fetch git://github.com/sass/sass-spec "$sass_spec_ref" --depth 1
- if-specs git -C sass-spec checkout FETCH_HEAD
- if-specs bundle install --gemfile=sass-spec/Gemfile --jobs=3 --retry=3
script:
- if [ "$TASK" = analyze ]; then
echo "${bold}Analzing Dart code.$none";
dartanalyzer --fatal-warnings lib/ test/ tool/;
elif [ "$TASK" = format ]; then
echo "${bold}Ensuring Dart code is formatted.$none";
./tool/assert-formatted.sh;
elif [ "$TASK" = tests ]; then
if [ -z "$NODE_VERSION" ]; then
echo "${bold}Running Dart tests against $(dart --version &> /dev/stdout).$none";
if [ "$DART_CHANNEL" = dev ]; then
pub run test -p vm -x node;
else
pub run test -p vm -x dart2 -x node;
fi
else
echo "${bold}Running Node tests against Node $(node --version).$none";
if [ "$DART_CHANNEL" = dev ]; then
pub run test -j 2 -t node;
else
pub run test -j 2 -x dart2 -t node;
fi
fi;
else
echo "${bold}Running sass-spec against $(dart --version &> /dev/stdout).$none";
if [ "$ASYNC" = true ]; then
extra_args=--dart-args --async;
fi;
(cd sass-spec; bundle exec sass-spec.rb --dart .. $extra_args);
fi
## Deployment
jobs:
include:
- stage: deploy
if: (type in (push, api)) AND (repo = sass/dart-sass) AND (tag =~ ^\d+\.\d+\.\d+([+-].*)?$)
env: DART_CHANNEL=dev DART_VERSION=latest
script: skip # Don't run tests
before_deploy:
- rm -rf build/
- pub run grinder package npm_package
deploy:
# Deploy standalone archives to GitHub releases.
- provider: releases
api_key:
secure: qD09TCT4wbFlmF0Kglo+Rl8S5YfqHaUpNYMKdHX8mXIznN0txjCTTLvCzqLV7hfXlybUBkSHecZ7lW27MK3gGq0cMotF+2/iC6r8Y0XenndBDZn4fkuK5k9ROwZ8fdxst8/iSXLcg575p16iMCuEDeexOaZXl6fioL0+RNfiTgkm1cH/eP/M6qzrjwf2X3tlJ/2FECgYzwSBJFlcHiIfyDNAgH5CO+ghUVO+D3ms6l5RPN25+uh0ihRmWj+rIeZc15IQyFQ0hFQDxc3WpQBTGReDmvk/6Lo3dn0IdANbT12hOvqp9/r9fOn1UjljPkIjXXarrs7QDOjD7oeisEQn2CY8M0LLu9wQIBvpQxu1G7V+y4D+1hsIzgVfck8+Wz96Qlg0Alq/LJQN+G0BxP4QnPjs/Yi+iMANTnrqrl+9rfAcfOkvGthFFvrYKYvLOtvObd1PnCOJNC8pG3PeI8Rm5v5PLb+5Sphz2tpPIOR/xpV4Qe4HRzuU9WQkwOiBXDOZxS82sdN5pIJQssGSBW9tPpBuI20khfrZHpVeoqN1zb8/uZnWFdsHxd7keWGfJD4OQsQAiEqnSnKoyyGPh/iUeQfRqnIt00gJCcwkUpSHWTihFqAAgwdOtIU9WyhDf7QMV0tsNERF6c1FRUhAO6Hw2Lzz6iTLdFR98Un24lszk6s=
file:
- "build/dart-sass-${TRAVIS_TAG}-linux-ia32.tar.gz"
- "build/dart-sass-${TRAVIS_TAG}-linux-x64.tar.gz"
- "build/dart-sass-${TRAVIS_TAG}-macos-ia32.tar.gz"
- "build/dart-sass-${TRAVIS_TAG}-macos-x64.tar.gz"
- "build/dart-sass-${TRAVIS_TAG}-windows-ia32.zip"
- "build/dart-sass-${TRAVIS_TAG}-windows-x64.zip"
skip_cleanup: true
# This causes the deploy to only be build when a tag is pushed. This
# is because the `tag` attribute in `if:` statements has a different
# understanding of the "current tag" than this, which uses the
# `TRAVIS_TAG` environment variable. `if:` statements check whether a
# tag exists that refers to the current commit, whereas `TRAVIS_TAG`
# checks whether the current build was caused by a tag.
#
# We check `if:` because it avoids unnecessary build steps, and
# `on: {tags: true}` ensures that we only deploy on the build caused
# by pushing a tag, not the build caused by pushing master.
on: &deploy_on
tags: true
# Deploy to npm, pub, and Homebrew.
# TODO: Deploy to Chocolatey as well.
- provider: script
skip_cleanup: true
script: tool/deploy.sh
on: *deploy_on