jobs:
  include:
    - stage: test
      language: node_js
      cache: npm
      node_js:
        - 10
      install:
        - npm ci
      script:
        - npm run build
        - npm run test:ci -- --coverage
      after_script:
        - npx codeclimate-test-reporter < coverage/lcov.info
    - stage: release
      language: node_js
      node_js:
        - 10
      install:
        - npm i -D @semantic-release/commit-analyzer @semantic-release/release-notes-generator
          @semantic-release/github 
      script:
        - npx semantic-release
stages:
  - test
  - name: release
    if: branch = master AND type != pull_request
