# Portions of this file derived from https://github.com/creationix/node-gamepad/blob/master/.travis.yml # # node-gamepad code used under the MIT License: # # The MIT License (MIT) # # Copyright (c) 2014 Tim Caswell # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in all # copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. language: node_js sudo: false os: - linux - osx env: global: - secure: KrnF6XWHwqwvy+m2VRltpJv7/8UfvcAAKFBxkhoB62YfZMx/4Qur9Gzzi9/U+Ulxb8VDUbDP7rmmqo90kEENcSbjgnKv0XYjWMVz/8+6MVnf8lDGY6B7+NVHu8KnmVElHYjjZUt8iuwN/0E1jThXvFS8f9B6sz7kl/oq4xJwpQi5mcY5nT2gTY3fLGru7V7+GrJ0Ukg2fkw3DrFC9YZnLJCqNzVS9vOyJZwvn7ZkoeJOw68MkqxedKlmDqa5uUbfSNFqJyd3OGKw1P61tf40cql1vxPZ/k42hlTv/Dc/mZ700Pc4PVdGPz9B/DN3neB9J82fCu2iyeJ/WaaOfm8hLf9nFjO46fpvrNmS/dW6ZMkWgE/HN9LmJPKpiD6fNM5/Lb2pOEP2zFT+lWLq0q/w46+qKnd0FbK/I+EkBG9cP5ei03Zr7EMlgRd13papfcixPPhD75vFxOyjNS3NtulOLVOXLBXyXf2fnCvcJijblz1pdll3CUvS8Ohh/f/oSS6gVp6EGQlzg4a9FlW/ZwxbPvsGy/YJbIFGJCCt0neFEe4SNTb/kc1GieckwWNyaTaE2QxBlkApkKbcYDkFZI6HdUneTH1kf6D7ZjTx5GiiB6BaOZp/yApxJn7cpwQuZGYb67+9A/yqQAfgtDcxHi3CQKge3Y5qJc7zEfMB9UkJZjw= addons: apt: sources: ['ubuntu-toolchain-r-test'] packages: ['g++-4.8'] node_js: - '7' - '6' - '4' - '0.12' - '0.10' before_install: # Use yarn on node > 4 # v0.22.0 is a temporary workaround for https://github.com/yarnpkg/yarn/issues/3138 - if [[ "$TRAVIS_NODE_VERSION" == "0.10" ]] || [[ "$TRAVIS_NODE_VERSION" == "0.12" ]]; then export INSTALL_LOCAL="npm install"; export INSTALL_GLOBAL="npm install -g"; else curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 0.22.0; export INSTALL_LOCAL="yarn"; export INSTALL_GLOBAL="yarn global add"; fi; # Use gcc 4.8 on linux and clang on osx - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then export CXX=g++-4.8; fi # get commit message - COMMIT_MESSAGE=$(git show -s --format=%B $TRAVIS_COMMIT | tr -d '\n') # put local node_modules on PATH - export PATH=./node_modules/.bin/:$PATH # put global node-gyp on PATH - eval $INSTALL_GLOBAL node-gyp - PUBLISH_BINARY=false # if we are building a tag then publish - if [[ $TRAVIS_BRANCH == `git describe --tags --always HEAD` ]]; then PUBLISH_BINARY=true; fi; # or if we put [publish binary] in the commit message - if test "${COMMIT_MESSAGE#*'[publish binary]'}" != "$COMMIT_MESSAGE"; then PUBLISH_BINARY=true; fi; install: # ensure source install works - eval $INSTALL_LOCAL --build-from-source # test module import - node index.js before_script: - if [[ $PUBLISH_BINARY == true ]]; then node-pre-gyp package; node-pre-gyp-github publish --release; fi; - node-pre-gyp clean - node-gyp clean script: # if publishing, test installing from remote - if [[ $PUBLISH_BINARY == true ]]; then eval $INSTALL_LOCAL --fallback-to-build=false; fi; # If success then we arrive here so lets clean up - node-pre-gyp clean after_success: # if success then query and display all published binaries - node-pre-gyp info