Matteo Scandolo | b3b0317 | 2016-05-16 09:59:38 -0700 | [diff] [blame] | 1 | language: node_js |
| 2 | sudo: false |
| 3 | node_js: |
| 4 | - "5" |
| 5 | env: |
| 6 | global: |
| 7 | - BIN="node" ISTANBUL=false OPTION="" |
| 8 | - SAUCE_LABS=false SAUCE_USERNAME="lodash" |
| 9 | - secure: "tg1JFsIFnxzLaTboFPOnm+aJCuMm5+JdhLlESlqg9x3fwro++7KCnwHKLNovhchaPe4otC43ZMB/nfWhDnDm11dKbm/V6HlTkED+dadTsaLxVDg6J+7yK41QhokBPJOxLV78iDaNaAQVYEirAgZ0yn8kFubxmNKV+bpCGQNc9yU=" |
| 10 | matrix: |
| 11 | - |
| 12 | - BIN="phantomjs" |
| 13 | - ISTANBUL=true |
| 14 | - SAUCE_LABS=true |
| 15 | matrix: |
| 16 | include: |
| 17 | - node_js: "0.10" |
| 18 | env: |
| 19 | - node_js: "0.12" |
| 20 | env: |
| 21 | - node_js: "4" |
| 22 | env: |
| 23 | git: |
| 24 | depth: 10 |
| 25 | branches: |
| 26 | only: |
| 27 | - master |
| 28 | notifications: |
| 29 | webhooks: |
| 30 | urls: |
| 31 | - https://webhooks.gitter.im/e/4aab6358b0e9aed0b628 |
| 32 | on_success: change |
| 33 | on_failure: always |
| 34 | before_install: |
| 35 | - "nvm use $TRAVIS_NODE_VERSION" |
| 36 | - "npm set loglevel error" |
| 37 | - "npm set progress false" |
| 38 | - "npm i -g npm@\"^2.0.0\"" |
| 39 | - | |
| 40 | PATTERN[0]="|\s*if\s*\(isHostObject\b[\s\S]+?\}(?=\n)|" |
| 41 | PATTERN[1]="|\s*if\s*\(enumerate\b[\s\S]+?\};\s*\}|" |
| 42 | PATTERN[2]="|\s*while\s*\([^)]+\)\s*\{\s*iteratee\(index\);\s*\}|" |
| 43 | PATTERN[3]="|\s*else\s*\{\s*assocSet\(data\b[\s\S]+?\}|" |
| 44 | PATTERN[4]="|\bcase\s+(?:dataView|set|map|weakMap)CtorString:.+|g" |
| 45 | PATTERN[5]="|\bindex,\s*iterable\)\s*===\s*false\)[^}]+?(break;)|" |
| 46 | PATTERN[6]="|\s*if\s*\(\!lodashFunc\)\s*\{\s*return;\s*\}|" |
| 47 | PATTERN[7]="|\s*define\([\s\S]+?\);|" |
| 48 | PATTERN[8]="|\s*root\._\s*=\s*_;|" |
| 49 | |
| 50 | if [ $ISTANBUL == true ]; then |
| 51 | set -e |
| 52 | for PTRN in ${PATTERN[@]}; do |
| 53 | node ./test/remove.js "$PTRN" ./lodash.js |
| 54 | done |
| 55 | fi |
| 56 | - "git clone --depth=10 --branch=master git://github.com/lodash/lodash-cli ./node_modules/lodash-cli && mkdir $_/node_modules && cd $_ && ln -s ../../../ ./lodash && cd ../ && npm i && cd ../../" |
| 57 | - "node ./node_modules/lodash-cli/bin/lodash -o ./dist/lodash.js" |
| 58 | script: |
| 59 | - "[ $ISTANBUL == false ] || istanbul cover -x \"**/vendor/**\" --report lcovonly ./test/test.js -- ./lodash.js" |
| 60 | - "[ $ISTANBUL == false ] || [ $TRAVIS_SECURE_ENV_VARS == false ] || (cat ./coverage/lcov.info | coveralls) || true" |
| 61 | - "[ $ISTANBUL == false ] || [ $TRAVIS_SECURE_ENV_VARS == false ] || (cat ./coverage/coverage.json | codecov) || true" |
| 62 | - "[ $SAUCE_LABS == true ] || [ $ISTANBUL == true ] || cd ./test" |
| 63 | - "[ $SAUCE_LABS == true ] || [ $ISTANBUL == true ] || $BIN $OPTION ./test.js ../lodash.js" |
| 64 | - "[ $SAUCE_LABS == true ] || [ $ISTANBUL == true ] || [ $TRAVIS_SECURE_ENV_VARS == false ] || $BIN $OPTION ./test.js ../dist/lodash.min.js" |
| 65 | - "[ $SAUCE_LABS == false ] || rm -rf ./node_modules/lodash" |
| 66 | - "[ $SAUCE_LABS == false ] || ($BIN ./node_modules/lodash-cli/bin/lodash -d -o ./node_modules/lodash/index.js && cd ./node_modules/lodash/ && ln -s ./index.js ./lodash.js && cd ../../)" |
| 67 | - "[ $SAUCE_LABS == false ] || $BIN ./node_modules/lodash-cli/bin/lodash core -o ./dist/lodash.core.js" |
| 68 | - "[ $SAUCE_LABS == false ] || npm run build" |
| 69 | - "[ $SAUCE_LABS == false ] || $BIN ./test/saucelabs.js name=\"lodash tests\" runner=\"test/index.html?build=../dist/lodash.js&noglobals=true\" tags=\"development\"" |
| 70 | - "[ $SAUCE_LABS == false ] || $BIN ./test/saucelabs.js name=\"lodash tests\" runner=\"test/index.html?build=../dist/lodash.min.js&noglobals=true\" tags=\"production\"" |
| 71 | - "[ $SAUCE_LABS == false ] || $BIN ./test/saucelabs.js name=\"lodash-fp tests\" runner=\"test/fp.html?noglobals=true\" tags=\"development\"" |
| 72 | - "[ $SAUCE_LABS == false ] || $BIN ./test/saucelabs.js name=\"underscore tests\" runner=\"test/underscore.html?build=../dist/lodash.js\" tags=\"development,underscore\"" |
| 73 | - "[ $SAUCE_LABS == false ] || $BIN ./test/saucelabs.js name=\"underscore tests\" runner=\"test/underscore.html?build=../dist/lodash.min.js\" tags=\"production,underscore\"" |
| 74 | - "[ $SAUCE_LABS == false ] || $BIN ./test/saucelabs.js name=\"backbone tests\" runner=\"test/backbone.html?build=../dist/lodash.js\" tags=\"development,backbone\"" |
| 75 | - "[ $SAUCE_LABS == false ] || $BIN ./test/saucelabs.js name=\"backbone tests\" runner=\"test/backbone.html?build=../dist/lodash.min.js\" tags=\"production,backbone\"" |
| 76 | - "[ $SAUCE_LABS == false ] || $BIN ./test/saucelabs.js name=\"backbone tests\" runner=\"test/backbone.html?build=../dist/lodash.core.js\" tags=\"development,backbone\"" |
| 77 | - "[ $SAUCE_LABS == false ] || $BIN ./test/saucelabs.js name=\"backbone tests\" runner=\"test/backbone.html?build=../dist/lodash.core.min.js\" tags=\"production,backbone\"" |