13
13
CI_ENVIRONMENT : normal
14
14
15
15
jobs :
16
+ Get-CI-Image-Tag :
17
+ uses : opensearch-project/opensearch-build/.github/workflows/get-ci-image-tag.yml@main
18
+ with :
19
+ product : opensearch
20
+
16
21
generate-test-list :
17
22
runs-on : ubuntu-latest
18
23
outputs :
48
53
run : |
49
54
./gradlew clean \
50
55
:opensearch-resource-sharing-spi:publishToMavenLocal \
51
- :opensearch-security-common:publishToMavenLocal \
52
56
:opensearch-security-client:publishToMavenLocal \
53
57
-Dbuild.snapshot=false
54
58
@@ -60,14 +64,14 @@ jobs:
60
64
restore-keys : |
61
65
maven-local-
62
66
63
- test :
67
+ test-windows :
64
68
name : test
65
69
needs : [generate-test-list, publish-components-to-maven-local]
66
70
strategy :
67
71
fail-fast : false
68
72
matrix :
69
73
gradle_task : ${{ fromJson(needs.generate-test-list.outputs.separateTestsNames) }}
70
- platform : [windows-latest, ubuntu-latest ]
74
+ platform : [windows-latest]
71
75
jdk : [21]
72
76
runs-on : ${{ matrix.platform }}
73
77
81
85
- name : Checkout security
82
86
uses : actions/checkout@v4
83
87
88
+ - name : Build and Test
89
+ uses : gradle/gradle-build-action@v3
90
+ with :
91
+ cache-disabled : true
92
+ arguments : |
93
+ ${{ matrix.gradle_task }} -Dbuild.snapshot=false
94
+
95
+ - uses : actions/upload-artifact@v4
96
+ if : always()
97
+ with :
98
+ name : ${{ matrix.platform }}-JDK${{ matrix.jdk }}-${{ matrix.gradle_task }}-reports
99
+ path : |
100
+ ./build/reports/
101
+
102
+ test-linux :
103
+ name : test
104
+ needs : ["generate-test-list", "Get-CI-Image-Tag"]
105
+ strategy :
106
+ fail-fast : false
107
+ matrix :
108
+ gradle_task : ${{ fromJson(needs.generate-test-list.outputs.separateTestsNames) }}
109
+ platform : [ubuntu-latest]
110
+ jdk : [21]
111
+ runs-on : ubuntu-latest
112
+ container :
113
+ # using the same image which is used by opensearch-build to build the OpenSearch Distribution
114
+ # this image tag is subject to change as more dependencies and updates will arrive over time
115
+ image : ${{ needs.Get-CI-Image-Tag.outputs.ci-image-version-linux }}
116
+ # need to switch to root so that github actions can install runner binary on container without permission issues.
117
+ options : ${{ needs.Get-CI-Image-Tag.outputs.ci-image-start-options }}
118
+
119
+ steps :
120
+ - name : Run start commands
121
+ run : ${{ needs.Get-CI-Image-Tag.outputs.ci-image-start-command }}
122
+
123
+ - name : Set up JDK for build and test
124
+ uses : actions/setup-java@v4
125
+ with :
126
+ distribution : temurin # Temurin is a distribution of adoptium
127
+ java-version : ${{ matrix.jdk }}
128
+
129
+ - name : Checkout security
130
+ uses : actions/checkout@v4
131
+
84
132
- name : Restore Maven Local Cache
85
133
86
134
with :
@@ -104,7 +152,7 @@ jobs:
104
152
./build/reports/
105
153
106
154
report-coverage :
107
- needs : ["test", "integration-tests", "spi-tests", "sample-plugin-integration-tests"]
155
+ needs : ["test-windows ", "test-linux", " integration-tests-windows ", "integration-tests-linux", " spi-tests-linux ", "spi-tests-windows", " sample-plugin-integration-tests-linux", "sample-plugin-integration-tests-windows "]
108
156
runs-on : ubuntu-latest
109
157
steps :
110
158
- uses : actions/checkout@v4
@@ -127,13 +175,13 @@ jobs:
127
175
fail_ci_if_error: true
128
176
verbose: true
129
177
130
- integration-tests :
178
+ integration-tests-windows :
131
179
name : integration-tests
132
180
strategy :
133
181
fail-fast : false
134
182
matrix :
135
183
jdk : [21]
136
- platform : [ubuntu-latest, windows-latest]
184
+ platform : [windows-latest]
137
185
runs-on : ${{ matrix.platform }}
138
186
139
187
steps :
@@ -168,7 +216,100 @@ jobs:
168
216
path : |
169
217
./build/reports/
170
218
171
- sample-plugin-integration-tests :
219
+ integration-tests-linux :
220
+ name : integration-tests
221
+ needs : ["Get-CI-Image-Tag"]
222
+ strategy :
223
+ fail-fast : false
224
+ matrix :
225
+ jdk : [21]
226
+ platform : [ubuntu-latest]
227
+ runs-on : ubuntu-latest
228
+ container :
229
+ # using the same image which is used by opensearch-build team to build the OpenSearch Distribution
230
+ # this image tag is subject to change as more dependencies and updates will arrive over time
231
+ image : ${{ needs.Get-CI-Image-Tag.outputs.ci-image-version-linux }}
232
+ # need to switch to root so that github actions can install runner binary on container without permission issues.
233
+ options : ${{ needs.Get-CI-Image-Tag.outputs.ci-image-start-options }}
234
+
235
+ steps :
236
+ - name : Run start commands
237
+ run : ${{ needs.Get-CI-Image-Tag.outputs.ci-image-start-command }}
238
+
239
+ - name : Set up JDK for build and test
240
+ uses : actions/setup-java@v4
241
+ with :
242
+ distribution : temurin # Temurin is a distribution of adoptium
243
+ java-version : ${{ matrix.jdk }}
244
+
245
+ - name : Checkout security
246
+ uses : actions/checkout@v4
247
+
248
+ - name : Build and Test
249
+ uses : gradle/gradle-build-action@v3
250
+ with :
251
+ cache-disabled : true
252
+ arguments : |
253
+ integrationTest -Dbuild.snapshot=false
254
+
255
+ - uses : actions/upload-artifact@v4
256
+ if : always()
257
+ with :
258
+ name : integration-${{ matrix.platform }}-JDK${{ matrix.jdk }}-reports
259
+ path : |
260
+ ./build/reports/
261
+
262
+ sample-plugin-integration-tests-linux :
263
+ name : sample-plugin-integration-tests
264
+ needs : [ "Get-CI-Image-Tag", publish-components-to-maven-local ]
265
+ strategy :
266
+ fail-fast : false
267
+ matrix :
268
+ jdk : [ 21 ]
269
+ platform : [ ubuntu-latest ]
270
+ runs-on : ubuntu-latest
271
+ container :
272
+ # using the same image which is used by opensearch-build team to build the OpenSearch Distribution
273
+ # this image tag is subject to change as more dependencies and updates will arrive over time
274
+ image : ${{ needs.Get-CI-Image-Tag.outputs.ci-image-version-linux }}
275
+ # need to switch to root so that github actions can install runner binary on container without permission issues.
276
+ options : ${{ needs.Get-CI-Image-Tag.outputs.ci-image-start-options }}
277
+
278
+ steps :
279
+ - name : Run start commands
280
+ run : ${{ needs.Get-CI-Image-Tag.outputs.ci-image-start-command }}
281
+
282
+ - name : Set up JDK for build and test
283
+ uses : actions/setup-java@v4
284
+ with :
285
+ distribution : temurin # Temurin is a distribution of adoptium
286
+ java-version : ${{ matrix.jdk }}
287
+
288
+ - name : Checkout security
289
+ uses : actions/checkout@v4
290
+
291
+ - name : Restore Maven Local Cache
292
+
293
+ with :
294
+ path : ~/.m2/repository/org/opensearch/
295
+ key : maven-local-${{ github.run_id }}
296
+ restore-keys : |
297
+ maven-local-
298
+
299
+ - name : Run SampleResourcePlugin Integration Tests
300
+ uses : gradle/gradle-build-action@v3
301
+ with :
302
+ arguments : |
303
+ :opensearch-sample-resource-plugin:integrationTest -Dbuild.snapshot=false
304
+
305
+ - uses : actions/upload-artifact@v4
306
+ if : always()
307
+ with :
308
+ name : sample-plugin-integration-${{ matrix.platform }}-JDK${{ matrix.jdk }}-reports
309
+ path : |
310
+ ./build/reports/
311
+
312
+ sample-plugin-integration-tests-windows :
172
313
name : sample-plugin-integration-tests
173
314
needs : publish-components-to-maven-local
174
315
strategy :
@@ -209,14 +350,65 @@ jobs:
209
350
path : |
210
351
./build/reports/
211
352
212
- spi-tests :
353
+ spi-tests-linux :
354
+ name : spi-tests
355
+ needs : ["Get-CI-Image-Tag", publish-components-to-maven-local]
356
+ strategy :
357
+ fail-fast : false
358
+ matrix :
359
+ jdk : [21]
360
+ platform : [ubuntu-latest]
361
+ runs-on : ${{ matrix.platform }}
362
+ container :
363
+ # using the same image which is used by opensearch-build to build the OpenSearch Distribution
364
+ # this image tag is subject to change as more dependencies and updates will arrive over time
365
+ image : ${{ needs.Get-CI-Image-Tag.outputs.ci-image-version-linux }}
366
+ # need to switch to root so that github actions can install runner binary on container without permission issues.
367
+ options : ${{ needs.Get-CI-Image-Tag.outputs.ci-image-start-options }}
368
+
369
+ steps :
370
+ - name : Run start commands
371
+ run : ${{ needs.Get-CI-Image-Tag.outputs.ci-image-start-command }}
372
+
373
+ - name : Set up JDK for build and test
374
+ uses : actions/setup-java@v4
375
+ with :
376
+ distribution : temurin # Temurin is a distribution of adoptium
377
+ java-version : ${{ matrix.jdk }}
378
+
379
+ - name : Checkout security
380
+ uses : actions/checkout@v4
381
+
382
+ - name : Restore Maven Local Cache
383
+
384
+ with :
385
+ path : ~/.m2/repository/org/opensearch/
386
+ key : maven-local-${{ github.run_id }}
387
+ restore-keys : |
388
+ maven-local-
389
+
390
+ - name : Run SPI Tests
391
+ uses : gradle/gradle-build-action@v3
392
+ with :
393
+ cache-disabled : true
394
+ arguments : |
395
+ :opensearch-resource-sharing-spi:test -Dbuild.snapshot=false
396
+
397
+ - uses : actions/upload-artifact@v4
398
+ if : always()
399
+ with :
400
+ name : spi-${{ matrix.platform }}-JDK${{ matrix.jdk }}-reports
401
+ path : |
402
+ ./build/reports/
403
+
404
+ spi-tests-windows :
213
405
name : spi-tests
214
406
needs : publish-components-to-maven-local
215
407
strategy :
216
408
fail-fast : false
217
409
matrix :
218
410
jdk : [21]
219
- platform : [ubuntu-latest, windows-latest]
411
+ platform : [windows-latest]
220
412
runs-on : ${{ matrix.platform }}
221
413
222
414
steps :
@@ -378,57 +570,41 @@ jobs:
378
570
./gradlew clean :opensearch-resource-sharing-spi:publishToMavenLocal -Dbuild.snapshot=false -Dbuild.version_qualifier=$test_qualifier && test -s ./spi/build/libs/opensearch-resource-sharing-spi-$security_plugin_version_only_number-$test_qualifier-all.jar
379
571
./gradlew clean :opensearch-resource-sharing-spi:publishToMavenLocal -Dbuild.version_qualifier=$test_qualifier && test -s ./spi/build/libs/opensearch-resource-sharing-spi-$security_plugin_version_only_number-$test_qualifier-SNAPSHOT-all.jar
380
572
381
- # Publish Common
382
- ./gradlew clean :opensearch-security-common:publishToMavenLocal && test -s ./common/build/libs/opensearch-security-common-$security_plugin_version-all.jar
383
- ./gradlew clean :opensearch-security-common:publishToMavenLocal -Dbuild.snapshot=false && test -s ./common/build/libs/opensearch-security-common-$security_plugin_version_no_snapshot-all.jar
384
- ./gradlew clean :opensearch-security-common:publishToMavenLocal -Dbuild.snapshot=false -Dbuild.version_qualifier=$test_qualifier && test -s ./common/build/libs/opensearch-security-common-$security_plugin_version_only_number-$test_qualifier-all.jar
385
- ./gradlew clean :opensearch-security-common:publishToMavenLocal -Dbuild.version_qualifier=$test_qualifier && test -s ./common/build/libs/opensearch-security-common-$security_plugin_version_only_number-$test_qualifier-SNAPSHOT-all.jar
386
-
387
573
# Publish Client
388
574
./gradlew clean :opensearch-security-client:publishToMavenLocal && test -s ./client/build/libs/opensearch-security-client-$security_plugin_version-all.jar
389
575
./gradlew clean :opensearch-security-client:publishToMavenLocal -Dbuild.snapshot=false && test -s ./client/build/libs/opensearch-security-client-$security_plugin_version_no_snapshot-all.jar
390
576
./gradlew clean :opensearch-security-client:publishToMavenLocal -Dbuild.snapshot=false -Dbuild.version_qualifier=$test_qualifier && test -s ./client/build/libs/opensearch-security-client-$security_plugin_version_only_number-$test_qualifier-all.jar
391
577
./gradlew clean :opensearch-security-client:publishToMavenLocal -Dbuild.version_qualifier=$test_qualifier && test -s ./client/build/libs/opensearch-security-client-$security_plugin_version_only_number-$test_qualifier-SNAPSHOT-all.jar
392
-
578
+
393
579
# Build artifacts
394
- ./gradlew clean :assemble && \
580
+
581
+ ./gradlew clean assemble && \
395
582
test -s ./build/distributions/opensearch-security-$security_plugin_version.zip && \
396
- test -s ./sample-resource-plugin/build/distributions/opensearch-sample-resource-plugin-$security_plugin_version.zip && \
397
583
test -s ./spi/build/libs/opensearch-resource-sharing-spi-$security_plugin_version.jar && \
398
- test -s ./common/build/libs/opensearch-security-common-$security_plugin_version.jar && \
399
584
test -s ./client/build/libs/opensearch-security-client-$security_plugin_version.jar
400
-
401
-
585
+
402
586
./gradlew clean assemble -Dbuild.snapshot=false && \
403
587
test -s ./build/distributions/opensearch-security-$security_plugin_version_no_snapshot.zip && \
404
- test -s ./sample-resource-plugin/build/distributions/opensearch-sample-resource-plugin-$security_plugin_version_no_snapshot.zip && \
405
588
test -s ./spi/build/libs/opensearch-resource-sharing-spi-$security_plugin_version_no_snapshot.jar && \
406
- test -s ./common/build/libs/opensearch-security-common-$security_plugin_version_no_snapshot.jar && \
407
589
test -s ./client/build/libs/opensearch-security-client-$security_plugin_version_no_snapshot.jar
408
-
590
+
409
591
./gradlew clean assemble -Dbuild.snapshot=false -Dbuild.version_qualifier=$test_qualifier && \
410
592
test -s ./build/distributions/opensearch-security-$security_plugin_version_only_number-$test_qualifier.zip && \
411
- test -s ./sample-resource-plugin/build/distributions/opensearch-sample-resource-plugin-$security_plugin_version_only_number-$test_qualifier.zip && \
412
593
test -s ./spi/build/libs/opensearch-resource-sharing-spi-$security_plugin_version_only_number-$test_qualifier.jar && \
413
- test -s ./common/build/libs/opensearch-security-common-$security_plugin_version_only_number-$test_qualifier.jar && \
414
594
test -s ./client/build/libs/opensearch-security-client-$security_plugin_version_only_number-$test_qualifier.jar
415
-
595
+
416
596
./gradlew clean assemble -Dbuild.version_qualifier=$test_qualifier && \
417
597
test -s ./build/distributions/opensearch-security-$security_plugin_version_only_number-$test_qualifier-SNAPSHOT.zip && \
418
- test -s ./sample-resource-plugin/build/distributions/opensearch-sample-resource-plugin-$security_plugin_version_only_number-$test_qualifier-SNAPSHOT.zip && \
419
598
test -s ./spi/build/libs/opensearch-resource-sharing-spi-$security_plugin_version_only_number-$test_qualifier-SNAPSHOT.jar && \
420
- test -s ./common/build/libs/opensearch-security-common-$security_plugin_version_only_number-$test_qualifier-SNAPSHOT.jar && \
421
599
test -s ./client/build/libs/opensearch-security-client-$security_plugin_version_only_number-$test_qualifier-SNAPSHOT.jar
422
-
600
+
423
601
./gradlew clean publishPluginZipPublicationToZipStagingRepository && \
424
602
test -s ./build/distributions/opensearch-security-$security_plugin_version.zip && \
425
603
test -s ./build/distributions/opensearch-security-$security_plugin_version.pom && \
426
- test -s ./spi/build/libs/opensearch-resource-sharing-spi-$security_plugin_version-all.jar && \
427
- test -s ./common/build/libs/opensearch-security-common-$security_plugin_version-all.jar
428
-
604
+ test -s ./spi/build/libs/opensearch-resource-sharing-spi-$security_plugin_version-all.jar
605
+
429
606
./gradlew clean publishShadowPublicationToMavenLocal && \
430
607
test -s ./spi/build/libs/opensearch-resource-sharing-spi-$security_plugin_version-all.jar && \
431
- test -s ./common/build/libs/opensearch-security-common-$security_plugin_version-all.jar && \
432
608
test -s ./client/build/libs/opensearch-security-client-$security_plugin_version-all.jar
433
609
434
610
- name : List files in build directory on failure
0 commit comments