language: node_js
cache:
  timeout: 600
  directories:
    - node_modules
    - apps/agent/node_modules
    - apps/agreement/node_modules
    - apps/finance/node_modules
    - apps/token-manager/node_modules
    - apps/token-manager/app/node_modules
    - apps/vault/node_modules
    - apps/voting/node_modules
    - apps/voting-disputable/node_modules
    - shared/migrations/node_modules
notifications:
  email: false
node_js:
  - '12'
install:
  - yarn install --frozen-lockfile
jobs:
  include:
    - stage: tests
      script: yarn lint
      name: "Lint"
    - script: yarn test:agreement
      name: "Agreement"
    - script: yarn test:agent
      name: "Agent"
    - script: yarn test:finance
      name: "Finance"
    - script: yarn test:token-manager
      name: "Token Manager"
    - script: yarn test:vault
      name: "Vault"
    - script: yarn test:voting
      name: "Voting"
    - script: yarn test:voting-disputable
      name: "Voting Disputable"

    - stage: coverage
      script: echo "Skipping Agreement coverage since buidler plugin cannot be overriden for custom compilation yet" # yarn coverage:agreement
      name: "Agreement"
    - script: yarn coverage:agent
      name: "Agent"
    - script: yarn coverage:finance
      name: "Finance"
    - script: yarn coverage:token-manager
      name: "Token Manager"
    - script: yarn coverage:vault
      name: "Vault"
    - script: yarn coverage:voting
      name: "Voting"
    - script: echo "Skipping Disputablevoting coverage since buidler plugin cannot be overriden for custom compilation yet" # script: yarn coverage:voting-disputable
      name: "Voting Disputable"
after_success:
  - ./node_modules/.bin/lcov-result-merger 'apps/*/coverage/lcov.info' | ./node_modules/.bin/coveralls