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.

76 lines
1.9 KiB

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