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.

57 lines
1.6 KiB

  1. name: $(BuildID)
  2. resources:
  3. repositories:
  4. - repository: apt
  5. type: github
  6. name: futagoza/apt
  7. endpoint: futagoza
  8. variables:
  9. - group: 'env-variables'
  10. jobs:
  11. - template: eslint.yml@apt
  12. - template: node-test.yml@apt
  13. parameters:
  14. npm_test: False
  15. beforeEach:
  16. - script: |
  17. curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
  18. chmod +x ./cc-test-reporter
  19. displayName: 'Download Code Climate Test Reporter'
  20. afterEach:
  21. - script: |
  22. ./cc-test-reporter before-build
  23. yarn test 2> /dev/null
  24. if [ $? -eq 0 ]
  25. then
  26. echo '"yarn test" passed, publishing to code climate.'
  27. ./cc-test-reporter after-build --exit-code 0
  28. echo 'Publishing code coverage results to coveralls.io'
  29. yarn coverage
  30. exit 0
  31. else
  32. echo '"yarn test" failed, publishing to code climate.'
  33. ./cc-test-reporter after-build --exit-code 1
  34. exit 1
  35. fi
  36. displayName: 'mocha > codeclimate & coveralls'
  37. env:
  38. CC_TEST_REPORTER_ID: $(CC_TEST_REPORTER_ID)
  39. CODECOV_TOKEN: $(CODECOV_TOKEN)
  40. publish_test_results_to_pipelines: True
  41. publish_code_coverage_to_pipelines: True
  42. - template: node.yml@apt
  43. parameters:
  44. name: 'Publish pegjs@dev'
  45. actions:
  46. - script: npm run build-dist
  47. displayName: 'Build "pegjs/dist/*.js" files'
  48. - script: node tools/publish-dev
  49. displayName: 'Publish to NPM'
  50. env:
  51. NPM_TOKEN: $(NPM_CI_TOKEN)