UNPKG

1.22 kBYAMLView Raw
1 # File: jobs/build.yml
2
3parameters:
4 name: ''
5 pool: ''
6 sign: false
7
8jobs:
9- job: ${{ parameters.name }}
10 pool: ${{ parameters.pool }}
11 strategy:
12 maxParallel: 3
13 matrix:
14 node-12:
15 node_version: ^12.6.0
16 node-10:
17 node_version: ^10.10.0
18 steps:
19 - task: NodeTool@0
20 displayName: " Install Node.js"
21 inputs:
22 versionSpec: $(node_version)
23 - script: git config --global user.email "example@example.com"
24 - script: git config --global user.name "Example Git User"
25 - script: npm install
26 - script: npm run build
27 - script: npm test && npm run write-coverage
28 - task: PublishTestResults@2
29 displayName: 'Publish Test Results'
30 inputs:
31 testResultsFiles: '**/junit-*.xml'
32 testRunTitle: TestRun ${{ parameters.name }} $(node_version)
33 - task: PublishCodeCoverageResults@1
34 displayName: 'Publish code coverage results'
35 inputs:
36 codeCoverageTool: 'cobertura'
37 summaryFileLocation: '**/coverage/cobertura-coverage.xml'
38 - task: PublishBuildArtifacts@1
39 displayName: Publish packages
40 condition: and(succeeded(), eq(variables['system.pullrequest.isfork'], false))
41 inputs:
42 pathtoPublish: '$(Build.ArtifactStagingDirectory)'
\No newline at end of file