-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathbuild-and-test.yml
33 lines (28 loc) · 931 Bytes
/
build-and-test.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
parameters:
- name: path
type: string
- name: name
type: string
steps:
- task: Bash@3
inputs:
targetType: 'inline'
script: 'cd ${{ parameters.path }} && npm run build-test && npm run test-ci'
displayName: 'Run Build for Test and Execute tests'
- task: PublishTestResults@2
inputs:
testResultsFormat: 'JUnit'
testResultsFiles: '**/test-results.xml'
testRunTitle: ${{ parameters.name }}
condition: always()
- task: PublishCodeCoverageResults@2
inputs:
codeCoverageTool: 'Cobertura'
summaryFileLocation: '$(Build.SourcesDirectory)/${{ parameters.path }}/coverage/cobertura-coverage.xml'
pathToSources: '$(Build.SourcesDirectory)/${{ parameters.path }}'
condition: always()
- task: Bash@3
inputs:
targetType: 'inline'
script: 'cd ${{ parameters.path }} && npm run clean && npm run build-rel && rm *.ts && rm /tests -rf'
displayName: 'Run Build for Packaging'