-
Notifications
You must be signed in to change notification settings - Fork 17
/
azure-pipelines-ci.yml
104 lines (89 loc) · 3.02 KB
/
azure-pipelines-ci.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
95
96
97
98
99
100
101
102
103
# ASP.NET Core (.NET Framework)
# Build and test ASP.NET Core projects targeting the full .NET Framework.
# Add steps that publish symbols, save build artifacts, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core
name: '$(BuildDefinitionName) - $(Date:yyyy.MM.dd)$(Rev:.r)'
trigger: none
pr:
branches:
include:
- master
pool:
vmImage: 'windows-latest'
variables:
solution: '**/*.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
version.MajorMinor: '1.3'
version.Revision: $[counter(variables['version.MajorMinor'], 0)]
versionNumber: '$(version.MajorMinor).$(version.Revision)'
steps:
- task: PowerShell@2
displayName: Update the name of the build, using the generated version number.
inputs:
targetType: inline
script: |
[string] $buildName = "$(build.definitionName) - $(versionNumber)"
Write-Host "Update the build name to '$buildName'."
Write-Host "##vso[build.updatebuildnumber]$buildName"
- task: NuGetToolInstaller@1
- task: NuGetCommand@2
displayName: Restore package references
inputs:
restoreSolution: '$(solution)'
- task: VSBuild@1
displayName: Build the solution
inputs:
solution: '$(solution)'
msbuildArgs: '/p:Version=$(versionNumber) /p:SkipInvalidConfigurations=true'
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
- task: VSTest@3
displayName: Run Unit Tests
inputs:
testSelector: 'testAssemblies'
testAssemblyVer2: |
**\*UnitTests.dll
!**\*TestAdapter.dll
!**\obj\**
searchFolder: '$(System.DefaultWorkingDirectory)'
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
- task: PowerShell@2
displayName: Install Playwright Browsers
inputs:
targetType: filePath
filePath: 'FoolProof.Core.Tests.E2eTests/bin/$(buildConfiguration)/net8.0/playwright.ps1'
arguments: install --with-deps
- task: VSTest@3
displayName: Run E2E Tests
inputs:
testSelector: 'testAssemblies'
testAssemblyVer2: |
**\*E2eTests.dll
!**\*TestAdapter.dll
!**\obj\**
searchFolder: '$(System.DefaultWorkingDirectory)'
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
runSettingsFile: 'FoolProof.Core.Tests.E2eTests/test.runsettings'
overrideTestrunParameters: -StartWebApp true -WebAppPort 9090 -WebAppUrl http://localhost:9090
rerunFailedTests: true
rerunType: 'basedOnTestFailurePercentage'
rerunFailedThreshold: '50'
rerunMaxAttempts: '5'
- task: CopyFiles@2
displayName: Copy artifacts (packages) to publish
inputs:
sourceFolder: '$(Build.SourcesDirectory)\FoolProof.Core\bin\$(buildConfiguration)\'
contents: |
FoolProof.Core.*
**\FoolProof.Core.*
targetFolder: '$(Build.ArtifactStagingDirectory)'
cleanTargetFolder: true
- task: PublishBuildArtifacts@1
displayName: Publish build artifacts (packages)
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'Packages'
publishLocation: 'Container'