79 lines
1.9 KiB
YAML
79 lines
1.9 KiB
YAML
resources:
|
|
- repo: self
|
|
trigger:
|
|
- master
|
|
- develop
|
|
pool:
|
|
vmImage: 'vs2017-win2016'
|
|
demands:
|
|
- npm
|
|
- node.js
|
|
|
|
steps:
|
|
#install node 10.x
|
|
- task: NodeTool@0
|
|
displayName: 'Use Node 10.x'
|
|
inputs:
|
|
versionSpec: 10.x
|
|
checkLatest: true
|
|
|
|
#install nodejs modules with npm
|
|
- task: Npm@1
|
|
displayName: 'npm install'
|
|
inputs:
|
|
workingDir: '$(Build.SourcesDirectory)'
|
|
verbose: false
|
|
|
|
#start unit tests
|
|
- task: Npm@1
|
|
displayName: 'npm test'
|
|
inputs:
|
|
command: custom
|
|
customCommand: 'test'
|
|
workingDir: '$(Build.SourcesDirectory)'
|
|
verbose: false
|
|
|
|
# Publish Test Results to Azure Pipelines/TFS
|
|
- task: PublishTestResults@2
|
|
inputs:
|
|
testResultsFiles: 'temp/test/junit/junit.xml'
|
|
searchFolder: '$(Build.SourcesDirectory)'
|
|
|
|
# publish coverage test results
|
|
- task: PublishCodeCoverageResults@1
|
|
displayName: 'Publish Code Coverage Results $(Build.SourcesDirectory)/temp/test/cobertura-coverage.xml'
|
|
inputs:
|
|
codeCoverageTool: Cobertura
|
|
summaryFileLocation: '$(Build.SourcesDirectory)/temp/test/cobertura-coverage.xml'
|
|
reportDirectory: '$(Build.SourcesDirectory)/temp/test/'
|
|
|
|
#bundle code with gulp
|
|
- task: Gulp@0
|
|
displayName: 'gulp bundle'
|
|
inputs:
|
|
gulpFile: '$(Build.SourcesDirectory)/gulpfile.js'
|
|
targets: bundle
|
|
arguments: '--ship'
|
|
continueOnError: true
|
|
|
|
#package solution with gulp
|
|
- task: Gulp@0
|
|
displayName: 'gulp package-solution'
|
|
inputs:
|
|
gulpFile: '$(Build.SourcesDirectory)/gulpfile.js'
|
|
targets: 'package-solution'
|
|
arguments: '--ship'
|
|
|
|
#copy files to artifact repository
|
|
- task: CopyFiles@2
|
|
displayName: 'Copy Files to: $(build.artifactstagingdirectory)/drop'
|
|
inputs:
|
|
Contents: '**\*.sppkg'
|
|
TargetFolder: '$(build.artifactstagingdirectory)/drop'
|
|
|
|
#publish artifacts
|
|
- task: PublishBuildArtifacts@1
|
|
displayName: 'Publish Artifact: drop'
|
|
inputs:
|
|
PathtoPublish: '$(build.artifactstagingdirectory)/drop'
|