-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
94 lines (80 loc) · 2.76 KB
/
azure-pipelines.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
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
# ASP.NET
# Build and test ASP.NET projects.
# Add steps that publish symbols, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/apps/aspnet/build-aspnet-4
trigger:
- development
pool:
vmImage: 'ubuntu-latest'
variables:
tests: '**/*Test/*.csproj'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
ApplicationFolder: 'Application'
EFMigrationFolder: 'EFMigrations'
steps:
- script: |
echo "tests = $(tests)"
echo "Build.SourcesDirectory = $(Build.SourcesDirectory)"
echo "Build.SourcesDirectory = $(Build.SourcesDirectory)"
echo "Agent.TempDirectory = $(Agent.TempDirectory)"
- task: UseDotNet@2
displayName: 'Install .NET Core SDK'
inputs:
version: 8.x
- task: DotNetCoreCLI@2
displayName: New Manifest for tool
inputs:
command: custom
custom: new
arguments: tool-manifest
- task: DotNetCoreCLI@2
displayName: Install EF Tool
inputs:
command: custom
custom: tool
arguments: install dotnet-ef
- task: DotNetCoreCLI@2
displayName: 'Build'
inputs:
command: 'build'
projects: |
**/*.csproj
!**/*CodeGeneration.csproj
arguments: '--configuration $(BuildConfiguration)'
- task: DotNetCoreCLI@2
displayName: 'Run Tests'
inputs:
command: test
arguments: '--configuration $(buildConfiguration) --collect:"XPlat Code Coverage" -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=cobertura'
publishTestResults: true
projects: $(tests)
- task: PublishCodeCoverageResults@2
displayName: 'Test Coverage report'
inputs:
summaryFileLocation: '$(Agent.TempDirectory)/**/coverage.cobertura.xml'
- task: DotNetCoreCLI@2
displayName: 'Create EF Core Bundle'
inputs:
command: custom
custom: 'ef'
arguments: migrations bundle --self-contained -r win-x64 --output $(Build.ArtifactStagingDirectory)/$(EFMigrationFolder)/efbundle.exe --project $(Build.SourcesDirectory)/src/Abm.Pyro.Repository/Abm.Pyro.Repository.csproj --context PyroDbContext
- task: DotNetCoreCLI@2
displayName: Publish
inputs:
command: publish
publishWebProjects: True
arguments: '--configuration $(BuildConfiguration) --runtime linux-x64 --self-contained true --output $(Build.ArtifactStagingDirectory)/$(ApplicationFolder)'
zipAfterPublish: true
- task: PublishBuildArtifacts@1
displayName: 'Publish Application Artifacts'
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)/$(ApplicationFolder)'
ArtifactName: Application
publishLocation: Container
- task: PublishBuildArtifacts@1
displayName: 'Publish EF Migration Artifacts'
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)/$(EFMigrationFolder)'
ArtifactName: EFMigrations
publishLocation: Container