-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
73 lines (65 loc) · 2.69 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
# ASP.NET Core
# Build and test ASP.NET Core projects targeting .NET Core.
# Add steps that run tests, create a NuGet package, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core
jobs:
- job: Windows
pool:
vmImage: 'vs2017-win2016'
variables:
buildConfiguration: 'Release'
steps:
#- script: |
# pwsh -c '.\UpdateBuildVersion.ps1'
# displayName: 'Build and Test'
- task: gittools.gitversion.gitversion-task.GitVersion@4
displayName: GitVersion
inputs:
updateAssemblyInfo: true
preferBundledVersion: false
- task: SonarSource.sonarcloud.14d9cde6-c1da-4d55-aa01-2965cd301255.SonarCloudPrepare@1
displayName: 'Prepare analysis on SonarCloud'
inputs:
SonarCloud: SonarCloud.io
organization: 'brandonboone-github'
projectKey: 'BrandonBoone_Spritey'
projectName: Spritey
projectVersion: '$(GitVersion.SemVer)'
- script: dotnet restore Spritey.sln
displayName: Restore Spritey.sln
- script: dotnet build ./src/Spritey/Spritey.csproj
displayName: Build Spritey.sln
- task: NuGetCommand@2
displayName: Restore Code Coverage Artifacts
inputs:
command: restore
restoreSolution: './tests/CodeCoverage/packages.config'
restoreDirectory: 'packages'
- script: tests\CodeCoverage\packages\OpenCover.4.6.519\tools\OpenCover.Console.exe -target:"dotnet.exe" -targetargs:"test tests\Spritey.Test\Spritey.Test.csproj -c Release -f netcoreapp2.1 /p:codecov=true" -register:user -threshold:10 -oldStyle -safemode:off -output:.\Spritey.Coverage.xml -hideskipped:All -returntargetcode
displayName: Run Tests and Generate Coverage Report
- script: tests\CodeCoverage\packages\Codecov.1.1.0\tools\codecov.exe -f Spritey.Coverage.xml -t $(CODECOV_TOKEN)
displayName: Publish Coverage Results to CodeCov
- task: SonarSource.sonarcloud.ce096e50-6155-4de8-8800-4221aaeed4a1.SonarCloudAnalyze@1
displayName: 'Run Code Analysis'
- job: Linux
pool:
vmImage: 'Ubuntu 16.04'
variables:
buildConfiguration: 'Release'
steps:
# - task: gittools.gitversion.gitversion-task.GitVersion@4
# displayName: GitVersion
# inputs:
# updateAssemblyInfo: true
# preferBundledVersion: false
- script: dotnet restore Spritey.sln
displayName: Restore Spritey.sln
- script: dotnet build ./src/Spritey/Spritey.csproj
displayName: Build Spritey.sln
- script: dotnet test ./tests/Spritey.Test/Spritey.Test.csproj --configuration $(buildConfiguration) --framework netcoreapp2.1 --logger trx
displayName: Run Tests and Generate Report
- task: PublishTestResults@2
displayName: Publish Test Report
inputs:
testRunner: VSTest
testResultsFiles: '**/*.trx'