-
Notifications
You must be signed in to change notification settings - Fork 136
927 lines (819 loc) · 32.2 KB
/
ci.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
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
# Copyright (C) 2020 Dremio
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Unifies main + PR workflow.
#
# The unified CI workflow consists of 2 "stages":
# - Checks - test, intTest, NesQuEIT, etc
# - Finalize - a "success" dummy job for PRs + a "save to github-cache" job for push-to-main
#
# Utilizes the Gradle build cache for all stages. The updated build cache
# of the jobs in the checks stage are saved as artifacts (with the minimum
# retention period). The updated build cache is pushed back to GigHub's
# cache when the checks have successfully finished.
#
# Java CI runs against Java 11 and Java 17, where it is meaningful.
# (Spark tests always run against 11, so not run against Java 17.)
name: CI build
on:
push:
branches:
- main
- release-*
paths-ignore:
- 'LICENSE'
- 'NOTICE'
- '**.md'
- '!site/**'
- '.github/renovate.json5'
- '.github/workflows/release*.yml'
- '.github/workflows/check*.yml'
- '.idea/**'
- '.editorconfig'
pull_request:
types: [labeled, opened, synchronize, reopened]
# For the main branch: let all CI runs complete, one after the other. This has a couple advantages:
# * Site deployments happen in commit-order
# * Saved Gradle cache are persisted in commit-order
# * (Potentially) more GH runners available for PRs
concurrency:
# PRs: 1 CI run concurrently / older ones are cancelled
# main branch: 1 CI run concurrently / all commits / no cancellation
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
code-checks:
name: CI Code Checks et al
runs-on: ubuntu-22.04
strategy:
max-parallel: 2
matrix:
java-version: ['11'] # Ideally also '17', but GH concurrent job limit ... :(
steps:
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- name: Setup runner
uses: ./.github/actions/setup-runner
- name: Setup Java, Gradle
uses: ./.github/actions/dev-tool-java
with:
java-version: ${{ matrix.java-version }}
# Needed for the Quarkus plugin - can likely go away once we use Quarkus 3 or newer
- name: Bump Gradle daemon heap
run: sed -i 's/-Xms.*/-Xms6G -Xmx6G -XX:MaxMetaspaceSize=1g \\/' gradle.properties
- name: Prepare Gradle build cache
uses: ./.github/actions/ci-incr-build-cache-prepare
with:
java-version: ${{ matrix.java-version }}
- name: Gradle / Compile
uses: gradle/gradle-build-action@v2
with:
arguments: |
spotlessCheck
compileAll
-x :nessie-quarkus:compileAll
-x :nessie-quarkus-cli:compileAll
-x :nessie-events-quarkus:compileAll
--scan
- name: Gradle / Compile Quarkus
uses: gradle/gradle-build-action@v2
with:
arguments: |
:nessie-quarkus:compileAll
:nessie-quarkus-cli:compileAll
:nessie-events-quarkus:compileAll
--scan
- name: Gradle / Checkstyle
uses: gradle/gradle-build-action@v2
with:
arguments: checkstyle --scan
- name: Gradle / Assemble
uses: gradle/gradle-build-action@v2
with:
arguments: assemble --scan
- name: Gradle / Publish to Maven local
uses: gradle/gradle-build-action@v2
with:
arguments: publishToMavenLocal --scan
# This is a rather quick one and uses the output of 'publishToMavenLocal', which uses the
# outputs of 'assemble'
- name: Gradle / build tools integration tests
uses: gradle/gradle-build-action@v2
with:
arguments: buildToolsIntegrationTest
- name: Save partial Gradle build cache
uses: ./.github/actions/ci-incr-build-cache-save
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
with:
job-name: 'code-checks'
java-version: ${{ matrix.java-version }}
test:
name: CI Test
runs-on: ubuntu-22.04
strategy:
max-parallel: 2
matrix:
java-version: ['11'] # Ideally also '17', but GH concurrent job limit ... :(
steps:
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- name: Setup runner
uses: ./.github/actions/setup-runner
- name: Setup Java, Gradle
uses: ./.github/actions/dev-tool-java
with:
java-version: ${{ matrix.java-version }}
- name: Prepare Gradle build cache
uses: ./.github/actions/ci-incr-build-cache-prepare
with:
java-version: ${{ matrix.java-version }}
- name: Gradle / test
uses: gradle/gradle-build-action@v2
with:
arguments: |
test
:nessie-client:check
-x :nessie-client:intTest
-x :nessie-quarkus:test
-x :nessie-quarkus-cli:test
-x :nessie-events-quarkus:test
--scan
- name: Capture Test Reports
uses: actions/upload-artifact@v3
if: ${{ failure() }}
with:
name: ci-test-reports
path: |
**/build/reports/*
**/build/test-results/*
retention-days: 7
- name: Save partial Gradle build cache
uses: ./.github/actions/ci-incr-build-cache-save
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
with:
job-name: 'test'
java-version: ${{ matrix.java-version }}
test-quarkus:
name: CI Test Quarkus
runs-on: ubuntu-22.04
strategy:
max-parallel: 2
matrix:
java-version: ['11'] # Ideally also '17', but GH concurrent job limit ... :(
steps:
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- name: Setup runner
uses: ./.github/actions/setup-runner
- name: Setup Java, Gradle
uses: ./.github/actions/dev-tool-java
with:
java-version: ${{ matrix.java-version }}
- name: Prepare Gradle build cache
uses: ./.github/actions/ci-incr-build-cache-prepare
with:
java-version: ${{ matrix.java-version }}
- name: Gradle / Test Quarkus
uses: gradle/gradle-build-action@v2
with:
arguments: |
:nessie-client:test
:nessie-quarkus:test
:nessie-events-quarkus:test
--scan
- name: Dump quarkus.log
if: ${{ failure() }}
run: |
find . -path "**/build/quarkus.log" | while read ql ; do
echo "::group::Quarkus build log $ql"
cat $ql
echo "::endgroup::"
done
- name: Capture Test Reports
uses: actions/upload-artifact@v3
if: ${{ failure() }}
with:
name: ci-test-quarkus-reports
path: |
**/build/quarkus.log
**/build/reports/*
**/build/test-results/*
retention-days: 7
- name: Save partial Gradle build cache
uses: ./.github/actions/ci-incr-build-cache-save
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
with:
job-name: 'test-quarkus'
java-version: ${{ matrix.java-version }}
int-test:
name: CI intTest
runs-on: ubuntu-22.04
strategy:
max-parallel: 2
matrix:
java-version: ['11'] # Ideally also '17', but GH concurrent job limit ... :(
env:
SPARK_LOCAL_IP: localhost
steps:
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- name: Setup runner
uses: ./.github/actions/setup-runner
- name: Setup Java, Gradle
uses: ./.github/actions/dev-tool-java
with:
java-version: ${{ matrix.java-version }}
- name: Prepare Gradle build cache
uses: ./.github/actions/ci-incr-build-cache-prepare
- name: Gradle / intTest
run: |
echo "::group::Collect :nessie-versioned-storage projects"
./gradlew :listProjectsWithPrefix --prefix :nessie-versioned-persist- --output ../persist-prjs.txt --exclude
echo "::endgroup::"
echo "::group::Collect :nessie-versioned-persist projects"
./gradlew :listProjectsWithPrefix --prefix :nessie-versioned-storage- --output ../storage-prjs.txt --exclude
echo "::endgroup::"
echo "::group::Collect :nessie-spark-extensions projects"
./gradlew :listProjectsWithPrefix --prefix :nessie-spark-ext --output ../spark-prjs.txt --exclude
echo "::endgroup::"
./gradlew intTest \
-x :nessie-quarkus:intTest \
-x :nessie-quarkus-cli:intTest \
-x :nessie-events-quarkus:intTest \
$(cat ../persist-prjs.txt) \
$(cat ../storage-prjs.txt) \
$(cat ../spark-prjs.txt) \
--scan
- name: Capture Test Reports
uses: actions/upload-artifact@v3
if: ${{ failure() }}
with:
name: ci-inttest-reports
path: |
**/build/reports/*
**/build/test-results/*
retention-days: 7
- name: Save partial Gradle build cache
uses: ./.github/actions/ci-incr-build-cache-save
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
with:
job-name: 'int-test'
java-version: ${{ matrix.java-version }}
int-test-stores:
name: CI intTest versioned/stores
runs-on: ubuntu-22.04
strategy:
max-parallel: 2
matrix:
java-version: ['11'] # Ideally also '17', but GH concurrent job limit ... :(
steps:
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- name: Setup runner
uses: ./.github/actions/setup-runner
- name: Setup Java, Gradle
uses: ./.github/actions/dev-tool-java
with:
java-version: ${{ matrix.java-version }}
- name: Prepare Gradle build cache
uses: ./.github/actions/ci-incr-build-cache-prepare
with:
java-version: ${{ matrix.java-version }}
- name: Gradle / intTest versioned/stores
run: |
echo "::group::Collect :nessie-versioned-storage projects"
./gradlew :listProjectsWithPrefix --prefix :nessie-versioned-storage- --output ../storage-prjs.txt
echo "::endgroup::"
echo "::group::Collect :nessie-versioned-persist projects"
./gradlew :listProjectsWithPrefix --prefix :nessie-versioned-persist- --output ../persist-prjs.txt
echo "::endgroup::"
./gradlew $(cat ../persist-prjs.txt) $(cat ../storage-prjs.txt) --scan
- name: Capture Test Reports
uses: actions/upload-artifact@v3
if: ${{ failure() }}
with:
name: ci-inttest-stores-reports
path: |
**/build/reports/*
**/build/test-results/*
retention-days: 7
- name: Save partial Gradle build cache
uses: ./.github/actions/ci-incr-build-cache-save
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
with:
job-name: 'int-test-stores'
java-version: ${{ matrix.java-version }}
int-test-integrations:
name: CI intTest integrations
runs-on: ubuntu-22.04
env:
SPARK_LOCAL_IP: localhost
steps:
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- name: Setup runner
uses: ./.github/actions/setup-runner
- name: Setup Java, Gradle
uses: ./.github/actions/dev-tool-java
- name: Prepare Gradle build cache
uses: ./.github/actions/ci-incr-build-cache-prepare
- name: Gradle / intTest integrations
run: |
echo "::group::Collect :nessie-spark-extensions projects"
./gradlew :listProjectsWithPrefix --prefix :nessie-spark-ext --output ../spark-prjs.txt
echo "::endgroup::"
./gradlew $(cat ../spark-prjs.txt) --scan
- name: Capture Test Reports
uses: actions/upload-artifact@v3
if: ${{ failure() }}
with:
name: ci-inttest-integrations-reports
path: |
**/build/reports/*
**/build/test-results/*
retention-days: 7
- name: Save partial Gradle build cache
uses: ./.github/actions/ci-incr-build-cache-save
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
with:
job-name: 'int-test-integrations'
int-test-quarkus:
name: CI intTest Quarkus
runs-on: ubuntu-22.04
strategy:
max-parallel: 2
matrix:
java-version: ['11'] # Ideally also '17', but GH concurrent job limit ... :(
steps:
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- name: Setup runner
uses: ./.github/actions/setup-runner
- name: Setup Java, Gradle
uses: ./.github/actions/dev-tool-java
with:
java-version: ${{ matrix.java-version }}
- name: Prepare Gradle build cache
uses: ./.github/actions/ci-incr-build-cache-prepare
with:
java-version: ${{ matrix.java-version }}
- name: Gradle / intTest Quarkus
uses: gradle/gradle-build-action@v2
with:
arguments: |
:nessie-quarkus:intTest
:nessie-quarkus-cli:intTest
:nessie-events-quarkus:intTest
--scan
- name: Dump quarkus.log
if: ${{ failure() }}
run: |
find . -path "**/build/quarkus.log" | while read ql ; do
echo "::group::Quarkus build log $ql"
cat $ql
echo "::endgroup::"
done
- name: Capture Test Reports
uses: actions/upload-artifact@v3
if: ${{ failure() }}
with:
name: ci-inttest-quarkus-reports
path: |
**/build/quarkus.log
**/build/reports/*
**/build/test-results/*
retention-days: 7
- name: Save partial Gradle build cache
uses: ./.github/actions/ci-incr-build-cache-save
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
with:
job-name: 'int-test-quarkus'
java-version: ${{ matrix.java-version }}
determine-jobs:
name: CI Determine jobs
runs-on: ubuntu-22.04
outputs:
# Each "conditional" job has a mapped output here, also a "non-PR" case and a "PR" case
# with label and globs (at the end of the script).
docker: ${{ steps.determine.outputs.docker }}
nesqueit: ${{ steps.determine.outputs.nesqueit }}
helm: ${{ steps.determine.outputs.helm }}
steps:
- name: install minimatch
shell: bash
run: npm install minimatch@"^7.4.3"
- name: Determine conditional jobs to run
id: determine
uses: actions/github-script@v6
with:
script: |
const {Minimatch} = require("minimatch");
async function getChangedFiles(pull_request) {
const listFilesOptions = github.rest.pulls.listFiles.endpoint.merge({
owner: pull_request.base.repo.owner.login,
repo: pull_request.base.repo.name,
pull_number: pull_request.number,
});
return github.paginate(listFilesOptions).then(resp => resp.map(f => f.filename))
}
function isMatch(changedFile, matchers) {
for (const matcher of matchers) {
if (matcher.match(changedFile)) {
core.info("Match found for changed file " + changedFile);
return true;
}
}
core.info("No changed file matched the globs");
return false;
}
function filesMatchAnyGlob(changedFiles, globs) {
const matchers = globs.map(g => new Minimatch(g));
for (const changedFile of changedFiles) {
if (isMatch(changedFile, matchers)) {
return true;
}
}
return false;
}
function checkLabelOrGlobs(pr, changedFiles, labelName, globs) {
core.info("Checking for " + labelName);
// If the PR has the given label, then let the conditional job run.
for (const label of pr.labels) {
if (label.name === labelName) {
core.info("PR has label " + labelName);
return true;
}
}
// For pull request, check the list of changed files against the given globs.
// Let the conditional job run, if any of the globs matches and of the changed files.
core.info("Checking changed files against globs " + globs);
return filesMatchAnyGlob(changedFiles, globs);
}
///////////////////////////////////////////////////////////////////////////////////////
// "Non PR" case:
// Behavior of the conditional jobs when the event that triggered the workflow is not
// for a pull request (usually a push-to-main).
//
if (!context.payload || !context.payload.pull_request) {
core.info("Not a pull-request, enabling all jobs.");
// Yield default values for all event payload types, except pull_request
core.setOutput('docker', true);
core.setOutput('nesqueit', false); // handled in a scheduled job
core.setOutput('helm', true);
return true;
}
///////////////////////////////////////////////////////////////////////////////////////
// "PR" case:
// Determine the whether the conditional jobs shall run, based on a label name, which
// has been manually added, or, if the label is not present, based on some globs to
// check.
const pr = context.payload.pull_request
core.info("pull-request #" + pr.number);
// Retrieves the full list of changed files for the PR.
const changedFiles = await getChangedFiles(pr);
core.startGroup('PR job check / Docker');
core.setOutput('docker', checkLabelOrGlobs(pr, changedFiles,
'pr-docker',
['gradle/wrapper/**', 'tools/dockerbuild/**', '.github/**']));
core.endGroup();
core.startGroup('PR job check / NesQuEIT');
core.setOutput('nesqueit', checkLabelOrGlobs(pr, changedFiles,
'pr-integrations',
['gradle/wrapper/**', 'integrations/**', 'api/**', '.github/**']));
core.endGroup();
core.startGroup('PR job check / Helm');
core.setOutput('helm', checkLabelOrGlobs(pr, changedFiles,
'pr-helm',
['helm/**', '.github/**']));
core.endGroup();
docker-testing:
name: CI Docker build and publishing
runs-on: ubuntu-22.04
needs:
- determine-jobs
if: needs.determine-jobs.outputs.docker == 'true'
steps:
- name: Checkout
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
with:
fetch-depth: 0
- name: Setup runner
uses: ./.github/actions/setup-runner
- name: Setup Java, Gradle
uses: ./.github/actions/dev-tool-java
- name: Setup docker-registry
run: |
sudo apt-get install -y docker-registry apache2-utils
cat <<! > config.yml
version: 0.1
log:
fields:
service: registry
storage:
cache:
blobdescriptor: inmemory
filesystem:
rootdirectory: /var/lib/docker-registry
delete:
enabled: true
http:
addr: 127.0.0.1:5000
headers:
X-Content-Type-Options: [nosniff]
auth:
htpasswd:
realm: basic-realm
path: /etc/docker/registry/htpasswd
health:
storagedriver:
enabled: true
interval: 10s
threshold: 3
!
sudo mv config.yml /etc/docker/registry/config.yml
sudo htpasswd -cBb /etc/docker/registry/htpasswd micky mouse
sudo service docker-registry restart
echo mouse | docker login -u micky --password-stdin localhost:5000
VERSION="$(cat version.txt)"
DOCKER_VERSION="${VERSION%-SNAPSHOT}"
echo "DOCKER_VERSION=${DOCKER_VERSION}" >> ${GITHUB_ENV}
echo "DOCKER_IMAGE=localhost:5000/nessie-testing" >> ${GITHUB_ENV}
- name: Prepare Gradle build cache
uses: ./.github/actions/ci-incr-build-cache-prepare
- name: Docker images publishing
env:
ARTIFACTS: ../build-artifacts
run: |
rm -rf "${ARTIFACTS}"
mkdir -p "${ARTIFACTS}"
tools/dockerbuild/build-push-images.sh \
-a "${ARTIFACTS}" \
-g ":nessie-quarkus" \
-p "servers/quarkus-server" \
${DOCKER_IMAGE}
rm -rf "${ARTIFACTS}"
- name: Cleanup buildx
run: |
docker buildx use default
docker buildx rm nessiebuild
- name: Docker images exist test
run: |
docker pull ${DOCKER_IMAGE}:latest
docker pull ${DOCKER_IMAGE}:latest-java
docker pull ${DOCKER_IMAGE}:${DOCKER_VERSION}
docker pull ${DOCKER_IMAGE}:${DOCKER_VERSION}-java
cat <<! >> $GITHUB_STEP_SUMMARY
## Docker images
\`\`\`
$(docker images)
\`\`\`
!
- name: Check if Docker Java image works
run: |
docker run --detach --name nessie ${DOCKER_IMAGE}:latest-java
echo "Let Nessie Java Docker image run for one minute (to make sure it starts up fine)..."
for i in {1..60}; do
STATUS="$(docker container inspect nessie | jq -r '.[0].State.Status')"
if [[ ${STATUS} != "running" ]] ; then
echo "Nessie Java Docker image stopped on its own ... a bug?" > /dev/stderr
docker logs nessie
cat <<! >> $GITHUB_STEP_SUMMARY
## Nessie Java Docker image FAILED
\`\`\`
$(docker logs nessie)
\`\`\`
!
exit 1
fi
sleep 1
done
echo "## Nessie Java Docker image smoke test: PASSED" >> $GITHUB_STEP_SUMMARY
echo "Nessie Java Docker image smoke test: PASSED"
docker stop nessie
docker rm nessie
nesqueit:
name: CI NesQuEIT
runs-on: ubuntu-22.04
needs:
- determine-jobs
# Only run NesQuEIT tests for PRs, if requested. This job can easily run for 30+ minutes.
if: github.event_name == 'pull_request' && needs.determine-jobs.outputs.nesqueit == 'true'
env:
NESSIE_DIR: included-builds/nessie
NESSIE_PATCH_REPOSITORY: ''
NESSIE_PATCH_BRANCH: ''
NESQUEIT_REPOSITORY: projectnessie/query-engine-integration-tests
NESQUEIT_BRANCH: main
ICEBERG_DIR: included-builds/iceberg
ICEBERG_MAIN_REPOSITORY: apache/iceberg
ICEBERG_MAIN_BRANCH: master
ICEBERG_PATCH_REPOSITORY: snazy/iceberg
ICEBERG_PATCH_BRANCH: iceberg-nesqueit
SPARK_LOCAL_IP: localhost
steps:
- name: Prepare Git
run: |
git config --global user.email "[email protected]"
git config --global user.name "Integrations Testing [Bot]"
- name: Checkout NeQuEIT repo
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
with:
repository: ${{env.NESQUEIT_REPOSITORY}}
ref: ${{env.NESQUEIT_BRANCH}}
- name: Free disk space
uses: ./.github/actions/free-disk-space
- name: Setup runner
uses: ./.github/actions/setup-runner
with:
more-memory: 'true'
- name: Checkout and patch Nessie PR
uses: ./.github/actions/patch-git
with:
name: Nessie
local-dir: ${{env.NESSIE_DIR}}
main-repository: ${{ env.GITHUB_REPOSITORY }}
patch-repository: ${{env.NESSIE_PATCH_REPOSITORY}}
patch-branch: ${{env.NESSIE_PATCH_BRANCH}}
work-branch: nessie-integration-patched
- name: Checkout and patch Iceberg
uses: ./.github/actions/patch-git
with:
name: Nessie
local-dir: ${{env.ICEBERG_DIR}}
main-repository: ${{env.ICEBERG_MAIN_REPOSITORY}}
main-branch: ${{env.ICEBERG_MAIN_BRANCH}}
patch-repository: ${{env.ICEBERG_PATCH_REPOSITORY}}
patch-branch: ${{env.ICEBERG_PATCH_BRANCH}}
work-branch: iceberg-integration-patched
- name: Set up JDK ${{ matrix.java-version }}
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 11
- name: Iceberg Nessie test
uses: gradle/gradle-build-action@v2
with:
cache-read-only: true
arguments: :iceberg:iceberg-nessie:test --scan
- name: Nessie Spark 3.2 / 2.12 Extensions test
uses: gradle/gradle-build-action@v2
with:
arguments: :nessie:nessie-iceberg:nessie-spark-extensions-3.2_2.12:test :nessie:nessie-iceberg:nessie-spark-extensions-3.2_2.12:intTest --scan
- name: Nessie Spark 3.3 / 2.12 Extensions test
uses: gradle/gradle-build-action@v2
with:
arguments: :nessie:nessie-iceberg:nessie-spark-extensions-3.3_2.12:test :nessie:nessie-iceberg:nessie-spark-extensions-3.3_2.12:intTest --scan
- name: Nessie Spark 3.4 / 2.13 Extensions test
uses: gradle/gradle-build-action@v2
with:
arguments: :nessie:nessie-iceberg:nessie-spark-extensions-3.3_2.13:test :nessie:nessie-iceberg:nessie-spark-extensions-3.3_2.13:intTest --scan
#- name: Publish Nessie + Iceberg to local Maven repo
# uses: gradle/gradle-build-action@v2
# with:
# arguments: publishLocal --scan
#
#- name: Gather locally published versions
# run: |
# NESSIE_VERSION="$(cat included-builds/nessie/version.txt)"
# ICEBERG_VERSION="$(cat included-builds/iceberg/build/iceberg-build.properties | grep '^git.build.version=' | cut -d= -f2)"
# echo "NESSIE_VERSION=${NESSIE_VERSION}" >> ${GITHUB_ENV}
# echo "ICEBERG_VERSION=${ICEBERG_VERSION}" >> ${GITHUB_ENV}
# cat <<! >> $GITHUB_STEP_SUMMARY
# ## Published versions
# | Published Nessie version | Published Iceberg version |
# | ------------------------ | ------------------------- |
# | ${NESSIE_VERSION} | ${ICEBERG_VERSION} |
# !
- name: Tools & Integrations tests
uses: gradle/gradle-build-action@v2
with:
arguments: intTest --scan
helm-testing:
name: CI Lint & Test Helm chart
runs-on: ubuntu-22.04
needs:
- determine-jobs
if: needs.determine-jobs.outputs.helm == 'true'
steps:
- name: Checkout
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
with:
fetch-depth: 0
# Skip remaining steps, if current Nessie release version is not available
- name: Precheck
run: |
EXPECT_VERSION="$(cat helm/nessie/Chart.yaml | grep -E '^version: ')"
curl https://charts.projectnessie.org/index.yaml 2>/dev/null | grep -q "${EXPECT_VERSION}" || (
echo "Skipping Helm checks, because Nessie Helm chart version ${EXPECT_VERSION} is not available"
echo "WF_EXEC=false" >> ${GITHUB_ENV}
)
- name: Set up Helm
if: env.WF_EXEC != 'false'
uses: azure/setup-helm@v3
with:
# https://helm.sh/docs/topics/version_skew/
version: 'v3.11.3'
- name: Setup Python
if: env.WF_EXEC != 'false'
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Set up chart-testing
if: env.WF_EXEC != 'false'
uses: helm/[email protected]
with:
# https://github.com/adrienverge/yamllint/tags
# default is 1.27.1, but leads to Python install issues
yamllint_version: 1.31.0
# https://github.com/23andMe/Yamale/releases
# default is 3.0.4, just bump to current latest patch version
yamale_version: 3.0.8
- name: Run chart-testing (list-changed)
if: env.WF_EXEC != 'false'
run: |
ct list-changed --target-branch ${{ github.event.repository.default_branch }}
- name: Run chart-testing (lint)
if: env.WF_EXEC != 'false'
run: ct lint --debug --charts ./helm/nessie
- name: Set up & Start Minikube
if: env.WF_EXEC != 'false'
uses: medyagh/[email protected]
with:
# If required, use the matrix strategy against this option to test against multiple Kubernetes versions:
kubernetes-version: stable
cache: false
- name: Show pods
if: env.WF_EXEC != 'false'
run: kubectl get pods -A
- name: Run chart-testing (install)
if: env.WF_EXEC != 'false'
run: ct install --debug --charts ./helm/nessie
site:
name: CI Website
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- name: Setup Python
uses: ./.github/actions/dev-tool-python
with:
python-version: '3.8'
- name: Upgrade pip
run: |
# install pip=>20.1 to use "pip cache dir"
python3 -m pip install --upgrade pip
- name: Install dependencies
run: python3 -m pip install -r ./site/requirements.txt
- name: Check code block indentation
run: python3 check_code_indent.py
working-directory: ./site
- name: Generate Static Site
run: mkdocs build
working-directory: ./site
- name: Deploy Static Site to GitHub
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository == 'projectnessie/nessie'
uses: peaceiris/actions-gh-pages@v3
with:
external_repository: projectnessie/projectnessie.github.io
publish_branch: main
deploy_key: ${{ secrets.NESSIE_SITE_DEPLOY_KEY }}
publish_dir: ./site/site
cname: projectnessie.org
store-cache:
# Store the Gradle cache to GH cache as soon as all relevant Nessie/Gradle jobs have finished.
name: CI Store Cache
runs-on: ubuntu-22.04
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
needs:
# Only include jobs that use Nessie's Gradle cache, especially excluding NesQuEIT, which
# is a "very special" citizen and also not run for "main" CI, which does
# not add anything to the Gradle cache that's not already produced by other jobs.
- code-checks
- test
- test-quarkus
- int-test
- int-test-stores
- int-test-integrations
- int-test-quarkus
strategy:
max-parallel: 2
matrix:
java-version: ['11'] # Ideally also '17', but GH concurrent job limit ... :(
steps:
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- name: Setup runner
uses: ./.github/actions/setup-runner
- name: Setup Java, Gradle
uses: ./.github/actions/dev-tool-java
with:
java-version: ${{ matrix.java-version }}
- name: Collect partial Gradle build caches
uses: ./.github/actions/ci-incr-build-cache-prepare
with:
java-version: ${{ matrix.java-version }}
cache-read-only: false
- name: Trigger Gradle home cleanup
run: ./gradlew --no-daemon :showVersion
# Note: the "Post Gradle invocation" archives the updated build cache.