jeanfortheweb/apere

View on GitHub
.travis.yml

Summary

Maintainability
Test Coverage
if: tag IS blank
language: node_js
node_js:
  - 'lts/*'

cache:
  yarn: true

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

install:
  - git config --global user.email $GITHUB_EMAIL
  - git config --global user.name $GITHUB_USER
  - git remote set-url origin "https://$GITHUB_TOKEN@github.com/$TRAVIS_REPO_SLUG.git"
  - yarn
  - yarn run compile:cjs
  - yarn run compile:esm

jobs:
  include:
    - stage: test
      if: tag IS blank and branch != next
      before_script:
        - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
        - chmod +x ./cc-test-reporter
        - ./cc-test-reporter before-build
      script:
        - yarn run jest --coverage
      after_script:
        - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
        - ./cc-test-reporter format-coverage -t lcov ./coverage/lcov.info
        - ./cc-test-reporter upload-coverage

    - stage: publish
      if: tag IS blank AND branch = next AND type != pull_request
      before_script:
        - npm config set //registry.npmjs.org/:_authToken $NPM_TOKEN
        - git checkout next
        - git reset --hard
        - git pull
      script:
        - lerna publish  --conventional-commits --changelog-preset eslint --yes --allow-branch next