forked from pegjs/pegjs
-
Notifications
You must be signed in to change notification settings - Fork 1
/
azure-pipelines.yml
58 lines (52 loc) · 1.62 KB
/
azure-pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: $(BuildID)
resources:
repositories:
- repository: apt
type: github
name: futagoza/apt
endpoint: futagoza
variables:
- group: 'env-variables'
jobs:
- template: eslint.yml@apt
- template: node-test.yml@apt
parameters:
npm_test: False
beforeEach:
- script: |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter
displayName: 'Download Code Climate Test Reporter'
afterEach:
- 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:
CC_TEST_REPORTER_ID: $(CC_TEST_REPORTER_ID)
CODECOV_TOKEN: $(CODECOV_TOKEN)
publish_test_results_to_pipelines: True
publish_code_coverage_to_pipelines: True
- template: node.yml@apt
parameters:
name: 'Publish pegjs@dev'
actions:
- script: npm run build-dist
displayName: 'Build "pegjs/dist/*.js" files'
- script: node tools/publish-dev
displayName: 'Publish to NPM'
env:
NPM_TOKEN: $(NPM_CI_TOKEN)
BUILD_REASON: $(variables['Build.Reason'])