pool:
  vmImage: 'Ubuntu 16.04'

steps:
- script: npm install
  displayName: 'Install dependencies'
  env:
    AZURE_PIPELINES: "true"

- script: sudo npm install -g @angular/cli
  displayName: 'Install Angular CLI'

- script: npm run lint:lib
  displayName: 'Run lint'

- script: ng build igniteui-angular --prod
  displayName: 'Build source code'

- script: npm run build:style
  displayName: 'Build styles'

- script: npm run test:lib:azure
  displayName: 'Run tests'

- script: cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js
  condition: and(succeeded(), eq(variables['system.teamProject'], 'igniteui-angular'))
  displayName: 'Code coverage @ Coveralls'
  env:
    COVERALLS_REPO_TOKEN: $(coveralls.repoToken)

- script: npm run test:schematics
  displayName: 'Run migrations & schematics'

- task: PublishTestResults@2
  condition: succeededOrFailed()
  inputs:
    testRunner: 'JUnit'
    testResultsFiles: '**/TESTS-*.xml' 

- task: PublishCodeCoverageResults@1
  inputs: 
    codeCoverageTool: Cobertura
    summaryFileLocation: '$(System.DefaultWorkingDirectory)/coverage/cobertura-coverage.xml'
    reportDirectory: '$(System.DefaultWorkingDirectory)/coverage'

pool:
  vmImage: 'Ubuntu 16.04'

steps:
- script: npm install
  displayName: 'Install dependencies'
  env:
    AZURE_PIPELINES: "true"

- script: export NODE_OPTIONS="--max_old_space_size=4096"
  displayName: 'setting max_old_space_size=4096'

- script: sudo npm install -g @angular/cli
  displayName: 'Install Angular CLI'

- script: npm run lint:lib
  displayName: 'Run lint'

- script: ng build igniteui-angular --prod
  displayName: 'Build source code'

- script: npm run build:style
  displayName: 'Build styles'

- script: npm run test:lib:azure
  displayName: 'Run tests'

- script: cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js
  condition: and(succeeded(), eq(variables['system.teamProject'], 'igniteui-angular'))
  displayName: 'Code coverage @ Coveralls'
  env:
    COVERALLS_REPO_TOKEN: $(coveralls.repoToken)

- script: npm run test:schematics
  displayName: 'Run migrations & schematics'

- task: PublishTestResults@2
  condition: succeededOrFailed()
  inputs:
    testRunner: 'JUnit'
    testResultsFiles: '**/TESTS-*.xml' 

- task: PublishCodeCoverageResults@1
  inputs: 
    codeCoverageTool: Cobertura
    summaryFileLocation: '$(System.DefaultWorkingDirectory)/coverage/cobertura-coverage.xml'
    reportDirectory: '$(System.DefaultWorkingDirectory)/coverage'

Set max_old_space_size to 4096 for Azure
chore(*): Set max_old_space_size to 4096 for Azure
