language: node_js
node_js: "lts/*"
cache:
  directories:
    - "node_modules"

git:
  depth: 99999

install:
  - npm run clean
  - npm install

addons:
  sonarcloud:
    organization: $SONAR_ORGANIZATION
    token:
      secure: $SONAR_TOKEN

script:
  - npm run coverage
  - npm run build
  - npm run bundlesize
  - sonar-scanner

deploy:
  skip_cleanup: true
  provider: npm
  email: $DEPLOY_EMAIL
  api_key: $NPM_TOKEN
  on:
    branch: master
    tags: true
