-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Expand file tree
/
Copy pathcontinuous-integration-workflow.yml
More file actions
1323 lines (1233 loc) · 60.4 KB
/
Copy pathcontinuous-integration-workflow.yml
File metadata and controls
1323 lines (1233 loc) · 60.4 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
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
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
name: Openfire CI
env:
CI: true
REGISTRY: ghcr.io
IMAGE_NAME: openfire
on: [push, pull_request]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: Build Openfire from source
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
java: [ 17, 21, 25 ]
distribution: [ zulu ] # We could add more here: temurin, adopt, liberica, microsoft, corretto
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v7
- name: Set up JDK ${{ matrix.java }} ${{ matrix.distribution }} on ${{ matrix.os }}
uses: actions/setup-java@v5
with:
java-version: ${{ matrix.java }}
distribution: ${{ matrix.distribution }}
cache: maven
- name: Cache Maven wrapper distribution
uses: actions/cache@v5
with:
path: ~/.m2/wrapper
key: ${{ runner.os }}-mvn-wrapper-${{ hashFiles('.mvn/wrapper/maven-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-mvn-wrapper-
- name: Build with Maven while generating code coverage report # We install instead of package, because we want the result in the local mvn repo
if: ${{ github.ref_name == 'main' }}
run: ./mvnw -B install -Pcoverage --file pom.xml
- name: Build with Maven # We install instead of package, because we want the result in the local mvn repo
if: ${{ github.ref_name != 'main' }}
run: ./mvnw -B install --file pom.xml
- name: Upload failed test reports
uses: actions/upload-artifact@v7
if: always()
with:
name: Openfire Build Java ${{ matrix.java }} ${{ matrix.distribution }} on ${{ runner.os }} JUnit Test reports
path: xmppserver/target/surefire-reports
- name: tar distribution # sharing artifacts that consist of many files can be slow. Share one file instead.
if: ${{ matrix.distribution == 'zulu' }}
run: tar -cf distribution-artifact.tar distribution/target/distribution-base
- name: Upload distribution
if: ${{ matrix.distribution == 'zulu' }}
uses: actions/upload-artifact@v7
with:
name: Openfire Distribution Java ${{ matrix.java }} ${{ matrix.distribution }} on ${{ runner.os }}
path: distribution-artifact.tar
- name: Upload coverage report for 'xmppserver' module
if: ${{ matrix.distribution == 'zulu' && matrix.java == 17 && matrix.os == 'ubuntu-latest' && github.ref_name == 'main'}}
uses: actions/upload-artifact@v7
with:
name: Openfire Build Java ${{ matrix.java }} Unit Test Coverage Report (for 'xmppserver' module)
path: xmppserver/target/site/jacoco/
- name: Temporarily stash openfire artifacts from the mvn repo for later jobs
if: ${{ matrix.distribution == 'zulu' && matrix.java == 17 && matrix.os == 'ubuntu-latest'}}
uses: actions/upload-artifact@v7
with:
name: Maven Repository
path: ~/.m2/repository/org/igniterealtime/openfire/
retention-days: 1
build-docker:
name: Build Docker image
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout repository
uses: actions/checkout@v7
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Compute Docker cache key hash
id: cache-hash
run: echo "hash=${{ hashFiles('**/pom.xml', 'Dockerfile', 'build/docker/entrypoint.sh') }}" >> $GITHUB_OUTPUT
- name: Build Docker image
uses: docker/build-push-action@v7
with:
context: .
load: true
tags: ${{ env.IMAGE_NAME }}:ci-${{ github.sha }}
cache-from: type=gha,scope=openfire-${{ steps.cache-hash.outputs.hash }}
cache-to: type=gha,mode=max,scope=openfire-${{ steps.cache-hash.outputs.hash }}-${{ github.sha }}
- name: Save Docker image to tar archive
run: docker save ${{ env.IMAGE_NAME }}:ci-${{ github.sha }} | gzip > openfire-docker-image.tar.gz
- name: Upload Docker image archive
uses: actions/upload-artifact@v7
with:
name: Openfire Docker Image
path: openfire-docker-image.tar.gz
retention-days: 1
integration:
name: Execute Integration CI tests
runs-on: ubuntu-latest
needs: build-docker
steps:
- uses: actions/checkout@v7
- name: Download Docker image archive
uses: actions/download-artifact@v8
with:
name: Openfire Docker Image
path: .
- name: Load Docker image
run: |
docker load < openfire-docker-image.tar.gz
docker tag ${{ env.IMAGE_NAME }}:ci-${{ github.sha }} openfire:latest
- name: Checkout Integration Tests
uses: actions/checkout@v7
with:
repository: igniterealtime/openfire-integration-tests
path: openfire-integration-tests
- name: Initialize Integration Tests Submodules
working-directory: openfire-integration-tests
run: |
git submodule update --init
- name: Setup Java
uses: actions/setup-java@v5
with:
distribution: 'zulu'
java-version: '17'
cache: 'maven'
- name: Cache Maven wrapper distribution
uses: actions/cache@v5
with:
path: ~/.m2/wrapper
key: ${{ runner.os }}-mvn-wrapper-${{ hashFiles('openfire-integration-tests/.mvn/wrapper/maven-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-mvn-wrapper-
- name: Run Integration Tests
working-directory: openfire-integration-tests
run: ./mvnw -B verify
- name: Upload test reports
uses: actions/upload-artifact@v7
if: always()
with:
name: Integration Test Reports
path: openfire-integration-tests/target/failsafe-reports
aioxmpp:
name: Execute aioxmpp-based CI tests
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout local actions (that are invoked in the 'startCIServer' and 'stopCIServer' steps) # Do this _before_ untarring the distribution, as the checkout will empty the directory prior to the checkout!
uses: actions/checkout@v7
with:
sparse-checkout: |
.github
- name: Download distribution artifact from build job.
uses: actions/download-artifact@v8
with:
name: Openfire Distribution Java 17 zulu on ${{ runner.os }}
path: .
- name: untar distribution # sharing artifacts that consist of many files can be slow. Share one file instead.
run: tar -xf distribution-artifact.tar
- name: Checkout aioxmpp devel/head
run: git clone --depth 1 https://codeberg.org/jssfr/aioxmpp.git aioxmpp
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: 3.11
check-latest: true # attempt to prevent to use 3.11.3 by enticing the runner to update (to something later)
- name: Install aoixmpp dependencies
run: python -m pip install setuptools pytest pytest-cov coveralls pyOpenSSL pytz
- name: Build aioxmpp
working-directory: ./aioxmpp
run: python -m pip install .
- name: Create Openfire config file for aioxmpp
working-directory: ./aioxmpp
run: |
cat >"openfire-config.ini" <<EOL
[global]
provisioner=aioxmpp.e2etest.provision.AnonymousProvisioner
[aioxmpp.e2etest.provision.AnonymousProvisioner]
domain=example.org
host=localhost
port=5222
no_verify=true
quirks=["https://zombofant.net/xmlns/aioxmpp/e2etest/quirks#no-adhoc-ping", "https://zombofant.net/xmlns/aioxmpp/e2etest/quirks#no-xep-0049", "https://zombofant.net/xmlns/aioxmpp/e2etest/quirks#muc-no-333"]
EOL
- name: Start CI server from distribution
id: startCIServer
uses: ./.github/actions/startserver-action
with:
logLevel: debug
- name: Run aioxmpp tests
working-directory: ./aioxmpp
run: |
set -e
mkdir output
# OF-2849 test_publish_and_purge
# OF-2850 test_publish_multiple_and_get_by_id
# OF-2851 test_convert_field_datetime_default_locale
# OF-2853 test_set_topic
# https://codeberg.org/jssfr/aioxmpp/pulls/417#issuecomment-11196128 test_security_layer
python -m pytest -p aioxmpp.e2etest --e2etest-config="openfire-config.ini" -k 'not (test_security_layer or test_set_topic or test_publish_and_purge or test_publish_multiple_and_get_by_id or test_convert_field_datetime_default_locale)' tests 2>&1 | tee output/aioxmpp.test.output.txt
if [ ${PIPESTATUS[0]} -ne 0 ]; then false; fi;
- name: Expose test output
if: always()
uses: actions/upload-artifact@v7
with:
name: Aioxmpp Test Output
path: aioxmpp/output
- name: Stop CI server
if: ${{ always() && steps.startCIServer.conclusion == 'success' }} # TODO figure out if this is correct. The intent is to have the server stopped if it was successfully started, even if the tests fail. Failing tests should still cause the job to fail.
uses: ./.github/actions/stopserver-action
- name: Expose openfire output
if: always()
uses: actions/upload-artifact@v7
with:
name: Aioxmpp Test Openfire logs
path: distribution/target/distribution-base/logs/*
check_branch:
runs-on: ubuntu-latest
outputs:
is_publishable_branch: ${{ steps.check-branch.outputs.is_publishable_branch }}
branch_tag: ${{ steps.check-branch.outputs.branch_tag }}
steps:
- name: check if ${{ github.ref }} is main, a version branch, or a version tag
id: check-branch
run: |
if [[ ${{ github.ref }} == 'refs/heads/main' ]]; then
echo "is_publishable_branch=true" >> "${GITHUB_OUTPUT}"
echo "branch_tag=development" >> "${GITHUB_OUTPUT}"
elif [[ ${{ github.ref }} =~ ^refs\/heads\/[0-9]+\.[0-9]+$ ]]; then
echo "is_publishable_branch=true" >> "${GITHUB_OUTPUT}"
echo -n "branch_tag=" >> "${GITHUB_OUTPUT}"
echo "${{ github.ref }}" | sed -e 's!refs/heads/!!' >> "${GITHUB_OUTPUT}"
elif [[ ${{ github.ref }} =~ ^refs\/tags\/v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "is_publishable_branch=true" >> "${GITHUB_OUTPUT}"
echo -n "branch_tag=" >> "${GITHUB_OUTPUT}"
echo "${{ github.ref }}" | sed -e 's!refs/tags/!!' >> "${GITHUB_OUTPUT}"
else
echo "is_publishable_branch=false" >> "${GITHUB_OUTPUT}"
echo "branch_tag=rando" >> "${GITHUB_OUTPUT}"
fi
connectivity:
name: Execute Connectivity CI tests
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout local actions (that are invoked in the 'startCIServer' and 'stopCIServer' steps) # Do this _before_ untarring the distribution, as the checkout will empty the directory prior to the checkout!
uses: actions/checkout@v7
with:
sparse-checkout: |
.github
- name: Download distribution artifact from build job.
uses: actions/download-artifact@v8
with:
name: Openfire Distribution Java 17 zulu on ${{ runner.os }}
path: .
- name: untar distribution # sharing artifacts that consist of many files can be slow. Share one file instead.
run: tar -xf distribution-artifact.tar
- name: Start CI server from distribution
id: startCIServer
uses: ./.github/actions/startserver-action
with:
logLevel: debug
- name: Run connectivity tests
uses: ./.github/actions/connectivitytests-action
- name: Stop CI server
if: ${{ always() && steps.startCIServer.conclusion == 'success' }} # TODO figure out if this is correct. The intent is to have the server stopped if it was successfully started, even if the tests fail. Failing tests should still cause the job to fail.
uses: ./.github/actions/stopserver-action
xitf:
name: Execute XMPP Interop Testing Framework
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout local actions (that are invoked in the 'startCIServer' and 'stopCIServer' steps) # Do this _before_ untarring the distribution, as the checkout will empty the directory prior to the checkout!
uses: actions/checkout@v7
with:
sparse-checkout: |
.github
- name: Download distribution artifact from build job.
uses: actions/download-artifact@v8
with:
name: Openfire Distribution Java 17 zulu on ${{ runner.os }}
path: .
- name: untar distribution # sharing artifacts that consist of many files can be slow. Share one file instead.
run: tar -xf distribution-artifact.tar
- name: Start CI server from distribution
id: startCIServer
uses: ./.github/actions/startserver-action
with:
logLevel: debug
- name: Run XMPP Interop Testing Framework tests against server
uses: XMPP-Interop-Testing/xmpp-interop-tests-action@v1.7.2
with:
domain: 'example.org'
adminAccountUsername: 'admin'
adminAccountPassword: 'admin'
disabledTests: 'EntityCapsTest,SoftwareInfoIntegrationTest,XmppConnectionIntegrationTest,StreamManagementTest,WaitForClosingStreamElementTest,IoTControlIntegrationTest,ModularXmppClientToServerConnectionLowLevelIntegrationTest'
- name: Stop CI server
if: ${{ always() && steps.startCIServer.conclusion == 'success' }} # TODO figure out if this is correct. The intent is to have the server stopped if it was successfully started, even if the tests fail. Failing tests should still cause the job to fail.
uses: ./.github/actions/stopserver-action
conversations:
name: Execute Conversations e2e tests (${{ matrix.name }})
runs-on: ubuntu-latest
needs: build
strategy:
fail-fast: false
matrix:
include:
- name: demoboot
maestro-tags: demoboot
config-file: '' # Use default demoboot config
#- name: sasl2
# maestro-tags: sasl2
# config-file: build/ci/conversations/configs/sasl2.xml
steps:
- name: Checkout local actions and test flows # Do this _before_ untarring the distribution, as the checkout will empty the directory prior to the checkout!
uses: actions/checkout@v7
with:
sparse-checkout: |
.github
build/ci/conversations
- name: Download distribution artifact from build job.
uses: actions/download-artifact@v8
with:
name: Openfire Distribution Java 17 zulu on ${{ runner.os }}
path: .
- name: untar distribution # sharing artifacts that consist of many files can be slow. Share one file instead.
run: tar -xf distribution-artifact.tar
- name: Patch Openfire config for ${{ matrix.name }}
if: ${{ matrix.config-file != '' }}
run: cp ${{ matrix.config-file }} ./distribution/target/distribution-base/conf/openfire-demoboot.xml
- name: Start CI server from distribution
id: startCIServer
uses: ./.github/actions/startserver-action
with:
logLevel: debug
- name: Run Conversations tests (${{ matrix.name }})
uses: ./.github/actions/conversationstest-action
with:
includeTags: ${{ matrix.maestro-tags }}
- name: Stop CI server
if: ${{ always() && steps.startCIServer.conclusion == 'success' }}
uses: ./.github/actions/stopserver-action
should-do-database-tests:
name: Check if database install/upgrade tests should be run
runs-on: ubuntu-latest
permissions:
pull-requests: read
outputs:
check: ${{ steps.filter.outputs.database-relevant-files }}
steps:
- name: Checkout Openfire
uses: actions/checkout@v7
- name: Check for differences
uses: dorny/paths-filter@v4
id: filter
with:
filters: |
database-relevant-files:
- 'distribution/src/database/**'
- 'build/ci/**'
- '.github/workflows/continuous-integration-workflow.yml'
- 'xmppserver/pom.xml'
- 'xmppserver/src/main/java/org/jivesoftware/database/**'
xcheck-database-version:
name: Cross check that any new database upgrades match the code version
needs: [should-do-database-tests, check_branch]
runs-on: ubuntu-latest
if: ${{ needs.should-do-database-tests.outputs.check == 'true' || needs.check_branch.outputs.is_publishable_branch == 'true'}}
steps:
- name: Checkout Openfire
uses: actions/checkout@v7
- name: Cross check DATABASE_VERSION
run: |
set -e
CODE_SAYS=$(grep 'int DATABASE_VERSION =' xmppserver/src/main/java/org/jivesoftware/database/SchemaManager.java | sed -e 's/.*= //' -e 's/;//')
NEXT=$((CODE_SAYS + 1))
for dbname in db2 hsqldb mariadb mysql oracle postgresql sqlserver sybase; do
# Ensure that a file exists for CODE_SAYS
if [ ! -f distribution/src/database/upgrade/${CODE_SAYS}/openfire_${dbname}.sql ]; then
echo "ERROR: Expected to find a database upgrade script for ${dbname} and version ${CODE_SAYS}, but no such file exists."
exit 1
fi
done
# Ensure that the next increment does not have a directory
if [ -d distribution/src/database/upgrade/${NEXT} ]; then
echo "ERROR: Found a directory for the next database version ${NEXT}, but the code still says ${CODE_SAYS}. Please increment the DATABASE_VERSION in SchemaManager.java."
exit 1
fi
hsqldb-install:
name: Test HSQLDB install script
needs: [build, should-do-database-tests, check_branch]
runs-on: ubuntu-latest
if: ${{ needs.should-do-database-tests.outputs.check == 'true' || needs.check_branch.outputs.is_publishable_branch == 'true'}}
steps:
- name: Checkout Openfire
uses: actions/checkout@v7
- name: Set up JDK 17 Zulu
uses: actions/setup-java@v5
with:
java-version: 17
distribution: zulu
cache: maven
- name: Cache Maven wrapper distribution
uses: actions/cache@v5
with:
path: ~/.m2/wrapper
key: ${{ runner.os }}-mvn-wrapper-${{ hashFiles('.mvn/wrapper/maven-wrapper.properties', 'build/ci/updater/.mvn/wrapper/maven-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-mvn-wrapper-
- name: Restore mvn repo artifacts from build job
uses: actions/download-artifact@v8
with:
name: Maven Repository
path: ~/.m2/repository/org/igniterealtime/openfire/
- name: Set environment variables
run: |
echo "CONNECTION_STRING=jdbc:hsqldb:hsql://localhost/openfire" >> $GITHUB_ENV
echo "CONNECTION_DRIVER=org.hsqldb.jdbc.JDBCDriver" >> $GITHUB_ENV
echo "CONNECTION_USERNAME=sa" >> $GITHUB_ENV
echo "CONNECTION_PASSWORD=SecurePa55w0rd" >> $GITHUB_ENV
OPENFIREVSN=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout)
echo "OPENFIREVSN=$OPENFIREVSN" >> $GITHUB_ENV
echo "JAVA_HOME=$(echo $JAVA_HOME_17_X64)" >> $GITHUB_ENV
- name: Start database server with an empty database
run: |
docker compose -f ./build/ci/compose/hsqldb.yml up --detach
docker exec -i compose-db-1 bash -c "sed -i 's/password/password '"$CONNECTION_PASSWORD"'/' ~/sqltool.rc"
- name: Execute Openfire's database install script
run: |
pushd ./build/ci/updater
./mvnw -B clean package exec:java -Dexec.args="$GITHUB_WORKSPACE"
hsqldb-upgrade:
name: Test HSQLDB upgrade scripts
needs: [build, should-do-database-tests, check_branch]
runs-on: ubuntu-latest
if: ${{ needs.should-do-database-tests.outputs.check == 'true' || needs.check_branch.outputs.is_publishable_branch == 'true'}}
steps:
- name: Checkout Openfire
uses: actions/checkout@v7
- name: Set up JDK 17 Zulu
uses: actions/setup-java@v5
with:
java-version: 17
distribution: zulu
cache: maven
- name: Cache Maven wrapper distribution
uses: actions/cache@v5
with:
path: ~/.m2/wrapper
key: ${{ runner.os }}-mvn-wrapper-${{ hashFiles('.mvn/wrapper/maven-wrapper.properties', 'build/ci/updater/.mvn/wrapper/maven-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-mvn-wrapper-
- name: Restore mvn repo artifacts from build job
uses: actions/download-artifact@v8
with:
name: Maven Repository
path: ~/.m2/repository/org/igniterealtime/openfire/
- name: Set environment variables
run: |
echo "CONNECTION_STRING=jdbc:hsqldb:hsql://localhost/openfire" >> $GITHUB_ENV
echo "CONNECTION_DRIVER=org.hsqldb.jdbc.JDBCDriver" >> $GITHUB_ENV
echo "CONNECTION_USERNAME=sa" >> $GITHUB_ENV
echo "CONNECTION_PASSWORD=SecurePa55w0rd" >> $GITHUB_ENV
OPENFIREVSN=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout)
echo "OPENFIREVSN=$OPENFIREVSN" >> $GITHUB_ENV
echo "JAVA_HOME=$(echo $JAVA_HOME_17_X64)" >> $GITHUB_ENV
- name: Download an old Openfire database installation script
run: |
mkdir olddb
curl https://raw.githubusercontent.com/igniterealtime/Openfire/v4.3.0/distribution/src/database/openfire_hsqldb.sql > $GITHUB_WORKSPACE/olddb/openfire_hsqldb.sql
sed -i '/^\/\//d' $GITHUB_WORKSPACE/olddb/openfire_hsqldb.sql
sed '/^SET /d' $GITHUB_WORKSPACE/olddb/openfire_hsqldb.sql
- name: Start database server, install old version of the Openfire database
run: |
docker compose -f ./build/ci/compose/hsqldb.yml up --detach
docker exec -i compose-db-1 bash -c "sed -i 's/password/password '"$CONNECTION_PASSWORD"'/' ~/sqltool.rc"
docker exec -i compose-db-1 bash -c "java -jar /opt/hsqldb/sqltool.jar db /olddb/openfire_hsqldb.sql"
- name: Execute Openfire's database upgrade scripts
run: |
pushd ./build/ci/updater
./mvnw -B clean package exec:java -Dexec.args="$GITHUB_WORKSPACE"
sqlserver-install:
name: Test MS SQL Server install script
needs: [build, should-do-database-tests, check_branch]
runs-on: ubuntu-latest
if: ${{ needs.should-do-database-tests.outputs.check == 'true' || needs.check_branch.outputs.is_publishable_branch == 'true'}}
steps:
- name: Checkout Openfire
uses: actions/checkout@v7
- name: Set up JDK 17 Zulu
uses: actions/setup-java@v5
with:
java-version: 17
distribution: zulu
cache: maven
- name: Cache Maven wrapper distribution
uses: actions/cache@v5
with:
path: ~/.m2/wrapper
key: ${{ runner.os }}-mvn-wrapper-${{ hashFiles('.mvn/wrapper/maven-wrapper.properties', 'build/ci/updater/.mvn/wrapper/maven-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-mvn-wrapper-
- name: Restore mvn repo artifacts from build job
uses: actions/download-artifact@v8
with:
name: Maven Repository
path: ~/.m2/repository/org/igniterealtime/openfire/
- name: Set environment variables
run: |
echo "CONNECTION_STRING=jdbc:sqlserver://localhost:1433;databaseName=openfire;applicationName=Openfire;encrypt=false" >> $GITHUB_ENV
echo "CONNECTION_DRIVER=com.microsoft.sqlserver.jdbc.SQLServerDriver" >> $GITHUB_ENV
echo "CONNECTION_USERNAME=sa" >> $GITHUB_ENV
echo "CONNECTION_PASSWORD=SecurePa55w0rd" >> $GITHUB_ENV
OPENFIREVSN=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout)
echo "OPENFIREVSN=$OPENFIREVSN" >> $GITHUB_ENV
echo "JAVA_HOME=$(echo $JAVA_HOME_17_X64)" >> $GITHUB_ENV
- name: Start database server with an empty database
run: |
mkdir olddb
echo 'CREATE DATABASE openfire;' > $GITHUB_WORKSPACE/olddb/1-init-empty-database.sql
docker compose -f ./build/ci/compose/mssql.yml up --detach
- name: Execute Openfire's database install script
run: |
pushd ./build/ci/updater
./mvnw -B clean package exec:java -Dexec.args="$GITHUB_WORKSPACE"
sqlserver-upgrade:
name: Test MS SQL Server upgrade scripts
needs: [build, should-do-database-tests, check_branch]
runs-on: ubuntu-latest
if: ${{ needs.should-do-database-tests.outputs.check == 'true' || needs.check_branch.outputs.is_publishable_branch == 'true'}}
steps:
- name: Checkout Openfire
uses: actions/checkout@v7
- name: Set up JDK 17 Zulu
uses: actions/setup-java@v5
with:
java-version: 17
distribution: zulu
cache: maven
- name: Cache Maven wrapper distribution
uses: actions/cache@v5
with:
path: ~/.m2/wrapper
key: ${{ runner.os }}-mvn-wrapper-${{ hashFiles('.mvn/wrapper/maven-wrapper.properties', 'build/ci/updater/.mvn/wrapper/maven-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-mvn-wrapper-
- name: Restore mvn repo artifacts from build job
uses: actions/download-artifact@v8
with:
name: Maven Repository
path: ~/.m2/repository/org/igniterealtime/openfire/
- name: Set environment variables
run: |
echo "CONNECTION_STRING=jdbc:sqlserver://localhost:1433;databaseName=openfire;applicationName=Openfire;encrypt=false" >> $GITHUB_ENV
echo "CONNECTION_DRIVER=com.microsoft.sqlserver.jdbc.SQLServerDriver" >> $GITHUB_ENV
echo "CONNECTION_USERNAME=sa" >> $GITHUB_ENV
echo "CONNECTION_PASSWORD=SecurePa55w0rd" >> $GITHUB_ENV
OPENFIREVSN=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout)
echo "OPENFIREVSN=$OPENFIREVSN" >> $GITHUB_ENV
echo "JAVA_HOME=$(echo $JAVA_HOME_17_X64)" >> $GITHUB_ENV
- name: Download an old Openfire database installation script
run: |
mkdir olddb
curl https://raw.githubusercontent.com/igniterealtime/Openfire/v4.3.0/distribution/src/database/openfire_sqlserver.sql > $GITHUB_WORKSPACE/olddb/openfire_sqlserver.sql
- name: Start database server, install old version of the Openfire database
run: docker compose -f ./build/ci/compose/mssql.yml up --detach
- name: Execute Openfire's database upgrade scripts
run: |
pushd ./build/ci/updater
./mvnw -B clean package exec:java -Dexec.args="$GITHUB_WORKSPACE"
postgres-install:
name: Test Postgres install script
needs: [build, should-do-database-tests, check_branch]
runs-on: ubuntu-latest
if: ${{ needs.should-do-database-tests.outputs.check == 'true' || needs.check_branch.outputs.is_publishable_branch == 'true'}}
steps:
- name: Checkout Openfire
uses: actions/checkout@v7
- name: Set up JDK 17 Zulu
uses: actions/setup-java@v5
with:
java-version: 17
distribution: zulu
cache: maven
- name: Cache Maven wrapper distribution
uses: actions/cache@v5
with:
path: ~/.m2/wrapper
key: ${{ runner.os }}-mvn-wrapper-${{ hashFiles('.mvn/wrapper/maven-wrapper.properties', 'build/ci/updater/.mvn/wrapper/maven-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-mvn-wrapper-
- name: Restore mvn repo artifacts from build job
uses: actions/download-artifact@v8
with:
name: Maven Repository
path: ~/.m2/repository/org/igniterealtime/openfire/
- name: Set environment variables
run: |
echo "CONNECTION_STRING=jdbc:postgresql://localhost:5432/openfire" >> $GITHUB_ENV
echo "CONNECTION_DRIVER=org.postgresql.Driver" >> $GITHUB_ENV
echo "CONNECTION_USERNAME=openfire" >> $GITHUB_ENV
echo "CONNECTION_PASSWORD=SecurePa55w0rd" >> $GITHUB_ENV
OPENFIREVSN=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout)
echo "OPENFIREVSN=$OPENFIREVSN" >> $GITHUB_ENV
echo "JAVA_HOME=$(echo $JAVA_HOME_17_X64)" >> $GITHUB_ENV
- name: Start database server with an empty database
run: |
docker compose -f ./build/ci/compose/postgresql.yml up --wait
- name: Execute Openfire's database install script
run: |
pushd ./build/ci/updater
./mvnw -B clean package exec:java -Dexec.args="$GITHUB_WORKSPACE"
postgres-upgrade:
name: Test Postgres upgrade scripts
needs: [build, should-do-database-tests, check_branch]
runs-on: ubuntu-latest
if: ${{ needs.should-do-database-tests.outputs.check == 'true' || needs.check_branch.outputs.is_publishable_branch == 'true'}}
steps:
- name: Checkout Openfire
uses: actions/checkout@v7
- name: Set up JDK 17 Zulu
uses: actions/setup-java@v5
with:
java-version: 17
distribution: zulu
cache: maven
- name: Cache Maven wrapper distribution
uses: actions/cache@v5
with:
path: ~/.m2/wrapper
key: ${{ runner.os }}-mvn-wrapper-${{ hashFiles('.mvn/wrapper/maven-wrapper.properties', 'build/ci/updater/.mvn/wrapper/maven-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-mvn-wrapper-
- name: Restore mvn repo artifacts from build job
uses: actions/download-artifact@v8
with:
name: Maven Repository
path: ~/.m2/repository/org/igniterealtime/openfire/
- name: Set environment variables
run: |
echo "CONNECTION_STRING=jdbc:postgresql://localhost:5432/openfire" >> $GITHUB_ENV
echo "CONNECTION_DRIVER=org.postgresql.Driver" >> $GITHUB_ENV
echo "CONNECTION_USERNAME=openfire" >> $GITHUB_ENV
echo "CONNECTION_PASSWORD=SecurePa55w0rd" >> $GITHUB_ENV
OPENFIREVSN=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout)
echo "OPENFIREVSN=$OPENFIREVSN" >> $GITHUB_ENV
echo "JAVA_HOME=$(echo $JAVA_HOME_17_X64)" >> $GITHUB_ENV
- name: Download an old Openfire database installation script
run: |
mkdir olddb
curl https://raw.githubusercontent.com/igniterealtime/Openfire/v4.3.0/distribution/src/database/openfire_postgresql.sql > $GITHUB_WORKSPACE/olddb/openfire_postgresql.sql
- name: Start database server, install old version of the Openfire database
run: docker compose -f ./build/ci/compose/postgresql.yml up --wait
- name: Execute Openfire's database upgrade scripts
run: |
pushd ./build/ci/updater
./mvnw -B clean package exec:java -Dexec.args="$GITHUB_WORKSPACE"
firebird-install:
name: Test Firebird install script
needs: [build, should-do-database-tests, check_branch]
runs-on: ubuntu-latest
if: ${{ needs.should-do-database-tests.outputs.check == 'true' || needs.check_branch.outputs.is_publishable_branch == 'true'}}
steps:
- name: Checkout Openfire
uses: actions/checkout@v7
- name: Set up JDK 17 Zulu
uses: actions/setup-java@v5
with:
java-version: 17
distribution: zulu
cache: maven
- name: Restore mvn repo artifacts from build job
uses: actions/download-artifact@v8
with:
name: Maven Repository
path: ~/.m2/repository/org/igniterealtime/openfire/
- name: Set environment variables
run: |
echo "CONNECTION_STRING=jdbc:firebirdsql://localhost:3050/openfire.fdb" >> $GITHUB_ENV
echo "CONNECTION_DRIVER=org.firebirdsql.jdbc.FBDriver" >> $GITHUB_ENV
echo "CONNECTION_USERNAME=sysdba" >> $GITHUB_ENV
echo "CONNECTION_PASSWORD=SecurePa55w0rd" >> $GITHUB_ENV
OPENFIREVSN=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout)
echo "OPENFIREVSN=$OPENFIREVSN" >> $GITHUB_ENV
echo "JAVA_HOME=$(echo $JAVA_HOME_17_X64)" >> $GITHUB_ENV
- name: Start database server with an empty database
run: |
mkdir olddb
docker compose -f ./build/ci/compose/firebird.yml up --wait
- name: Execute Openfire's database install script
run: |
pushd ./build/ci/updater
./mvnw -B clean package exec:java -Dexec.args="$GITHUB_WORKSPACE"
# Firebird support was added recently and upgrade scripts are not available yet by virtue of support being new.
# Skip Firebird upgrade execution until the target upgrade directory exists. This step can be removed completely
# after things have matured.
firebird-upgrade-precheck:
name: Check Firebird upgrade prerequisites
needs: [should-do-database-tests, check_branch]
runs-on: ubuntu-latest
if: ${{ needs.should-do-database-tests.outputs.check == 'true' || needs.check_branch.outputs.is_publishable_branch == 'true'}}
outputs:
upgrade-dir-exists: ${{ steps.check-firebird-upgrade-dir.outputs.exists }}
steps:
- name: Checkout Openfire
uses: actions/checkout@v7
- name: Check if Firebird upgrade directory exists
id: check-firebird-upgrade-dir
run: |
if [ -d distribution/src/database/upgrade/39 ]; then
echo "exists=true" >> "$GITHUB_OUTPUT"
else
echo "exists=false" >> "$GITHUB_OUTPUT"
echo "Skipping firebird-upgrade: Firebird support is new and upgrade scripts are not available yet."
fi
firebird-upgrade:
name: Test Firebird upgrade scripts
needs: [build, should-do-database-tests, check_branch, firebird-upgrade-precheck]
runs-on: ubuntu-latest
if: ${{ needs.should-do-database-tests.outputs.check == 'true' || needs.check_branch.outputs.is_publishable_branch == 'true' }}
steps:
- name: Skip Firebird upgrade test when scripts are not available yet
if: ${{ needs.firebird-upgrade-precheck.outputs.upgrade-dir-exists != 'true' }}
run: 'echo "Skipping firebird-upgrade: Firebird support is new and upgrade scripts are not available yet."'
- name: Checkout Openfire
if: ${{ needs.firebird-upgrade-precheck.outputs.upgrade-dir-exists == 'true' }}
uses: actions/checkout@v7
- name: Set up JDK 17 Zulu
if: ${{ needs.firebird-upgrade-precheck.outputs.upgrade-dir-exists == 'true' }}
uses: actions/setup-java@v5
with:
java-version: 17
distribution: zulu
cache: maven
- name: Restore mvn repo artifacts from build job
if: ${{ needs.firebird-upgrade-precheck.outputs.upgrade-dir-exists == 'true' }}
uses: actions/download-artifact@v8
with:
name: Maven Repository
path: ~/.m2/repository/org/igniterealtime/openfire/
- name: Set environment variables
if: ${{ needs.firebird-upgrade-precheck.outputs.upgrade-dir-exists == 'true' }}
run: |
echo "CONNECTION_STRING=jdbc:firebirdsql://localhost:3050/openfire.fdb" >> $GITHUB_ENV
echo "CONNECTION_DRIVER=org.firebirdsql.jdbc.FBDriver" >> $GITHUB_ENV
echo "CONNECTION_USERNAME=sysdba" >> $GITHUB_ENV
echo "CONNECTION_PASSWORD=SecurePa55w0rd" >> $GITHUB_ENV
OPENFIREVSN=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout)
echo "OPENFIREVSN=$OPENFIREVSN" >> $GITHUB_ENV
echo "JAVA_HOME=$(echo $JAVA_HOME_17_X64)" >> $GITHUB_ENV
- name: Download an old Openfire database installation script
if: ${{ needs.firebird-upgrade-precheck.outputs.upgrade-dir-exists == 'true' }}
run: |
mkdir olddb
curl https://raw.githubusercontent.com/igniterealtime/Openfire/v5.1.0/distribution/src/database/openfire_firebird.sql > $GITHUB_WORKSPACE/olddb/openfire_firebird.sql
- name: Start database server, install old version of the Openfire database
if: ${{ needs.firebird-upgrade-precheck.outputs.upgrade-dir-exists == 'true' }}
run: docker compose -f ./build/ci/compose/firebird.yml up --wait
- name: Execute Openfire's database upgrade scripts
if: ${{ needs.firebird-upgrade-precheck.outputs.upgrade-dir-exists == 'true' }}
run: |
pushd ./build/ci/updater
./mvnw -B clean package exec:java -Dexec.args="$GITHUB_WORKSPACE"
cockroachdb-install:
name: Test CockroachDB install script
needs: [build, should-do-database-tests, check_branch]
runs-on: ubuntu-latest
if: ${{ needs.should-do-database-tests.outputs.check == 'true' || needs.check_branch.outputs.is_publishable_branch == 'true'}}
steps:
- name: Checkout Openfire
uses: actions/checkout@v7
- name: Set up JDK 17 Zulu
uses: actions/setup-java@v5
with:
java-version: 17
distribution: zulu
cache: maven
- name: Restore mvn repo artifacts from build job
uses: actions/download-artifact@v8
with:
name: Maven Repository
path: ~/.m2/repository/org/igniterealtime/openfire/
- name: Set environment variables
run: |
echo "CONNECTION_STRING=jdbc:postgresql://localhost:26257/openfire?sslmode=disable" >> $GITHUB_ENV
echo "CONNECTION_DRIVER=org.postgresql.Driver" >> $GITHUB_ENV
echo "CONNECTION_USERNAME=root" >> $GITHUB_ENV
echo "CONNECTION_PASSWORD=" >> $GITHUB_ENV
OPENFIREVSN=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout)
echo "OPENFIREVSN=$OPENFIREVSN" >> $GITHUB_ENV
echo "JAVA_HOME=$(echo $JAVA_HOME_17_X64)" >> $GITHUB_ENV
- name: Start database server and create empty database
run: |
docker compose -f ./build/ci/compose/cockroachdb.yml up --wait
docker compose -f ./build/ci/compose/cockroachdb.yml exec -T db /cockroach/cockroach sql --insecure --execute="CREATE DATABASE openfire;"
- name: Execute Openfire's database install script
run: |
pushd ./build/ci/updater
./mvnw -B clean package exec:java -Dexec.args="$GITHUB_WORKSPACE"
# CockroachDB support was added recently and upgrade scripts are not available yet by virtue of support being new.
# Skip CockroachDB upgrade execution until the target upgrade directory exists. This step can be removed completely
# after things have matured.
cockroachdb-upgrade-precheck:
name: Check CockroachDB upgrade prerequisites
needs: [should-do-database-tests, check_branch]
runs-on: ubuntu-latest
if: ${{ needs.should-do-database-tests.outputs.check == 'true' || needs.check_branch.outputs.is_publishable_branch == 'true'}}
outputs:
upgrade-dir-exists: ${{ steps.check-cockroachdb-upgrade-dir.outputs.exists }}
steps:
- name: Checkout Openfire
uses: actions/checkout@v7
- name: Check if CockroachDB upgrade directory exists
id: check-cockroachdb-upgrade-dir
# CockroachDB support was added recently and upgrade scripts are not available yet by virtue of support being new.
# Skip CockroachDB upgrade execution until the target upgrade directory exists.
run: |
if [ -d distribution/src/database/upgrade/39 ]; then
echo "exists=true" >> "$GITHUB_OUTPUT"
else
echo "exists=false" >> "$GITHUB_OUTPUT"
echo "Skipping cockroachdb-upgrade: CockroachDB support is new and upgrade scripts are not available yet."
fi
cockroachdb-upgrade:
name: Test CockroachDB upgrade scripts
needs: [build, should-do-database-tests, check_branch, cockroachdb-upgrade-precheck]
runs-on: ubuntu-latest
if: ${{ needs.should-do-database-tests.outputs.check == 'true' || needs.check_branch.outputs.is_publishable_branch == 'true'}}
steps:
- name: Skip CockroachDB upgrade test when scripts are not available yet
if: ${{ needs.cockroachdb-upgrade-precheck.outputs.upgrade-dir-exists != 'true' }}
run: 'echo "Skipping cockroachdb-upgrade: CockroachDB support is new and upgrade scripts are not available yet."'
- name: Checkout Openfire
if: ${{ needs.cockroachdb-upgrade-precheck.outputs.upgrade-dir-exists == 'true' }}
uses: actions/checkout@v7
- name: Set up JDK 17 Zulu
if: ${{ needs.cockroachdb-upgrade-precheck.outputs.upgrade-dir-exists == 'true' }}
uses: actions/setup-java@v5
with:
java-version: 17
distribution: zulu
cache: maven
- name: Restore mvn repo artifacts from build job
if: ${{ needs.cockroachdb-upgrade-precheck.outputs.upgrade-dir-exists == 'true' }}
uses: actions/download-artifact@v8
with:
name: Maven Repository
path: ~/.m2/repository/org/igniterealtime/openfire/
- name: Set environment variables
if: ${{ needs.cockroachdb-upgrade-precheck.outputs.upgrade-dir-exists == 'true' }}
run: |
echo "CONNECTION_STRING=jdbc:postgresql://localhost:26257/openfire?sslmode=disable" >> $GITHUB_ENV
echo "CONNECTION_DRIVER=org.postgresql.Driver" >> $GITHUB_ENV
echo "CONNECTION_USERNAME=root" >> $GITHUB_ENV
echo "CONNECTION_PASSWORD=" >> $GITHUB_ENV
OPENFIREVSN=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout)
echo "OPENFIREVSN=$OPENFIREVSN" >> $GITHUB_ENV
echo "JAVA_HOME=$(echo $JAVA_HOME_17_X64)" >> $GITHUB_ENV
- name: Download an old Openfire database installation script
if: ${{ needs.cockroachdb-upgrade-precheck.outputs.upgrade-dir-exists == 'true' }}
run: |
mkdir olddb
curl https://raw.githubusercontent.com/igniterealtime/Openfire/v5.1.0/distribution/src/database/openfire_cockroachdb.sql > $GITHUB_WORKSPACE/olddb/openfire_cockroachdb.sql
- name: Start database server, install old version of the Openfire database
if: ${{ needs.cockroachdb-upgrade-precheck.outputs.upgrade-dir-exists == 'true' }}
run: |
docker compose -f ./build/ci/compose/cockroachdb.yml up --wait
docker compose -f ./build/ci/compose/cockroachdb.yml exec -T db /cockroach/cockroach sql --insecure --execute="CREATE DATABASE openfire;"
docker compose -f ./build/ci/compose/cockroachdb.yml exec -T db /cockroach/cockroach sql --insecure --database=openfire < "$GITHUB_WORKSPACE/olddb/openfire_cockroachdb.sql"
- name: Execute Openfire's database upgrade scripts
if: ${{ needs.cockroachdb-upgrade-precheck.outputs.upgrade-dir-exists == 'true' }}
run: |
pushd ./build/ci/updater
./mvnw -B clean package exec:java -Dexec.args="$GITHUB_WORKSPACE"
mysql-install:
name: Test MySQL install script
needs: [build, should-do-database-tests, check_branch]
runs-on: ubuntu-latest
if: ${{ needs.should-do-database-tests.outputs.check == 'true' || needs.check_branch.outputs.is_publishable_branch == 'true'}}
steps:
- name: Checkout Openfire
uses: actions/checkout@v7
- name: Set up JDK 17 Zulu
uses: actions/setup-java@v5
with:
java-version: 17
distribution: zulu
cache: maven
- name: Cache Maven wrapper distribution
uses: actions/cache@v5
with:
path: ~/.m2/wrapper
key: ${{ runner.os }}-mvn-wrapper-${{ hashFiles('.mvn/wrapper/maven-wrapper.properties', 'build/ci/updater/.mvn/wrapper/maven-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-mvn-wrapper-
- name: Restore mvn repo artifacts from build job
uses: actions/download-artifact@v8
with:
name: Maven Repository
path: ~/.m2/repository/org/igniterealtime/openfire/
- name: Set environment variables
run: |
echo "CONNECTION_STRING=jdbc:mysql://localhost:3306/openfire?rewriteBatchedStatements=true&characterEncoding=UTF-8&characterSetResults=UTF-8&serverTimezone=UTC" >> $GITHUB_ENV
echo "CONNECTION_DRIVER=com.mysql.cj.jdbc.Driver" >> $GITHUB_ENV
echo "CONNECTION_USERNAME=root" >> $GITHUB_ENV
echo "CONNECTION_PASSWORD=SecurePa55w0rd" >> $GITHUB_ENV
OPENFIREVSN=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout)
echo "OPENFIREVSN=$OPENFIREVSN" >> $GITHUB_ENV
echo "JAVA_HOME=$(echo $JAVA_HOME_17_X64)" >> $GITHUB_ENV
- name: Start database server with an empty database
run: |
mkdir olddb
echo 'CREATE TABLE imready AS (SELECT 1);' > $GITHUB_WORKSPACE/olddb/ZZZ-signal-ready.sql
docker compose -f ./build/ci/compose/mysql.yml up --detach --wait
- name: Build & run database tester
run: |
pushd ./build/ci/updater
./mvnw -B clean package exec:java -Dexec.args="$GITHUB_WORKSPACE"
mysql-upgrade:
name: Test MySQL upgrade scripts
needs: [build, should-do-database-tests, check_branch]
runs-on: ubuntu-latest
if: ${{ needs.should-do-database-tests.outputs.check == 'true' || needs.check_branch.outputs.is_publishable_branch == 'true'}}
steps:
- name: Checkout Openfire
uses: actions/checkout@v7
- name: Set up JDK 17 Zulu
uses: actions/setup-java@v5
with:
java-version: 17
distribution: zulu
cache: maven