You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

68 lines
2.0 KiB

  1. name: $(BuildID)
  2. pool:
  3. vmImage: 'ubuntu-16.04'
  4. variables:
  5. - group: 'env-variables'
  6. strategy:
  7. maxParallel: 3
  8. matrix:
  9. Node 6:
  10. node_version: 6.x
  11. Node 8:
  12. node_version: 8.x
  13. Node 10:
  14. node_version: 10.x
  15. steps:
  16. - task: NodeTool@0
  17. inputs:
  18. versionSpec: $(node_version)
  19. displayName: 'Install Node.js'
  20. - script: |
  21. yarn install --ignore-engines
  22. echo 'Downloading Code Climate Test Reporter...'
  23. curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
  24. chmod +x ./cc-test-reporter
  25. echo 'Done downloading Code Climate Test Reporter.'
  26. displayName: 'Install dependencies'
  27. - script: |
  28. ./cc-test-reporter before-build
  29. yarn ci 2> /dev/null
  30. if [ $? -eq 0 ]
  31. then
  32. echo '"yarn ci" passed, publishing to code climate.'
  33. ./cc-test-reporter after-build --coverage-input-type lcov -d --exit-code 0
  34. echo 'Publishing code coverage results to coveralls.io'
  35. yarn coverage
  36. exit 0
  37. else
  38. echo '"yarn ci" failed, publishing to code climate.'
  39. ./cc-test-reporter after-build --coverage-input-type lcov -d --exit-code 1
  40. exit 1
  41. fi
  42. displayName: 'eslint > mocha > codeclimate & coveralls'
  43. env:
  44. CC_TEST_REPORTER_ID: $(CC_TEST_REPORTER_ID)
  45. COVERALLS_SERVICE_NAME: $(COVERALLS_SERVICE_NAME)
  46. COVERALLS_REPO_TOKEN: $(COVERALLS_REPO_TOKEN)
  47. GIT_BRANCH: $(Build.SourceBranch)
  48. GIT_COMMIT_SHA: $(Build.SourceVersion)
  49. - task: PublishTestResults@2
  50. displayName: 'Publish test results (Azure Pipelines)'
  51. condition: succeededOrFailed()
  52. inputs:
  53. testRunner: JUnit
  54. testResultsFiles: 'test/junit-results.xml'
  55. - task: PublishCodeCoverageResults@1
  56. displayName: 'Publish code coverage results (Azure Pipelines)'
  57. inputs:
  58. codeCoverageTool: Cobertura
  59. summaryFileLocation: '$(System.DefaultWorkingDirectory)/coverage/cobertura-coverage.xml'
  60. reportDirectory: '$(System.DefaultWorkingDirectory)/coverage/lcov-report'