cahilfoley/utils

View on GitHub
.travis.yml

Summary

Maintainability
Test Coverage
cache: npm
language: node_js

jobs:
  include:
    - stage: test
      name: 'Node.js: 8'
      node_js: 8
      script:
        - echo "Running tests against node $(node -v)"
        - tsc --noEmit
        - jest

    - stage: test
      name: 'Node.js: 10'
      node_js: 10
      script:
        - echo "Running tests against node $(node -v)"
        - tsc --noEmit
        - jest

    - stage: test
      name: 'Node.js: 12'
      node_js: 12
      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:
        - echo "Running tests against node $(node -v)"
        - tsc --noEmit
        - jest
      after_script:
        - cat .temp/coverage/lcov.info | coveralls
        - './cc-test-reporter format-coverage -t lcov -o .temp/coverage/codeclimate.json .temp/coverage/lcov.info'
        - if [[ "$TRAVIS_TEST_RESULT" == 0 ]]; then ./cc-test-reporter upload-coverage --input .temp/coverage/codeclimate.json; fi

    - stage: deploy
      name: Publish NPM package
      node_js: 12
      script: skip
      before_deploy:
        - npm run build
        - cd dist
        - npm pack
        - echo "Deploying package to npm"
      deploy:
        provider: npm
        email: cahil.npm@gmail.com
        api_key: $NPM_API_KEY
        skip_cleanup: true
        on:
          tags: true
          repo: cahilfoley/utils

    - name: Deploy docs
      node_js: 12
      script: skip
      before_deploy:
        - npm run build:docs
      deploy:
        provider: pages
        skip_cleanup: true
        github_token: $GH_TOKEN
        keep_history: true
        local_dir: docs
        on:
          tags: true
          repo: cahilfoley/utils