-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathazure-pipelines.yml
More file actions
99 lines (92 loc) · 3.11 KB
/
Copy pathazure-pipelines.yml
File metadata and controls
99 lines (92 loc) · 3.11 KB
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# Docker
# Build a Docker image
# https://docs.microsoft.com/azure/devops/pipelines/languages/docker
trigger:
- master
resources:
- repo: self
variables:
tag: '$(Build.BuildId)'
stages:
- stage: test
displayName: Test
jobs:
- job: testNode
displayName: Angular
steps:
- task: UseNode@1
inputs:
version: '12.x'
checkLatest: true
- task: Npm@1
inputs:
command: 'install'
workingDir: '$(Build.SourcesDirectory)/Platform/ClientApp'
- task: Npm@1
inputs:
command: 'custom'
customCommand: 'run test-headless'
workingDir: '$(Build.SourcesDirectory)/Platform/ClientApp'
- task: PublishCodeCoverageResults@1
displayName: 'Publish nodejs code coverage results'
condition: succeededOrFailed()
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: '$(Build.SourcesDirectory)/Platform/ClientApp/coverage/cobertura-coverage.xml'
reportDirectory: '$(Build.SourcesDirectory)/Platform/ClientApp/coverage'
failIfCoverageEmpty: true
- task: PublishTestResults@2
inputs:
testResultsFormat: 'JUnit'
testResultsFiles: '$(Build.SourcesDirectory)/Platform/ClientApp/coverage/**/RESULTS.xml'
mergeTestResults: true
failTaskOnFailedTests: true
testRunTitle: 'Angular'
- job: testDotnetCore
displayName: dotnet core
steps:
- task: UseDotNet@2
inputs:
packageType: 'sdk'
version: '3.1.x'
- task: DotNetCoreCLI@2
inputs:
command: 'test'
projects: '**/PlatformUnitTests.csproj'
testRunTitle: 'Platform Unit tests'
arguments: ' --collect:"XPlat Code Coverage"'
- task: CopyFiles@2
inputs:
SourceFolder: '$(Agent.TempDirectory)'
Contents: '**/coverage.cobertura.xml'
TargetFolder: '$(Build.SourcesDirectory)/codeCoverage'
flattenFolders: true
- script: |
dotnet tool install -g dotnet-reportgenerator-globaltool
reportgenerator -reports:"$(Build.SourcesDirectory)/codeCoverage/coverage.cobertura.xml" -targetdir:"$(Build.SourcesDirectory)/CodeCoverage" -reporttypes:"HtmlInline_AzurePipelines"
displayName: Create Code coverage report
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: 'Cobertura'
summaryFileLocation: '$(Build.SourcesDirectory)/codeCoverage/coverage.cobertura.xml'
reportDirectory: '$(Build.SourcesDirectory)/CodeCoverage'
failIfCoverageEmpty: true
- stage: Build
displayName: Build image
jobs:
- job: Build
displayName: Build
pool:
vmImage: 'ubuntu-latest'
steps:
- task: Docker@2
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
displayName: Build an image
inputs:
containerRegistry: 'docker-hub'
repository: 'atotalnoob/chatbees.platform'
command: 'buildAndPush'
Dockerfile: '**/Dockerfile'
tags: |
$(tag)
chatbees.platform