ffffng/app/bower_components/lodash/.travis.yml

136 lines
4.8 KiB
YAML
Raw Normal View History

2016-05-16 13:33:49 +02:00
language: node_js
sudo: false
node_js:
2017-05-13 13:25:33 +02:00
- 7
addons:
jwt:
secure: OYhRpW+8A0Iik+9GmHwa45ZwXeBXw/6zh6I+1w2H9g/LqPRp+Nhq3f4FSpvrrfno8lO8W4h+7s6+JOzF8C8NxNda5UUygKjF9pUphgiQdqls3YZMJlC9zXVl7gQXAHi3nG1s8vWSpwpzYD9fqczE1FX9n0+R63qX3eB6C/LbPeI=
cache:
directories:
- ~/.npm
- ~/.yarn-cache
- travis_phantomjs
2016-05-16 13:33:49 +02:00
env:
global:
2017-05-13 13:25:33 +02:00
- BIN=node ISTANBUL=false OPTION=""
- SAUCE_LABS=false SAUCE_USERNAME=lodash
2016-05-16 13:33:49 +02:00
matrix:
-
2017-05-13 13:25:33 +02:00
- BIN=phantomjs
2016-05-16 13:33:49 +02:00
- ISTANBUL=true
- SAUCE_LABS=true
2017-05-13 13:25:33 +02:00
2016-05-16 13:33:49 +02:00
matrix:
include:
2017-05-13 13:25:33 +02:00
- node_js: 6
2016-05-16 13:33:49 +02:00
env:
2017-05-13 13:25:33 +02:00
2016-05-16 13:33:49 +02:00
git:
depth: 10
2017-05-13 13:25:33 +02:00
2016-05-16 13:33:49 +02:00
branches:
only:
- master
2019-03-29 22:00:08 +01:00
- 4.17.5
2017-05-13 13:25:33 +02:00
2016-05-16 13:33:49 +02:00
notifications:
webhooks:
urls:
- https://webhooks.gitter.im/e/4aab6358b0e9aed0b628
on_success: change
on_failure: always
2017-05-13 13:25:33 +02:00
2016-05-16 13:33:49 +02:00
before_install:
2017-05-13 13:25:33 +02:00
# Upgrade PhantomJS.
- |
export PHANTOMJS_VERSION=2.1.1
export PATH=$PWD/travis_phantomjs/phantomjs-$PHANTOMJS_VERSION-linux-x86_64/bin:$PATH
if [ $(phantomjs --version) != $PHANTOMJS_VERSION ]; then
rm -rf $PWD/travis_phantomjs
mkdir -p $PWD/travis_phantomjs
wget https://github.com/Medium/phantomjs/releases/download/v$PHANTOMJS_VERSION/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2
tar -xvf phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2 -C $PWD/travis_phantomjs
fi
phantomjs -v
# Use exact Node version.
- nvm use $TRAVIS_NODE_VERSION
# Setup package managers.
- npm set loglevel error
- npm set progress false
- npm i -g yarn@0.16.1
- yarn -V
# Remove code skipped on the coverage run.
2016-05-16 13:33:49 +02:00
- |
2017-05-13 13:25:33 +02:00
PATTERN[0]="|\s*while\s*\([^)]+\)\s*\{\s*iteratee\(index\);\s*\}|"
PATTERN[1]="|\bindex,\s*iterable\)\s*===\s*false\)[^}]+?(break;)|"
PATTERN[2]="|\bcase\s+(?:dataView|promise|set|map|weakMap)CtorString:.+|g"
PATTERN[3]="|\s*if\s*\(cache\.size\b[\s\S]+?\}|"
PATTERN[4]="|\s*if\s*\(\!lodashFunc\)\s*\{\s*return;\s*\}|"
PATTERN[5]="|\s*define\([\s\S]+?\);|"
PATTERN[6]="|\s*root\._\s*=\s*_;|"
if [ $ISTANBUL = true ]; then
2016-05-16 13:33:49 +02:00
set -e
for PTRN in ${PATTERN[@]}; do
2017-05-13 13:25:33 +02:00
node ./test/remove.js $PTRN ./lodash.js
2016-05-16 13:33:49 +02:00
done
fi
2017-05-13 13:25:33 +02:00
install:
# Install packages.
- yarn
# Use lodash-cli from GitHub.
- git clone --depth=10 --branch=master git://github.com/lodash/lodash-cli ./node_modules/lodash-cli
- mkdir -p ./node_modules/lodash-cli/node_modules/lodash; cd $_; cp ../../../../lodash.js ./lodash.js; cp ../../../../package.json ./package.json
- cd ../../; npm i --production; cd ../../
2016-05-16 13:33:49 +02:00
script:
2017-05-13 13:25:33 +02:00
# Detect code coverage.
- |
if [ $ISTANBUL = true ]; then
istanbul cover -x "**/vendor/**" --report lcovonly ./test/test.js -- ./lodash.js
if [ $TRAVIS_SECURE_ENV_VARS = true ]; then
cat ./coverage/lcov.info | coveralls
cat ./coverage/coverage.json | codecov
fi
fi
2016-05-16 13:33:49 +02:00
2017-05-13 13:25:33 +02:00
# Test in Node.js and PhantomJS.
- |
if [ $ISTANBUL = false ]; then
node ./node_modules/lodash-cli/bin/lodash -o ./dist/lodash.js
node ./node_modules/lodash-cli/bin/lodash modularize exports=node -o ./
node ./node_modules/lodash-cli/bin/lodash -d -o ./lodash.js
if [ $SAUCE_LABS = false ]; then
cd ./test
$BIN $OPTION ./test.js ../lodash.js
if [ $TRAVIS_SECURE_ENV_VARS = true ]; then
$BIN $OPTION ./test.js ../dist/lodash.min.js
fi
fi
fi
# Test in Sauce Labs.
- |
if [ $SAUCE_LABS = true ]; then
node ./node_modules/lodash-cli/bin/lodash core -o ./dist/lodash.core.js
npm run build
$BIN ./test/saucelabs.js name="lodash tests" runner="test/index.html?build=../dist/lodash.js&noglobals=true" tags=development
$BIN ./test/saucelabs.js name="lodash tests" runner="test/index.html?build=../dist/lodash.min.js&noglobals=true" tags=production
$BIN ./test/saucelabs.js name="lodash-fp tests" runner="test/fp.html?noglobals=true" tags=development
$BIN ./test/saucelabs.js name="underscore tests" runner="test/underscore.html?build=../dist/lodash.js" tags=development,underscore
$BIN ./test/saucelabs.js name="underscore tests" runner="test/underscore.html?build=../dist/lodash.min.js" tags=production,underscore
$BIN ./test/saucelabs.js name="backbone tests" runner="test/backbone.html?build=../dist/lodash.js" tags=development,backbone
$BIN ./test/saucelabs.js name="backbone tests" runner="test/backbone.html?build=../dist/lodash.min.js" tags=production,backbone
$BIN ./test/saucelabs.js name="backbone tests" runner="test/backbone.html?build=../dist/lodash.core.js" tags=development,backbone
$BIN ./test/saucelabs.js name="backbone tests" runner="test/backbone.html?build=../dist/lodash.core.min.js" tags=production,backbone
fi