forked from DotNetAnalyzers/StyleCopAnalyzers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
74 lines (67 loc) · 2.07 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
pool:
name: Azure Pipelines
vmImage: windows-latest
demands:
- msbuild
- visualstudio
- vstest
jobs:
- job: Build
variables:
BuildSolution: StyleCopAnalyzers.sln
BuildPlatform: Any CPU
strategy:
matrix:
Debug:
BuildConfiguration: Debug
_debugArg: '-Debug'
Release:
BuildConfiguration: Release
_debugArg: ''
steps:
- task: NuGetToolInstaller@0
displayName: 'Use NuGet 5.3.1'
inputs:
versionSpec: 5.3.1
- task: NuGetCommand@2
displayName: 'NuGet restore'
inputs:
restoreSolution: '$(BuildSolution)'
feedsToUse: 'config'
nugetConfigPath: 'NuGet.config'
- task: VSBuild@1
displayName: 'Build solution StyleCopAnalyzers.sln'
inputs:
solution: '$(BuildSolution)'
platform: '$(BuildPlatform)'
configuration: '$(BuildConfiguration)'
msbuildArgs: '/bl:$(Build.SourcesDirectory)/msbuild.binlog'
- task: PowerShell@2
displayName: Run Tests
inputs:
workingDirectory: '$(Build.SourcesDirectory)/build'
filePath: build/opencover-report.ps1
arguments: '$(_debugArg) -NoBuild -NoReport -Azure'
- task: PublishTestResults@2
displayName: Publish test results
inputs:
testResultsFormat: xUnit
testResultsFiles: 'build/*.xml'
mergeTestResults: true
testRunTitle: '$(BuildConfiguration)'
- task: PowerShell@2
displayName: Upload coverage reports to codecov.io
condition: eq(variables['BuildConfiguration'], 'Debug')
inputs:
workingDirectory: '$(Build.SourcesDirectory)/build'
targetType: inline
script: |
$packageConfig = [xml](Get-Content ..\.nuget\packages.config)
$codecov_version = $packageConfig.SelectSingleNode('/packages/package[@id="Codecov"]').version
$codecov = "..\packages\Codecov.$codecov_version\tools\codecov.exe"
&$codecov -f '..\build\OpenCover.Reports\OpenCover.StyleCopAnalyzers.xml' --required
- task: PublishBuildArtifacts@1
displayName: Publish build logs
inputs:
pathtoPublish: msbuild.binlog
condition: failed()