pegjs/azure-pipelines.yml

59 lines
1.6 KiB
YAML
Raw Normal View History

2019-01-01 16:14:34 +01:00
name: $(BuildID)
resources:
repositories:
- repository: apt
type: github
name: futagoza/apt
2019-01-25 06:14:05 +01:00
endpoint: futagoza
variables:
- group: 'env-variables'
jobs:
- template: eslint.yml@apt
2019-01-27 07:20:10 +01:00
- template: node-test.yml@apt
parameters:
2019-01-27 13:01:42 +01:00
npm_test: False
2019-02-12 09:59:59 +01:00
beforeEach:
- script: |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter
2019-01-27 13:01:42 +01:00
displayName: 'Download Code Climate Test Reporter'
2019-02-12 09:59:59 +01:00
afterEach:
2019-01-27 13:01:42 +01:00
- script: |
./cc-test-reporter before-build
yarn test 2> /dev/null
if [ $? -eq 0 ]
then
echo '"yarn test" passed, publishing to code climate.'
./cc-test-reporter after-build --exit-code 0
echo 'Publishing code coverage results to coveralls.io'
yarn coverage
exit 0
else
echo '"yarn test" failed, publishing to code climate.'
./cc-test-reporter after-build --exit-code 1
exit 1
fi
displayName: 'mocha > codeclimate & coveralls'
env:
2019-01-27 13:01:42 +01:00
CC_TEST_REPORTER_ID: $(CC_TEST_REPORTER_ID)
2019-02-12 11:11:21 +01:00
CODECOV_TOKEN: $(CODECOV_TOKEN)
2019-01-27 07:20:10 +01:00
publish_test_results_to_pipelines: True
publish_code_coverage_to_pipelines: True
2019-02-15 03:49:02 +01:00
- template: node.yml@apt
parameters:
name: 'Publish pegjs@dev'
actions:
- script: npm run build-dist
2019-02-15 04:14:43 +01:00
displayName: 'Build "pegjs/dist/*.js" files'
2019-02-15 03:49:02 +01:00
- script: node tools/publish-dev
2019-02-15 04:14:43 +01:00
displayName: 'Publish to NPM'
2019-03-20 23:09:50 +01:00
env:
NPM_TOKEN: $(NPM_CI_TOKEN)
BUILD_REASON: $(variables['Build.Reason'])