machine:
  timezone:
    Asia/Tokyo
  environment:
    PATH: "/usr/bin:${PATH}:${HOME}/${CIRCLE_PROJECT_REPONAME}/node_modules/.bin"


dependencies:
  pre:
    - curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
    - echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
    - curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash -
    - sudo apt-get update
    - sudo apt-get install -y nodejs yarn
    - node -v
    - yarn --version
    - yarn global add coveralls

  override:
    - yarn

  cache_directories:
    - ~/.cache/yarn

test:
  override:
    - yarn test

  post:
    - if [ $CIRCLE_BRANCH = 'master' ]; then yarn run coverage; fi

compile:
  pre:
    - yarn run clean
  override:
    - yarn run build

deployment:
  production:
    tag: /v[0-9]+(\.[0-9]+){2}/
    owner: LKay
    commands:
      # until yarn has better CLI we have to use this...
      - echo -e "$NPM_USERNAME\n$NPM_PASSWORD\n$NPM_EMAIL" | npm login
      - npm publish
      - npm logout

machine:
  timezone:
    Asia/Tokyo
  environment:
    PATH: "/usr/bin:${PATH}:${HOME}/${CIRCLE_PROJECT_REPONAME}/node_modules/.bin"


dependencies:
  pre:
    - curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
    - echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
    - curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash -
    - sudo apt-get update
    - sudo apt-get install -y nodejs yarn
    - node -v
    - yarn --version
    - yarn global add coveralls

  override:
    - yarn

  cache_directories:
    - ~/.cache/yarn

test:
  override:
    - yarn test

  post:
    - if [ $CIRCLE_BRANCH = 'master' ]; then yarn run coverage; fi:
      environment:
        COVERALLS_SERVICE_JOB_ID: $CIRCLE_BUILD_NUM
        COVERAGE_GIT_COMMIT: $CIRLE_SHA1

compile:
  pre:
    - yarn run clean
  override:
    - yarn run build

deployment:
  production:
    tag: /v[0-9]+(\.[0-9]+){2}/
    owner: LKay
    commands:
      # until yarn has better CLI we have to use this...
      - echo -e "$NPM_USERNAME\n$NPM_PASSWORD\n$NPM_EMAIL" | npm login
      - npm publish
      - npm logout

Add some more details to coverall report
Add some more details to coverall report
