-
Notifications
You must be signed in to change notification settings - Fork 3
/
azure-pipelines-tests.yml
52 lines (47 loc) · 1.66 KB
/
azure-pipelines-tests.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# Azure Pipelines for .NET Core app (Web, Function, ....) :)
# More info: https://docs.microsoft.com/en-us/azure/devops/pipelines/?view=vsts
parameters:
Name: 'UnitTests'
RestoreBuildProjects: '**/*Tests.csproj'
BuildConfiguration: 'Release'
WorkingDirectory: 'Src'
PublishWebApp: False
ArtifactName: 'Unit-Tests'
ZipAfterPublish: False
jobs:
- job: ${{ Parameters.Name }}
pool:
vmImage: 'ubuntu-16.04'
demands: npm
steps:
- task: qetza.replacetokens.replacetokens-task.replacetokens@3
displayName: 'Replace tokens in *.cs'
inputs:
rootDirectory: '${{ Parameters.WorkingDirectory }}'
targetFiles: '**/*Constants.cs'
- task: DotNetCoreCLI@2
displayName: Restore
inputs:
command: restore
projects: ${{ Parameters.RestoreBuildProjects }}
- task: DotNetCoreCLI@2
displayName: test
inputs:
command: test
projects: ${{ Parameters.RestoreBuildProjects }}
arguments: '--configuration ${{ Parameters.BuildConfiguration }}'
- task: DotNetCoreCLI@2
displayName: Publish
inputs:
command: publish
publishWebProjects: ${{ Parameters.PublishWebApp }}
arguments: '--configuration ${{ Parameters.BuildConfiguration }} --output $(build.artifactstagingdirectory)'
projects: ${{ Parameters.RestoreBuildProjects }}
zipAfterPublish: ${{ Parameters.ZipAfterPublish }}
workingDirectory: ${{ Parameters.WorkingDirectory }}
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: ${{ Parameters.ArtifactName }}'
inputs:
PathtoPublish: '$(build.artifactstagingdirectory)'
ArtifactName: ${{ Parameters.ArtifactName }}
zipAfterPublish: True