mirror of
https://github.com/danog/dart-sass.git
synced 2024-11-27 04:34:59 +01:00
7e0b0b76b8
It doesn't really make sense to bundle these with the archive, since they aren't natively consumed by tools.
163 lines
7.6 KiB
YAML
163 lines
7.6 KiB
YAML
## Testing
|
|
|
|
# Set the language to Ruby so that we can run sass-spec tests.
|
|
language: ruby
|
|
|
|
# Note: we're currently pinned to Dart 2.0.0-dev.36.0 because dart2js doesn't
|
|
# support configuration-specific imports with the new front-end.
|
|
env:
|
|
# Language specs, defined in sass/sass-spec
|
|
- TASK=specs DART_CHANNEL=dev DART_VERSION=2.0.0-dev.36.0
|
|
- 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=2.0.0-dev.36.0
|
|
- TASK=tests DART_CHANNEL=stable DART_VERSION=latest
|
|
- TASK=tests DART_CHANNEL=dev DART_VERSION=2.0.0-dev.36.0 NODE_VERSION=stable
|
|
- TASK=tests DART_CHANNEL=dev DART_VERSION=2.0.0-dev.36.0 NODE_VERSION=v6.9.1
|
|
- TASK=tests DART_CHANNEL=dev DART_VERSION=2.0.0-dev.36.0 NODE_VERSION=v4.6.2
|
|
|
|
# Miscellaneous checks.
|
|
- TASK=analyze DART_CHANNEL=dev DART_VERSION=2.0.0-dev.36.0
|
|
- TASK=format DART_CHANNEL=dev DART_VERSION=2.0.0-dev.36.0
|
|
|
|
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"
|
|
- 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: &deploy-if
|
|
(type IN (push, api)) AND (repo = sass/dart-sass) AND tag =~ ^\d+\.\d+\.\d+([+-].*)?$
|
|
env:
|
|
- DART_CHANNEL=dev DART_VERSION=2.0.0-dev.36.0 GITHUB_USER=sassbot
|
|
# GITHUB_AUTH="..."
|
|
- secure: "AAP74aT+8SQmwGeHrCsZ7GgppvCCkDAZXszivocMy3Fi9gfMCLABBCh67pGINJX4VlLW7ftPF3xivlvgGu+e4ncXz9m9jIPZ9Iza3cW5jCnCgyRGZD98gwabIDFWiv4X9V2xnJA2p1ZuYBf8Sh3TTipUFBKMjlnxVxYkIOTud4rUss/htFhxVA/oFTo0ThTZwXuxJ+GRGTM4PcuHPJvPf18iRPs2AHFV6ZP51xgc3AsXC6Zyom5EJeX0yGj9zWQ0XCjnuFdGsI6G9jmkrmqgAXuUipgqAn0tjxPYp9R/1HqnBLD3Zbrvyi5pCiSFclU6CS6kTDbefzPOc5+zrnlkaolVeF8tQ+EhZiZqtLnpLYUz9bgknoFUapUN4N0R36sKBStdRv54+sMeoOzpQ8ep3PeZW5nWbak12wcrDx38ToWs6hQ4ycb0SQDZZatHsASpSu2nX8HwzZSDAZmsAdB+epPmgA0CBjWVG1ycmVnT6l3OopUmbaY3pXBNzFUXq5Fcd7Q39/MfrmHpyxSc3QVf8xNtUx9ggYtK0Kwx6dgykhNMVzFGZRVyQgwpaiyDqgMGEU2GQzzcJhgKo9+y1fDtdfj/cctmvJ2Fo1fkk+DMkEPUHGOVo6uKFnartky9iLm1WiHDMruJ6SIOJzAnb+TMBWQTSwI+F4wyEiRVR8Zv4uA="
|
|
script: skip # Don't run tests
|
|
|
|
deploy:
|
|
# Deploy to GitHub, npm, pub, Homebrew.
|
|
provider: script
|
|
script: tool/deploy.sh
|
|
|
|
# Don't clean up the Dart SDK.
|
|
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: {tags: true}
|
|
|
|
# Deploy to Chocolatey from stable because Chocolatey often doesn't support
|
|
# the latest dev channel SDK release.
|
|
- if: *deploy-if
|
|
env:
|
|
- DART_CHANNEL=stable DART_VERSION=latest
|
|
# CHOCO_TOKEN="..."
|
|
- secure: "cW11kQYBBEElfVsc1pJfVEHOMYwt0ZK+9STZHwSPbAISlplIRnsimMN7TqCY2aLnkWXyUMU7DphIl9uQ86M4BT1bJopsHbapj27bFSlKWHlBSDB/xylFHywV41Yk5lMlr8DLMbsSzVahasyR34xS6HYIRlDpZ9TFiQuDQNJxQmqTZJg/FC+3nqCI7tyMKGkWc48ikTcmqDMHsG9CudG2u+Q3S9sLNXArh9T4tSnAyWkTvSrS05mvFx5tC83PcG9/VkioTId+VRSJchwTmCxDFDROrTikTXZMtYn8wMAQ2wQ34TQXNZMZ9uiHA6W0IuJV2EnYerJbqV2lrJq9xqZywKu6HW6i4GhrCvizALNFZx/N7s/10xuf3UcuWizYml/e0MYT+6t4ojTYBMKv+Cx+H2Y2Jdpvdn2ZAIl6LaU3pLw4OIPJ7aXjDwZd63MPxtwGwVLHbH7Zu+oUv1erIq5LtatuocGWipD8WdiMBQvyCuDRMowpLPoAbj+mevOf+xlY2Eym4tOXpxM7iY3lXFHROo5dQbhsARfVF9J1gl5PuYXvCjxqTfK/ef9t3ZoDbi57+yAJUWlZfWa5r1zKE8OS0pA8GfQRLom/Lt0wKVw4Xiofgolzd9pEHi4JpsYIQb8O+u1ACQU6nBCS87CGrQ+ylnzKfGUs0aW2K3gvbkg0LUg="
|
|
script: skip
|
|
deploy:
|
|
provider: script
|
|
script: pub run grinder update_chocolatey
|
|
skip_cleanup: true
|
|
on: {tags: true}
|
|
|
|
# Redeploy sass-lang.com when a build succeeds.
|
|
- stage: site
|
|
if: *deploy-if
|
|
env:
|
|
# HEROKU_TOKEN="..."
|
|
- secure: "jF3TCL+k6xdXWfEh54K6KrZ3w0oljUpP0uy9Hx0BIM5gaqG6fUijUnNGCkWDZxufEpl68mGxNRNMB2Mv++UXHiT7ChFx8zZqEyc5FzhIu/nVO3CP3Sek7fuktYidtUvqJ6eHkI15990dWkUoE+TTXTc4/Z9vv1Lt3JX8Ni5VApGCmcLjRwW52EkCC49xo7cWE8/wBEm2ntOivLBIXEKq6hpncXTO4H5KYt042WAJ+MPmQZYE1ENJAObXWrGituRCT6DQnIJuTodOn24SU1KJuvEtfskEJQUajIIQw29uvmu4TP7dgaJw8QBt+hdgcCYrMhoq3RTNmD+vitLRloG4QMWHFYhzONVZ8S3vAhKeolL7nnIz150FpLVQiddSLsdGomqjCfYEJN7TVrwvunGgHxygcGBcq2AiydnxREnlW9Rj6m6g6TVlhdX7JtyePDQN7xEDdZF1UbGMA6CDjzFsi0GY2WNLSCAANUOXmst0kDIFHGc6WkIUXMIbfmkUZADKzF/JDtnEQqtU8Qxc8JfW6ODXqC/fowE3q4cr8NnJMtclyIL/DsWSx2ph3vUr/VH5MWXd4MDJ6ZRnSJHaY2E0IYcKU2JEpA8r7xrFK/+/B9qCMPnoegRFfuN+zHM9b84rNzaF8fmuWuMVKzncw/TvXttRFqoZVS2Ej1EfLY3SA3M="
|
|
install: skip
|
|
script: skip
|
|
deploy:
|
|
provider: script
|
|
# Heroku doesn't have a public API endpoint for this yet, so we use the
|
|
# private endpoint instead.
|
|
script: >
|
|
curl https://kolkrabbi.heroku.com/apps/98fc74a8-ff56-4a21-85f6-7a1fc8ba95c9/github/push
|
|
-H "Content-Type: application/json"
|
|
-H "Accept: application/json, text/javascript, */*; q=0.01"
|
|
-H "Authorization: Bearer $HEROKU_TOKEN"
|
|
-H "accept-encoding: gzip, deflate, br"
|
|
-H "accept-language: en-US,en;q=0.9"
|
|
-H "origin: https://dashboard.heroku.com"
|
|
-H "referer: https://dashboard.heroku.com/"
|
|
-d '{"branch":"master"}'
|
|
--fail --output -
|
|
|