Last active
August 25, 2021 18:06
-
-
Save i-b1/4ea78cf92c0706a3800de2ce7cb377a4 to your computer and use it in GitHub Desktop.
Azure DevOps build pipeline for Angular
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Azure DevOps build pipeline for Angular | |
variables: | |
disable.coverage.autogenerate: 'true' | |
trigger: none | |
pool: | |
vmImage: 'ubuntu-latest' | |
steps: | |
- task: NodeTool@0 | |
inputs: | |
versionSpec: '10.x' | |
displayName: 'Install Node.js' | |
- task: Npm@1 | |
displayName: 'Install Dependencies' | |
inputs: | |
command: 'install' | |
workingDir: 'src/AngularApp' | |
- task: Npm@1 | |
displayName: 'Build Angular' | |
inputs: | |
command: 'custom' | |
workingDir: 'src/AngularApp' | |
customCommand: 'run build -- --prod' | |
- task: PublishPipelineArtifact@0 | |
inputs: | |
artifactName: 'angular' | |
targetPath: 'src/AngularApp/dist' | |
- task: DeleteFiles@1 | |
displayName: 'Delete JUnit files' | |
inputs: | |
SourceFolder: src/AngularApp/junit | |
Contents: 'TEST*.xml' | |
- task: Npm@1 | |
displayName: 'Test Angular' | |
inputs: | |
command: 'custom' | |
customCommand: 'run test -- --watch=false --code-coverage --karmaConfig src/karma.conf.ci.js' | |
workingDir: 'src/AngularApp' | |
- task: PublishTestResults@2 | |
displayName: 'Publish Angular test results' | |
condition: succeededOrFailed() | |
inputs: | |
searchFolder: $(System.DefaultWorkingDirectory)/src/AngularApp/junit | |
testRunTitle: Angular | |
testResultsFormat: JUnit | |
testResultsFiles: "**/TESTS*.xml" | |
- task: PublishCodeCoverageResults@1 | |
displayName: 'Publish code coverage Angular results' | |
condition: succeededOrFailed() | |
inputs: | |
codeCoverageTool: Cobertura | |
summaryFileLocation: '$(System.DefaultWorkingDirectory)/src/AngularApp/coverage/cobertura-coverage.xml' | |
reportDirectory: '$(System.DefaultWorkingDirectory)/src/AngularApp/coverage' | |
failIfCoverageEmpty: false | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment