-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathazure-pipelines.yml
More file actions
207 lines (184 loc) · 6.83 KB
/
Copy pathazure-pipelines.yml
File metadata and controls
207 lines (184 loc) · 6.83 KB
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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
# ============================================================================
# Azure Pipelines Main Configuration
# ============================================================================
#
# This pipeline:
# 1. Builds the library across multiple platforms with a build matrix
# - Windows (x64, arm64) with MSVC
# - Linux (x64) with Clang and GCC
# 2. Runs tests on all platforms (configurable)
# 3. Publishes to NuGet and GitHub (on main/master branches)
#
# Pipeline Stages:
# 1. Windows - Cleanup, build, and test for Windows with matrix for architecture and compiler
# 2. Linux - Cleanup, build, and test for Linux with matrix for architecture and compiler
# 3. Publication - Publishes to NuGet and GitHub
#
# Documentation: See PIPELINE_DOCUMENTATION_INDEX.md for detailed information
# ============================================================================
# ============================================================================
# TRIGGER & PR CONFIGURATION
# ============================================================================
trigger:
branches:
include:
- main
- master
- development
- develop
- release/*
paths:
exclude:
- README.md
- .ci/* # Skip CI when changing pipeline files
- azure-pipelines.yml # Avoids recursive triggers when modifying the pipeline itself
pr:
branches:
include:
- main
- release/*
# ============================================================================
# RESOURCES
# ============================================================================
resources:
repositories:
- repository: self
type: git
# ============================================================================
# PARAMETERS
# ============================================================================
parameters:
- name: Architectures
type: stringList
default: [ arm64 ]
values: [ arm64, x64 ]
displayName: "Architectures to build (x64, arm64)"
- name: Platforms
type: stringList
default: [ Windows, Linux ]
values: [ Windows, Linux, Darwin ]
displayName: "Platforms to build (Windows, Linux)"
# Compiler Selection per Platform
- name: Compilers_Windows
type: stringList
default: [ MSVC ]
values: [ MSVC ]
displayName: "Windows compilers to build (MSVC)"
- name: Compilers_Linux
type: stringList
default: [ Clang, GCC ]
values: [ Clang, GCC ]
displayName: "Linux compilers to build (Clang, GCC)"
- name: Compilers_Darwin
type: stringList
default: [ Clang ]
values: [ Clang ]
displayName: "Darwin compilers to build (Clang, GCC)"
- name: BuildTypes
type: stringList
default: [ Release ]
values: [ Release, Debug ]
displayName: "Build types to build (Release, Debug)"
# Testing
- name: RunTests
type: boolean
default: true
displayName: "Run tests after building"
# Publishing
- name: PublishNuGet
type: boolean
default: false
displayName: "Publish to NuGet (auto-enabled on main/master)"
- name: PublishGitHub
type: boolean
default: false
displayName: "Create GitHub release (auto-enabled on main/master)"
# Cleanup
- name: Cleanup
type: boolean
default: false
displayName: "Cleanup only (skip builds and tests)"
# ============================================================================
# VARIABLES
# ============================================================================
variables:
# Auto-enable publishing on main/master branches
${{ if and(eq(parameters.PublishNuGet, false), or(eq(variables['Build.SourceBranch'], 'refs/heads/main'), eq(variables['Build.SourceBranch'], 'refs/heads/master'))) }}:
PublishNuGet: true
PublishGitHub: true
${{ else }}:
PublishNuGet: ${{ parameters.PublishNuGet }}
PublishGitHub: ${{ parameters.PublishGitHub }}
# System information
AgentOS: $(Agent.OS)
AgentArch: $(Agent.OSArchitecture)
# Build paths
cpmCachePath: $(Agent.HomeDirectory)/.cpmcache
buildOutputPat_h: $(System.DefaultWorkingDirectory)/build/$(cmakePreset)
testResultsPat_h: $(System.DefaultWorkingDirectory)/build/$(cmakePreset)/tests/results
# ============================================================================
# STAGES
# ============================================================================
stages:
# ==========================================================================
# STAGE 1: WINDOWS BUILD
# ==========================================================================
- stage: Windows
displayName: Windows
condition: ${{ containsValue(parameters.Platforms, 'Windows') }}
dependsOn: []
jobs:
- ${{ if eq(parameters.Cleanup, true) }}:
- template: .ci/az-cleanup-windows.yml
parameters:
displayName: "Windows Cleanup"
BuildOperatingSystem: $(Agent.OS)
CleanupDirectory: ${{ variables.cpmCachePath }}
- template: .ci/az-build-windows.yml
parameters:
displayName: "Windows Build and Test"
architectures: ${{ parameters.Architectures }}
compilers: ${{ parameters.Compilers_Windows }}
buildTypes: ${{ parameters.BuildTypes }}
runTests: ${{ parameters.RunTests }}
publishNuGet: ${{ variables.PublishNuGet }}
# ==========================================================================
# STAGE 1: LINUX BUILD
# ==========================================================================
- stage: Linux
displayName: Linux
condition: ${{ containsValue(parameters.Platforms, 'Linux') }}
dependsOn: []
jobs:
- ${{ if eq(parameters.Cleanup, true) }}:
- template: .ci/az-cleanup-linux.yml
parameters:
displayName: "Linux Cleanup"
BuildOperatingSystem: $(Agent.OS)
CleanupDirectory: ${{ variables.cpmCachePath }}
- template: .ci/az-build-linux.yml
parameters:
displayName: "Linux Build and Test"
architectures: ${{ parameters.Architectures }}
compilers: ${{ parameters.Compilers_Linux }}
buildTypes: ${{ parameters.BuildTypes }}
runTests: ${{ parameters.RunTests }}
# ==========================================================================
# STAGE 3: PUBLICATION
# ==========================================================================
- stage: Publication
displayName: Publication
dependsOn:
- Windows
- Linux
condition: and(or(eq(${{ variables.PublishGitHub }}, true), eq(${{ variables.PublishNuGet }}, true)), succeeded())
jobs:
- ${{ if eq(variables.PublishNuGet, true) }}:
- template: .ci/az-publish-nuget.yml
parameters:
displayName: NuGet Release
PublishNuGet: ${{ variables.PublishNuGet }}
- template: .ci/az-publish-github.yml
parameters:
displayName: GitHub Release
PublishGitHub: ${{ variables.PublishGitHub }}