sudo: false
language: node_js
node_js:
    - '10'
install:
    - yarn
    - yarn global add codecov
before_script:
    - yarn add react react-dom
stages:
    - test
    - name: deploy
jobs:
  include:
    - stage: test
      script:
      - yarn lint
      - yarn test 

      after_script:
        - codecov
    - stage: deploy
      script:
        - yarn build:lib
      deploy:
        provider: npm
        email: wzi.weng@gmail.com
        api_key: "$NPM_TOKEN"
        skip_cleanup: true
        on:
          branch: master
env:
    global:
        - CODECOV_TOKEN="b1f05410-7844-4681-88bf-d49132edc931"
