forked from Kieranties/SimpleVersion
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
136 lines (120 loc) · 3.36 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
# Build pipeline for Azure Devops
trigger:
branches:
include:
- master
- release/*
paths:
exclude:
- .github/*
- README.md
pr:
- master
- release/*
variables:
TreatWarningsAsErrors: true
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
Configuration: Release
ArtifactsPath: $(Build.ArtifactStagingDirectory)
disable.coverage.autogenerate: true
jobs:
- job: 'build_test_pack'
displayName: "Core Build"
pool:
vmImage: windows-latest
steps:
# Build
- pwsh: ./build.ps1 -ArtifactsPath $(ArtifactsPath) -Configuration $(Configuration)
displayName: 'Build and Test'
# Publish test results
- task: PublishTestResults@2
displayName: 'Tests: Publish unit tests'
condition: succeededOrFailed()
inputs:
testRunTitle: Unit Tests
testResultsFormat: VSTest
testResultsFiles: '$(ArtifactsPath)/**/*.trx'
# Publish coverage
- task: PublishCodeCoverageResults@1
displayName: "Tests: Publish unit test coverage"
condition: succeededOrFailed()
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: '$(ArtifactsPath)/**/*.cobertura.xml'
reportDirectory: '$(ArtifactsPath)/tests/coveragereport'
# Quality check the build
- task: BuildQualityChecks@6
displayName: 'Checks: Quality'
inputs:
checkWarnings: true
warningFailOption: 'fixed'
warningThreshold: '0'
showStatistics: true
checkCoverage: true
coverageFailOption: 'fixed'
coverageType: 'branches'
coverageThreshold: '90'
# Handle artifacts
- publish: $(ArtifactsPath)/docs/site
displayName: "Artifacts: Publish Docs"
condition: succeeded()
artifact: docs
- publish: $(ArtifactsPath)/dist
displayName: "Artifacts: Publish Dist"
condition: succeeded()
artifact: dist
- task: NuGetCommand@2
displayName: "Artifacts: Push Packages"
condition: and(succeeded(), ne(variables['build.reason'], 'PullRequest'))
inputs:
command: push
packagesToPush: $(ArtifactsPath)/**/*.nupkg
nuGetFeedType: internal
publishVstsFeed: SimpleVersion
feedsToUse: nuget.config
- job: 'acceptance'
displayName: "Acceptance Test"
dependsOn: build_test_pack
pool:
vmImage: ubuntu-latest
variables:
DOCKER_BUILDKIT: 1
strategy:
matrix:
alpine-3.14:
tag: 3.1-alpine3.14
os: alpine
# TODO: Missing assets in libgit 27 to support alpine
# https://github.com/Kieranties/SimpleVersion/issues/149
# alpine-3.15:
# tag: 3.1-alpine3.15
# os: alpine
ubuntu-20.04:
tag: 3.1-focal
os: ubuntu
ubuntu-18.04:
tag: 3.1-bionic
os: ubuntu
debian-10:
tag: 3.1-buster
os: debian
debian-11:
tag: 3.1-bullseye
os: debian
steps:
- download: current
artifact: dist
# Run acceptance tests
- pwsh: ./acceptance.ps1 -ArtifactsPath $(Pipeline.Workspace) $(tag) $(os)
displayName: 'Tests: Run acceptance tests'
# Publish acceptance results
- task: PublishTestResults@2
displayName: 'Tests: Publish acceptance tests'
condition: succeededOrFailed()
inputs:
testRunTitle: Acceptance Tests [$(tag)]
testResultsFormat: NUnit
testResultsFiles: '$(Pipeline.Workspace)/**/$(tag).xml'
failTaskOnFailedTests: true
# TODO - Jobs for Integration testing