-
Notifications
You must be signed in to change notification settings - Fork 158
/
Copy pathpipeline.yml
282 lines (266 loc) · 8.3 KB
/
pipeline.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
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
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
# yaml-language-server: $schema=https://raw.githubusercontent.com/buildkite/pipeline-schema/main/schema.json
env:
VAULT_PATH: "kv/ci-shared/observability-ingest/cloud/gcp"
DOCKER_REGISTRY: "docker.elastic.co"
steps:
- label: "check-ci"
key: "check-ci"
command: ".buildkite/scripts/steps/check-ci.sh"
agents:
provider: "gcp"
image: "family/core-ubuntu-2204"
retry:
manual:
allowed: true
- group: "Unit tests"
key: "unit-tests"
steps:
- label: "Unit tests - Ubuntu 22.04"
key: "unit-tests-2204"
command: ".buildkite/scripts/steps/unit-tests.sh"
artifact_paths:
- "build/TEST-go-unit.html"
- "build/TEST-go-unit.xml"
- "build/diagnostics/*"
- "coverage.out"
agents:
provider: "gcp"
image: "family/core-ubuntu-2204"
retry:
manual:
allowed: true
- label: "Unit tests - Ubuntu 22.04 ARM64"
key: "unit-tests-2204-arm64"
command: ".buildkite/scripts/steps/unit-tests.sh"
artifact_paths:
- "build/TEST-go-unit.html"
- "build/TEST-go-unit.xml"
- "build/diagnostics/*"
- "coverage.out"
agents:
provider: "aws"
imagePrefix: "core-ubuntu-2204-aarch64"
diskSizeGb: 200
instanceType: "m6g.xlarge"
retry:
manual:
allowed: true
- label: "Unit tests - Windows 2022"
key: "unit-tests-win2022"
command: ".\\.buildkite\\scripts\\steps\\unit-tests.ps1"
artifact_paths:
- "build/TEST-go-unit.html"
- "build/TEST-go-unit.xml"
- "build/diagnostics/*"
- "coverage.out"
agents:
provider: "gcp"
image: "family/core-windows-2022"
machine_type: "n2-standard-8"
disk_size: 200
disk_type: "pd-ssd"
retry:
manual:
allowed: true
- label: "Unit tests - Windows 2016"
key: "unit-tests-win2016"
command: ".\\.buildkite\\scripts\\steps\\unit-tests.ps1"
artifact_paths:
- "build/TEST-go-unit.html"
- "build/TEST-go-unit.xml"
- "build/diagnostics/*"
- "coverage.out"
agents:
provider: "gcp"
image: "family/core-windows-2016"
machine_type: "n2-standard-8"
disk_size: 200
disk_type: "pd-ssd"
retry:
manual:
allowed: true
# Runs inly on the main branch
- label: "Unit tests - MacOS 13 ARM"
key: "unit-tests-macos-13-arm"
command: ".buildkite/scripts/steps/unit-tests.sh"
branches: main
artifact_paths:
- "build/TEST-go-unit.html"
- "build/TEST-go-unit.xml"
- "build/diagnostics/*"
- "coverage.out"
agents:
provider: orka
imagePrefix: generic-13-ventura-arm
retry:
manual:
allowed: true
- label: "Unit tests - MacOS 13"
key: "unit-tests-macos-13"
command: ".buildkite/scripts/steps/unit-tests.sh"
artifact_paths:
- "build/TEST-go-unit.html"
- "build/TEST-go-unit.xml"
- "build/diagnostics/*"
- "coverage.out"
agents:
provider: orka
imagePrefix: generic-13-ventura-x64
retry:
manual:
allowed: true
- group: "Desktop Windows tests"
key: "extended-windows"
steps:
- label: "Unit tests - Windows 10"
key: "unit-tests-win10"
command: ".\\.buildkite\\scripts\\steps\\unit-tests.ps1"
artifact_paths:
- "build/TEST-go-unit.html"
- "build/TEST-go-unit.xml"
- "build/diagnostics/*"
- "coverage.out"
agents:
provider: "gcp"
# TODO create own image
image: "family/general-windows-10"
machine_type: "n2-standard-8"
disk_type: "pd-ssd"
retry:
manual:
allowed: true
- label: "Unit tests - Windows 11"
key: "unit-tests-win11"
command: ".\\.buildkite\\scripts\\steps\\unit-tests.ps1"
artifact_paths:
- "build/TEST-go-unit.html"
- "build/TEST-go-unit.xml"
- "build/diagnostics/*"
- "coverage.out"
agents:
provider: "gcp"
# TODO create own image
image: "family/general-windows-11"
machine_type: "n2-standard-8"
disk_type: "pd-ssd"
retry:
manual:
allowed: true
- label: "Merge coverage reports"
key: "merge-coverage"
env:
BUILDKITE_REPO: ""
command: "
.buildkite/scripts/steps/merge.sh
unit-tests-2204
unit-tests-2204-arm64
unit-tests-win2016
unit-tests-win2022
unit-tests-macos-13
unit-tests-win10
unit-tests-win11
"
artifact_paths:
- "build/TEST-go-unit.cov"
agents:
image: "golang:1.20.10"
depends_on:
- unit-tests
- extended-windows
allow_dependency_failure: true
- group: "K8s tests"
key: "k8s-tests"
steps:
- label: "K8s tests: {{matrix.k8s_version}}"
env:
K8S_VERSION: "v{{matrix.k8s_version}}"
KIND_VERSION: "v0.20.0"
command: ".buildkite/scripts/steps/k8s-tests.sh"
agents:
provider: "gcp"
image: "family/core-ubuntu-2204"
matrix:
setup:
k8s_version:
- "1.29.0"
- "1.28.0"
- "1.27.3"
- "1.26.6"
retry:
manual:
allowed: true
- label: ":sonarqube: Continuous Code Inspection"
env:
VAULT_SONAR_TOKEN_PATH: "kv/ci-shared/platform-ingest/elastic/elastic-agent/sonar-analyze-token"
agents:
image: "docker.elastic.co/cloud-ci/sonarqube/buildkite-scanner:latest"
command:
- "buildkite-agent artifact download --step merge-coverage build/TEST-go-unit.cov ."
- "/scan-source-code.sh"
depends_on:
- "merge-coverage"
retry:
manual:
allowed: true
# Triggers a dynamic step: Sync K8s
# Runs only on main and if k8s files are changed
- label: "Trigger k8s sync"
branches: main
plugins:
- monebag/monorepo-diff#v2.5.9:
diff: "git diff --name-only HEAD~1"
watch:
- path:
- deploy/kubernetes/*
- version/docs/version.asciidoc
config:
label: "Sync K8s"
command: ".buildkite/scripts/steps/sync-k8s.sh"
agents:
provider: "gcp"
image: "family/core-ubuntu-2204"
env:
- GH_VERSION=2.4.0
# Trigger for pull requests
- label: "Trigger Integration tests for Pull request"
if: |
(build.pull_request.id != null && !build.env("GITHUB_PR_LABELS") =~ /skip-it/) ||
build.env("GITHUB_PR_TRIGGER_COMMENT") =~ /.*extended.*/
plugins:
- monorepo-diff#v1.0.1:
diff: "git diff --name-only origin/${GITHUB_PR_TARGET_BRANCH}...HEAD"
watch:
- path:
- internal/
- dev-tools/
- pkg/
- testing/
- version/
- specs/
- .agent-versions.json
- .go-version
- .package-version
- go.mod
- go.sum
- magefile.go
- main.go
- .buildkite/integration.pipeline.yml
- .buildkite/pipeline.yml
- .buildkite/scripts/
- .buildkite/hooks/
config:
trigger: "elastic-agent-extended-testing"
build:
commit: "${BUILDKITE_COMMIT}"
branch: "${BUILDKITE_BRANCH}"
env:
- BUILDKITE_PULL_REQUEST=${BUILDKITE_PULL_REQUEST}
- BUILDKITE_PULL_REQUEST_BASE_BRANCH=${BUILDKITE_PULL_REQUEST_BASE_BRANCH}
- GITHUB_PR_LABELS=${GITHUB_PR_LABELS}
# Trigger for branches
- label: "Triggering Integration tests for branches"
if: build.pull_request.id == null
trigger: "elastic-agent-extended-testing"
build:
commit: "${BUILDKITE_COMMIT}"
branch: "${BUILDKITE_BRANCH}"