language: node_js

node_js:
    - stable

before_install:
    - curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.2.0
    - export PATH=$HOME/.yarn/bin:$PATH

cache: yarn

install:
    - yarn

before_script:
    - yarn flow
    - yarn lint
    - yarn test

before_deploy:
    - npm config set //registry.npmjs.org/:_authToken=\${NPM_TOKEN}

deploy:
    - provider: script
      script: yarn canary
      skip_cleanup: true
      on:
        branch: develop

    - provider: script
      script: yarn release && yarn ghpages
      skip_cleanup: true
      on:
        branch: master

# Send coverage data to Coveralls
after_script:
    - cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js

branches:
    only:
        - master
        - develop

env:
  global:
    - GH_REPO: github.com/iCHEF/gypcrete.git

language: node_js

node_js:
    - stable

before_install:
    - curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.2.0
    - export PATH=$HOME/.yarn/bin:$PATH

cache: yarn

install:
    - yarn

before_script:
    - yarn flow
    - yarn lint

script:
    - yarn test

before_deploy:
    - npm config set //registry.npmjs.org/:_authToken=\${NPM_TOKEN}

deploy:
    - provider: script
      script: yarn canary
      skip_cleanup: true
      on:
        branch: develop

    - provider: script
      script: yarn release && yarn ghpages
      skip_cleanup: true
      on:
        branch: master

# Send coverage data to Coveralls
after_script:
    - cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js

branches:
    only:
        - master
        - develop

env:
  global:
    - GH_REPO: github.com/iCHEF/gypcrete.git

Move 'yarn test' to script stage on Travis to prevent running tests twice
Move 'yarn test' to script stage on Travis to prevent running tests twice
