Repository navigation
2331 lines (2107 loc) · 87.4 KB
/
Copy pathnative-packages.yml
File metadata and controls
2331 lines (2107 loc) · 87.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
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you 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
#
# https://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.
name: Build native release artifacts
on:
workflow_dispatch:
permissions:
contents: read
jobs:
prepare:
name: Prepare package versions
runs-on: ubuntu-24.04
outputs:
base_version: ${{ steps.versions.outputs.base_version }}
python_version: ${{ steps.versions.outputs.python_version }}
logical_version: ${{ steps.versions.outputs.logical_version }}
deb_version: ${{ steps.versions.outputs.deb_version }}
rpm_version: ${{ steps.versions.outputs.rpm_version }}
rpm_release: ${{ steps.versions.outputs.rpm_release }}
archive_version: ${{ steps.versions.outputs.archive_version }}
homebrew_version: ${{ steps.versions.outputs.homebrew_version }}
steps:
- name: Checkout repository
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Check packaging helpers and workflow contracts
run: |
python3 -m unittest discover -s packaging/tests -p 'test_*.py' -v
ruby packaging/tests/check_native_workflow.rb
- name: Upload CLI data from the source checkout
uses: actions/upload-artifact@v7
with:
name: native-cli-test-data
path: python/tests/resources/*.tsfile
if-no-files-found: error
retention-days: 14
- name: Generate package versions
id: versions
run: |
python3 packaging/scripts/native_package_versions.py \
--cmake-file cpp/CMakeLists.txt \
--json-out versions.json \
--github-output "$GITHUB_OUTPUT"
- name: Upload package versions
uses: actions/upload-artifact@v7
with:
name: native-package-versions
path: versions.json
if-no-files-found: error
retention-days: 14
build-deb:
name: Build Ubuntu 22.04 C++ SDK and DEB packages
needs: prepare
runs-on: ubuntu-22.04
timeout-minutes: 45
steps:
- name: Checkout repository
uses: actions/checkout@v7
- name: Set up Java 17
uses: actions/setup-java@v6.0.0
with:
distribution: temurin
java-version: "17"
- name: Install DEB build prerequisites
run: |
sudo apt-get update
sudo apt-get install -y \
build-essential \
cmake \
pkg-config \
dpkg-dev \
uuid-dev
- name: Build C++ core and CPack metadata with Maven
env:
ARCHIVE_VERSION: ${{ needs.prepare.outputs.archive_version }}
DEBIAN_VERSION: ${{ needs.prepare.outputs.deb_version }}
RPM_VERSION: ${{ needs.prepare.outputs.rpm_version }}
RPM_RELEASE: ${{ needs.prepare.outputs.rpm_release }}
shell: bash
run: |
./mvnw -Pwith-cpp package \
-Dbuild.type=Release \
-Dbuild.test=OFF \
-DskipTests \
-Dspotless.skip=true \
-Dtsfile.dependency.source=BUNDLED \
-Dtsfile.version.sync.skip=true \
-Denable.cpack=ON \
-Dtsfile.archive.version="$ARCHIVE_VERSION" \
-Dtsfile.debian.package.version="$DEBIAN_VERSION" \
-Dtsfile.rpm.package.version="$RPM_VERSION" \
-Dtsfile.rpm.package.release="$RPM_RELEASE"
test -f cpp/target/build/CPackConfig.cmake
- name: Stage and verify the Ubuntu SDK
env:
ARCHIVE_VERSION: ${{ needs.prepare.outputs.archive_version }}
shell: bash
run: |
sdk_name="tsfile-sdk-ubuntu22.04-amd64-$ARCHIVE_VERSION"
sdk_root="$PWD/sdk/$sdk_name"
cmake --install cpp/target/build --prefix "$sdk_root"
test -f "$sdk_root/bin/tsfile-cli"
test -d "$sdk_root/include"
test -n "$(find "$sdk_root" -maxdepth 2 -name 'libtsfile.so*' -print -quit)"
sdk_pkgconfig="$(find "$sdk_root" -type f -name libtsfile.pc -print -quit)"
test -n "$sdk_pkgconfig"
"$sdk_root/bin/tsfile-cli" --version
PKG_CONFIG_PATH="$(dirname "$sdk_pkgconfig")" pkg-config --cflags --libs libtsfile
cmake -S cpp/cmake/tests/projects/InstalledConsumer -B consumer/deb \
-DCMAKE_PREFIX_PATH="$sdk_root"
cmake --build consumer/deb --parallel
./consumer/deb/tsfile_installed_consumer
tar -C sdk -czf "$sdk_root.tar.gz" "$sdk_name"
rm -rf "$sdk_root"
- name: Build and verify DEB packages
env:
EXPECTED_DEB_VERSION: ${{ needs.prepare.outputs.deb_version }}
shell: bash
run: |
mkdir -p packages
cpack -G DEB --config cpp/target/build/CPackConfig.cmake -B packages
mapfile -t packages < <(find packages -maxdepth 1 -type f -name '*.deb' -print | sort)
if [[ ${#packages[@]} -ne 3 ]]; then
printf 'Expected exactly 3 DEB packages, found %s\n' "${#packages[@]}"
exit 1
fi
actual_names="$({
for package in "${packages[@]}"; do
dpkg-deb --field "$package" Package
done
} | sort)"
expected_names="$(printf '%s\n' tsfile tsfile-dev tsfile-tools | sort)"
if [[ "$actual_names" != "$expected_names" ]]; then
printf 'Unexpected DEB package names:\n%s\n' "$actual_names"
exit 1
fi
for package in "${packages[@]}"; do
package_version="$(dpkg-deb --field "$package" Version)"
if [[ "$package_version" != "$EXPECTED_DEB_VERSION" ]]; then
printf '%s has version %s, expected %s\n' \
"$package" "$package_version" "$EXPECTED_DEB_VERSION"
exit 1
fi
done
- name: Upload Ubuntu SDK
uses: actions/upload-artifact@v7
with:
name: native-sdk-ubuntu22.04-amd64
path: sdk/*.tar.gz
if-no-files-found: error
retention-days: 14
- name: Upload DEB packages
uses: actions/upload-artifact@v7
with:
name: native-deb-ubuntu22.04-amd64
path: packages/*.deb
if-no-files-found: error
retention-days: 14
test-deb:
name: Test DEB packages on ${{ matrix.container }}
needs: build-deb
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
container:
- ubuntu:22.04
- ubuntu:24.04
container: ${{ matrix.container }}
timeout-minutes: 45
steps:
- name: Checkout installation test sources
uses: actions/checkout@v7
with:
sparse-checkout: |
packaging/tests
packaging/cmake/InstalledGTest
cpp/test
cpp/cmake/tests/projects/InstalledConsumer
go
sparse-checkout-cone-mode: false
- name: Download CLI test data
uses: actions/download-artifact@v8
with:
name: native-cli-test-data
path: cli-test-data
- name: Download DEB packages
uses: actions/download-artifact@v8
with:
name: native-deb-ubuntu22.04-amd64
path: packages
- name: Install DEB packages
shell: bash
run: |
apt-get update
apt-get install -y ./packages/*.deb cmake build-essential python3 pkg-config git curl ca-certificates
- name: Set up Go for installed-package tests
uses: actions/setup-go@v7
with:
go-version: "1.26.x"
cache-dependency-path: go/go.sum
- name: Verify installed DEB packages
shell: bash
run: |
cli_path="$(command -v tsfile-cli)"
cli_path="$(readlink -f -- "$cli_path")"
cli_owner="$(dpkg-query -S "$cli_path")"
cli_owner="${cli_owner%%:*}"
if [[ "$cli_owner" != "tsfile-tools" ]]; then
printf '%s is owned by %s, expected tsfile-tools\n' "$cli_path" "$cli_owner"
exit 1
fi
tsfile-cli --version
dpkg-query -W tsfile tsfile-dev tsfile-tools
- name: Build and run an installed-package consumer
shell: bash
run: |
cmake -S cpp/cmake/tests/projects/InstalledConsumer -B consumer/build
cmake --build consumer/build --parallel
./consumer/build/tsfile_installed_consumer
- name: Test the installed CLI with Python test data
shell: bash
run: |
python3 packaging/tests/cli_package_smoke.py \
--cli "$(command -v tsfile-cli)" --resources cli-test-data
- name: Compile and run C++ regressions against the installed SDK
shell: bash
run: |
python3 packaging/tests/cpp_installed_tests.py \
--prefix /usr --build-dir installed-tests
- name: Run Go tests against the installed SDK
shell: bash
run: |
python3 packaging/tests/go_installed_tests.py \
--prefix /usr --goarch amd64
- name: Download the standalone SDK archive
uses: actions/download-artifact@v8
with:
name: native-sdk-ubuntu22.04-amd64
path: sdk-download
- name: Test the downloaded and relocated SDK archive
shell: bash
run: |
python3 packaging/tests/sdk_archive_tests.py \
--archives sdk-download --destination downloaded-sdk --build-dir sdk-tests \
--resources cli-test-data --goarch amd64 \
--gtest-prefix installed-tests/dependencies
- name: Upload C++ installation test results
if: always()
uses: actions/upload-artifact@v7
with:
name: native-cpp-tests-${{ github.job }}-${{ runner.arch }}-${{ strategy.job-index }}
path: |
installed-tests/cpp-results.xml
installed-tests/tests/Testing/Temporary/LastTest.log
sdk-tests/cpp-results.xml
sdk-tests/tests/Testing/Temporary/LastTest.log
if-no-files-found: ignore
retention-days: 14
build-deb-arm64:
name: Build Ubuntu 22.04 ARM64 C++ SDK and DEB packages
needs: prepare
runs-on: ubuntu-22.04-arm
timeout-minutes: 45
steps:
- name: Checkout repository
uses: actions/checkout@v7
- name: Set up Java 17
uses: actions/setup-java@v6.0.0
with:
distribution: temurin
java-version: "17"
- name: Install DEB build prerequisites
run: |
sudo apt-get update
sudo apt-get install -y \
build-essential \
cmake \
pkg-config \
dpkg-dev \
uuid-dev
- name: Verify native ARM64 runner
run: test "$(dpkg --print-architecture)" = arm64
- name: Build C++ core and CPack metadata with Maven
env:
ARCHIVE_VERSION: ${{ needs.prepare.outputs.archive_version }}
DEBIAN_VERSION: ${{ needs.prepare.outputs.deb_version }}
RPM_VERSION: ${{ needs.prepare.outputs.rpm_version }}
RPM_RELEASE: ${{ needs.prepare.outputs.rpm_release }}
shell: bash
run: |
./mvnw -Pwith-cpp package \
-Dbuild.type=Release \
-Dbuild.test=OFF \
-DskipTests \
-Dspotless.skip=true \
-Dtsfile.dependency.source=BUNDLED \
-Dtsfile.version.sync.skip=true \
-Denable.cpack=ON \
-Dtsfile.archive.version="$ARCHIVE_VERSION" \
-Dtsfile.debian.package.version="$DEBIAN_VERSION" \
-Dtsfile.rpm.package.version="$RPM_VERSION" \
-Dtsfile.rpm.package.release="$RPM_RELEASE"
test -f cpp/target/build/CPackConfig.cmake
- name: Stage and verify the Ubuntu ARM64 SDK
env:
ARCHIVE_VERSION: ${{ needs.prepare.outputs.archive_version }}
shell: bash
run: |
sdk_name="tsfile-sdk-ubuntu22.04-arm64-$ARCHIVE_VERSION"
sdk_root="$PWD/sdk/$sdk_name"
cmake --install cpp/target/build --prefix "$sdk_root"
test -f "$sdk_root/bin/tsfile-cli"
test -d "$sdk_root/include"
test -n "$(find "$sdk_root" -maxdepth 2 -name 'libtsfile.so*' -print -quit)"
sdk_pkgconfig="$(find "$sdk_root" -type f -name libtsfile.pc -print -quit)"
test -n "$sdk_pkgconfig"
"$sdk_root/bin/tsfile-cli" --version
PKG_CONFIG_PATH="$(dirname "$sdk_pkgconfig")" pkg-config --cflags --libs libtsfile
cmake -S cpp/cmake/tests/projects/InstalledConsumer -B consumer/deb-arm64 \
-DCMAKE_PREFIX_PATH="$sdk_root"
cmake --build consumer/deb-arm64 --parallel
./consumer/deb-arm64/tsfile_installed_consumer
tar -C sdk -czf "$sdk_root.tar.gz" "$sdk_name"
rm -rf "$sdk_root"
- name: Build and verify ARM64 DEB packages
env:
EXPECTED_DEB_VERSION: ${{ needs.prepare.outputs.deb_version }}
shell: bash
run: |
mkdir -p packages
cpack -G DEB --config cpp/target/build/CPackConfig.cmake -B packages
mapfile -t packages < <(find packages -maxdepth 1 -type f -name '*.deb' -print | sort)
[[ ${#packages[@]} -eq 3 ]]
actual_names="$({ for package in "${packages[@]}"; do dpkg-deb --field "$package" Package; done; } | sort)"
expected_names="$(printf '%s\n' tsfile tsfile-dev tsfile-tools | sort)"
[[ "$actual_names" == "$expected_names" ]]
for package in "${packages[@]}"; do
[[ "$(dpkg-deb --field "$package" Architecture)" == arm64 ]]
[[ "$(dpkg-deb --field "$package" Version)" == "$EXPECTED_DEB_VERSION" ]]
done
- name: Upload Ubuntu ARM64 SDK
uses: actions/upload-artifact@v7
with:
name: native-sdk-ubuntu22.04-arm64
path: sdk/*.tar.gz
if-no-files-found: error
retention-days: 14
- name: Upload ARM64 DEB packages
uses: actions/upload-artifact@v7
with:
name: native-deb-ubuntu22.04-arm64
path: packages/*.deb
if-no-files-found: error
retention-days: 14
test-deb-arm64:
name: Test ARM64 DEB packages on ${{ matrix.container }}
needs: build-deb-arm64
runs-on: ubuntu-24.04-arm
strategy:
fail-fast: false
matrix:
container:
- ubuntu:22.04
- ubuntu:24.04
container: ${{ matrix.container }}
timeout-minutes: 45
steps:
- name: Checkout installation test sources
uses: actions/checkout@v7
with:
sparse-checkout: |
packaging/tests
packaging/cmake/InstalledGTest
cpp/test
cpp/cmake/tests/projects/InstalledConsumer
go
sparse-checkout-cone-mode: false
- name: Download CLI test data
uses: actions/download-artifact@v8
with:
name: native-cli-test-data
path: cli-test-data
- name: Download ARM64 DEB packages
uses: actions/download-artifact@v8
with:
name: native-deb-ubuntu22.04-arm64
path: packages
- name: Install ARM64 DEB packages
shell: bash
run: |
test "$(dpkg --print-architecture)" = arm64
apt-get update
apt-get install -y ./packages/*.deb cmake build-essential python3 pkg-config git curl ca-certificates
- name: Set up Go for installed-package tests
uses: actions/setup-go@v7
with:
go-version: "1.26.x"
cache-dependency-path: go/go.sum
- name: Verify installed ARM64 DEB packages
shell: bash
run: |
cli_path="$(readlink -f -- "$(command -v tsfile-cli)")"
cli_owner="$(dpkg-query -S "$cli_path")"
cli_owner="${cli_owner%%:*}"
[[ "$cli_owner" == tsfile-tools ]]
tsfile-cli --version
dpkg-query -W tsfile tsfile-dev tsfile-tools
- name: Build and run an installed-package consumer
shell: bash
run: |
cmake -S cpp/cmake/tests/projects/InstalledConsumer -B consumer/build
cmake --build consumer/build --parallel
./consumer/build/tsfile_installed_consumer
- name: Test the installed CLI with Python test data
shell: bash
run: |
python3 packaging/tests/cli_package_smoke.py \
--cli "$(command -v tsfile-cli)" --resources cli-test-data
- name: Compile and run C++ regressions against the installed SDK
shell: bash
run: |
python3 packaging/tests/cpp_installed_tests.py \
--prefix /usr --build-dir installed-tests
- name: Run Go tests against the installed SDK
shell: bash
run: |
python3 packaging/tests/go_installed_tests.py \
--prefix /usr --goarch arm64
- name: Download the standalone SDK archive
uses: actions/download-artifact@v8
with:
name: native-sdk-ubuntu22.04-arm64
path: sdk-download
- name: Test the downloaded and relocated SDK archive
shell: bash
run: |
python3 packaging/tests/sdk_archive_tests.py \
--archives sdk-download --destination downloaded-sdk --build-dir sdk-tests \
--resources cli-test-data --goarch arm64 \
--gtest-prefix installed-tests/dependencies
- name: Upload C++ installation test results
if: always()
uses: actions/upload-artifact@v7
with:
name: native-cpp-tests-${{ github.job }}-${{ runner.arch }}-${{ strategy.job-index }}
path: |
installed-tests/cpp-results.xml
installed-tests/tests/Testing/Temporary/LastTest.log
sdk-tests/cpp-results.xml
sdk-tests/tests/Testing/Temporary/LastTest.log
if-no-files-found: ignore
retention-days: 14
build-rpm:
name: Build AlmaLinux 9 C++ SDK and RPM packages
needs: prepare
runs-on: ubuntu-24.04
container: almalinux:9
timeout-minutes: 45
steps:
- name: Install RPM build prerequisites
run: |
dnf install -y \
java-17-openjdk-devel \
cmake \
gcc-c++ \
make \
pkgconf-pkg-config \
rpm-build \
git \
curl-minimal \
tar \
gzip \
libuuid-devel
- name: Checkout repository
uses: actions/checkout@v7
- name: Build C++ core and CPack metadata with Maven
env:
ARCHIVE_VERSION: ${{ needs.prepare.outputs.archive_version }}
DEBIAN_VERSION: ${{ needs.prepare.outputs.deb_version }}
RPM_VERSION: ${{ needs.prepare.outputs.rpm_version }}
RPM_RELEASE: ${{ needs.prepare.outputs.rpm_release }}
shell: bash
run: |
./mvnw -Pwith-cpp package \
-Dbuild.type=Release \
-Dbuild.test=OFF \
-DskipTests \
-Dspotless.skip=true \
-Dtsfile.dependency.source=BUNDLED \
-Dtsfile.version.sync.skip=true \
-Denable.cpack=ON \
-Dtsfile.archive.version="$ARCHIVE_VERSION" \
-Dtsfile.debian.package.version="$DEBIAN_VERSION" \
-Dtsfile.rpm.package.version="$RPM_VERSION" \
-Dtsfile.rpm.package.release="$RPM_RELEASE"
test -f cpp/target/build/CPackConfig.cmake
- name: Stage and verify the AlmaLinux SDK
env:
ARCHIVE_VERSION: ${{ needs.prepare.outputs.archive_version }}
shell: bash
run: |
sdk_name="tsfile-sdk-almalinux9-x86_64-$ARCHIVE_VERSION"
sdk_root="$PWD/sdk/$sdk_name"
cmake --install cpp/target/build --prefix "$sdk_root"
test -f "$sdk_root/bin/tsfile-cli"
test -d "$sdk_root/include"
test -n "$(find "$sdk_root" -maxdepth 2 -name 'libtsfile.so*' -print -quit)"
sdk_pkgconfig="$(find "$sdk_root" -type f -name libtsfile.pc -print -quit)"
test -n "$sdk_pkgconfig"
"$sdk_root/bin/tsfile-cli" --version
PKG_CONFIG_PATH="$(dirname "$sdk_pkgconfig")" pkg-config --cflags --libs libtsfile
cmake -S cpp/cmake/tests/projects/InstalledConsumer -B consumer/rpm \
-DCMAKE_PREFIX_PATH="$sdk_root"
cmake --build consumer/rpm --parallel
./consumer/rpm/tsfile_installed_consumer
tar -C sdk -czf "$sdk_root.tar.gz" "$sdk_name"
rm -rf "$sdk_root"
- name: Build and verify RPM packages
env:
EXPECTED_RPM_VERSION: ${{ needs.prepare.outputs.rpm_version }}
EXPECTED_RPM_RELEASE: ${{ needs.prepare.outputs.rpm_release }}
shell: bash
run: |
mkdir -p packages
cpack -G RPM --config cpp/target/build/CPackConfig.cmake -B packages
mapfile -t packages < <(find packages -maxdepth 1 -type f -name '*.rpm' -print | sort)
if [[ ${#packages[@]} -ne 3 ]]; then
printf 'Expected exactly 3 RPM packages, found %s\n' "${#packages[@]}"
exit 1
fi
actual_names="$({
for package in "${packages[@]}"; do
rpm -qp --queryformat '%{NAME}\n' "$package"
done
} | sort)"
expected_names="$(printf '%s\n' tsfile tsfile-devel tsfile-tools | sort)"
if [[ "$actual_names" != "$expected_names" ]]; then
printf 'Unexpected RPM package names:\n%s\n' "$actual_names"
exit 1
fi
for package in "${packages[@]}"; do
package_version="$(rpm -qp --queryformat '%{VERSION}' "$package")"
package_release="$(rpm -qp --queryformat '%{RELEASE}' "$package")"
if [[ "$package_version" != "$EXPECTED_RPM_VERSION" ]]; then
printf '%s has version %s, expected %s\n' \
"$package" "$package_version" "$EXPECTED_RPM_VERSION"
exit 1
fi
if [[ "$package_release" != "$EXPECTED_RPM_RELEASE" ]]; then
printf '%s has release %s, expected %s\n' \
"$package" "$package_release" "$EXPECTED_RPM_RELEASE"
exit 1
fi
done
- name: Upload AlmaLinux SDK
uses: actions/upload-artifact@v7
with:
name: native-sdk-almalinux9-x86_64
path: sdk/*.tar.gz
if-no-files-found: error
retention-days: 14
- name: Upload RPM packages
uses: actions/upload-artifact@v7
with:
name: native-rpm-almalinux9-x86_64
path: packages/*.rpm
if-no-files-found: error
retention-days: 14
test-rpm:
name: Test RPM packages on AlmaLinux 9
needs: build-rpm
runs-on: ubuntu-24.04
container: almalinux:9
timeout-minutes: 45
steps:
- name: Checkout installation test sources
uses: actions/checkout@v7
with:
sparse-checkout: |
packaging/tests
packaging/cmake/InstalledGTest
cpp/test
cpp/cmake/tests/projects/InstalledConsumer
go
sparse-checkout-cone-mode: false
- name: Download CLI test data
uses: actions/download-artifact@v8
with:
name: native-cli-test-data
path: cli-test-data
- name: Download RPM packages
uses: actions/download-artifact@v8
with:
name: native-rpm-almalinux9-x86_64
path: packages
- name: Install RPM packages
run: dnf install -y packages/*.rpm cmake gcc-c++ python3 pkgconf-pkg-config git curl-minimal tar gzip
- name: Set up Go for installed-package tests
uses: actions/setup-go@v7
with:
go-version: "1.26.x"
cache-dependency-path: go/go.sum
- name: Verify installed RPM packages
shell: bash
run: |
cli_path="$(command -v tsfile-cli)"
cli_path="$(readlink -f -- "$cli_path")"
cli_owner="$(rpm -qf --queryformat '%{NAME}' "$cli_path")"
if [[ "$cli_owner" != "tsfile-tools" ]]; then
printf '%s is owned by %s, expected tsfile-tools\n' "$cli_path" "$cli_owner"
exit 1
fi
tsfile-cli --version
rpm -q tsfile tsfile-devel tsfile-tools
- name: Build and run an installed-package consumer
shell: bash
run: |
cmake -S cpp/cmake/tests/projects/InstalledConsumer -B consumer/build
cmake --build consumer/build --parallel
./consumer/build/tsfile_installed_consumer
- name: Test the installed CLI with Python test data
shell: bash
run: |
python3 packaging/tests/cli_package_smoke.py \
--cli "$(command -v tsfile-cli)" --resources cli-test-data
- name: Compile and run C++ regressions against the installed SDK
shell: bash
run: |
python3 packaging/tests/cpp_installed_tests.py \
--prefix /usr --build-dir installed-tests
- name: Run Go tests against the installed SDK
shell: bash
run: |
python3 packaging/tests/go_installed_tests.py \
--prefix /usr --goarch amd64
- name: Download the standalone SDK archive
uses: actions/download-artifact@v8
with:
name: native-sdk-almalinux9-x86_64
path: sdk-download
- name: Test the downloaded and relocated SDK archive
shell: bash
run: |
python3 packaging/tests/sdk_archive_tests.py \
--archives sdk-download --destination downloaded-sdk --build-dir sdk-tests \
--resources cli-test-data --goarch amd64 \
--gtest-prefix installed-tests/dependencies
- name: Upload C++ installation test results
if: always()
uses: actions/upload-artifact@v7
with:
name: native-cpp-tests-${{ github.job }}-${{ runner.arch }}-${{ strategy.job-index }}
path: |
installed-tests/cpp-results.xml
installed-tests/tests/Testing/Temporary/LastTest.log
sdk-tests/cpp-results.xml
sdk-tests/tests/Testing/Temporary/LastTest.log
if-no-files-found: ignore
retention-days: 14
build-rpm-aarch64:
name: Build AlmaLinux 9 aarch64 C++ SDK and RPM packages
needs: prepare
runs-on: ubuntu-24.04-arm
container: almalinux:9
timeout-minutes: 45
steps:
- name: Install RPM build prerequisites
run: |
test "$(uname -m)" = aarch64
dnf install -y \
java-17-openjdk-devel \
cmake \
gcc-c++ \
make \
pkgconf-pkg-config \
rpm-build \
git \
curl-minimal \
tar \
gzip \
libuuid-devel
- name: Checkout repository
uses: actions/checkout@v7
- name: Build C++ core and CPack metadata with Maven
env:
ARCHIVE_VERSION: ${{ needs.prepare.outputs.archive_version }}
DEBIAN_VERSION: ${{ needs.prepare.outputs.deb_version }}
RPM_VERSION: ${{ needs.prepare.outputs.rpm_version }}
RPM_RELEASE: ${{ needs.prepare.outputs.rpm_release }}
shell: bash
run: |
./mvnw -Pwith-cpp package \
-Dbuild.type=Release \
-Dbuild.test=OFF \
-DskipTests \
-Dspotless.skip=true \
-Dtsfile.dependency.source=BUNDLED \
-Dtsfile.version.sync.skip=true \
-Denable.cpack=ON \
-Dtsfile.archive.version="$ARCHIVE_VERSION" \
-Dtsfile.debian.package.version="$DEBIAN_VERSION" \
-Dtsfile.rpm.package.version="$RPM_VERSION" \
-Dtsfile.rpm.package.release="$RPM_RELEASE"
test -f cpp/target/build/CPackConfig.cmake
- name: Stage and verify the AlmaLinux aarch64 SDK
env:
ARCHIVE_VERSION: ${{ needs.prepare.outputs.archive_version }}
shell: bash
run: |
sdk_name="tsfile-sdk-almalinux9-aarch64-$ARCHIVE_VERSION"
sdk_root="$PWD/sdk/$sdk_name"
cmake --install cpp/target/build --prefix "$sdk_root"
test -f "$sdk_root/bin/tsfile-cli"
test -d "$sdk_root/include"
test -n "$(find "$sdk_root" -maxdepth 2 -name 'libtsfile.so*' -print -quit)"
sdk_pkgconfig="$(find "$sdk_root" -type f -name libtsfile.pc -print -quit)"
test -n "$sdk_pkgconfig"
"$sdk_root/bin/tsfile-cli" --version
PKG_CONFIG_PATH="$(dirname "$sdk_pkgconfig")" pkg-config --cflags --libs libtsfile
cmake -S cpp/cmake/tests/projects/InstalledConsumer -B consumer/rpm-aarch64 \
-DCMAKE_PREFIX_PATH="$sdk_root"
cmake --build consumer/rpm-aarch64 --parallel
./consumer/rpm-aarch64/tsfile_installed_consumer
tar -C sdk -czf "$sdk_root.tar.gz" "$sdk_name"
rm -rf "$sdk_root"
- name: Build and verify aarch64 RPM packages
env:
EXPECTED_RPM_VERSION: ${{ needs.prepare.outputs.rpm_version }}
EXPECTED_RPM_RELEASE: ${{ needs.prepare.outputs.rpm_release }}
shell: bash
run: |
mkdir -p packages
cpack -G RPM --config cpp/target/build/CPackConfig.cmake -B packages
mapfile -t packages < <(find packages -maxdepth 1 -type f -name '*.rpm' -print | sort)
[[ ${#packages[@]} -eq 3 ]]
actual_names="$({ for package in "${packages[@]}"; do rpm -qp --queryformat '%{NAME}\n' "$package"; done; } | sort)"
expected_names="$(printf '%s\n' tsfile tsfile-devel tsfile-tools | sort)"
[[ "$actual_names" == "$expected_names" ]]
for package in "${packages[@]}"; do
[[ "$(rpm -qp --queryformat '%{ARCH}' "$package")" == aarch64 ]]
[[ "$(rpm -qp --queryformat '%{VERSION}' "$package")" == "$EXPECTED_RPM_VERSION" ]]
[[ "$(rpm -qp --queryformat '%{RELEASE}' "$package")" == "$EXPECTED_RPM_RELEASE" ]]
done
- name: Upload AlmaLinux aarch64 SDK
uses: actions/upload-artifact@v7
with:
name: native-sdk-almalinux9-aarch64
path: sdk/*.tar.gz
if-no-files-found: error
retention-days: 14
- name: Upload aarch64 RPM packages
uses: actions/upload-artifact@v7
with:
name: native-rpm-almalinux9-aarch64
path: packages/*.rpm
if-no-files-found: error
retention-days: 14
test-rpm-aarch64:
name: Test RPM packages on AlmaLinux 9 aarch64
needs: build-rpm-aarch64
runs-on: ubuntu-24.04-arm
container: almalinux:9
timeout-minutes: 45
steps:
- name: Checkout installation test sources
uses: actions/checkout@v7
with:
sparse-checkout: |
packaging/tests
packaging/cmake/InstalledGTest
cpp/test
cpp/cmake/tests/projects/InstalledConsumer
go
sparse-checkout-cone-mode: false
- name: Download CLI test data
uses: actions/download-artifact@v8
with:
name: native-cli-test-data
path: cli-test-data
- name: Download aarch64 RPM packages
uses: actions/download-artifact@v8
with:
name: native-rpm-almalinux9-aarch64
path: packages
- name: Install aarch64 RPM packages
run: |
test "$(uname -m)" = aarch64
dnf install -y packages/*.rpm cmake gcc-c++ python3 pkgconf-pkg-config git curl-minimal tar gzip
- name: Set up Go for installed-package tests
uses: actions/setup-go@v7
with:
go-version: "1.26.x"
cache-dependency-path: go/go.sum
- name: Verify installed aarch64 RPM packages
shell: bash
run: |
cli_path="$(readlink -f -- "$(command -v tsfile-cli)")"
cli_owner="$(rpm -qf --queryformat '%{NAME}' "$cli_path")"
[[ "$cli_owner" == tsfile-tools ]]
tsfile-cli --version
rpm -q tsfile tsfile-devel tsfile-tools
- name: Build and run an installed-package consumer
shell: bash
run: |
cmake -S cpp/cmake/tests/projects/InstalledConsumer -B consumer/build
cmake --build consumer/build --parallel
./consumer/build/tsfile_installed_consumer
- name: Test the installed CLI with Python test data
shell: bash
run: |
python3 packaging/tests/cli_package_smoke.py \
--cli "$(command -v tsfile-cli)" --resources cli-test-data
- name: Compile and run C++ regressions against the installed SDK
shell: bash
run: |
python3 packaging/tests/cpp_installed_tests.py \
--prefix /usr --build-dir installed-tests
- name: Run Go tests against the installed SDK
shell: bash
run: |
python3 packaging/tests/go_installed_tests.py \
--prefix /usr --goarch arm64
- name: Download the standalone SDK archive
uses: actions/download-artifact@v8
with:
name: native-sdk-almalinux9-aarch64
path: sdk-download
- name: Test the downloaded and relocated SDK archive
shell: bash
run: |
python3 packaging/tests/sdk_archive_tests.py \
--archives sdk-download --destination downloaded-sdk --build-dir sdk-tests \
--resources cli-test-data --goarch arm64 \
--gtest-prefix installed-tests/dependencies
- name: Upload C++ installation test results
if: always()
uses: actions/upload-artifact@v7
with:
name: native-cpp-tests-${{ github.job }}-${{ runner.arch }}-${{ strategy.job-index }}
path: |
installed-tests/cpp-results.xml
installed-tests/tests/Testing/Temporary/LastTest.log
sdk-tests/cpp-results.xml
sdk-tests/tests/Testing/Temporary/LastTest.log
if-no-files-found: ignore
retention-days: 14
build-windows:
name: Build Windows MSVC C++ SDK and ZIP
needs: prepare
runs-on: windows-2022
timeout-minutes: 50
steps:
- name: Checkout repository
uses: actions/checkout@v7
- name: Set up Java 17
uses: actions/setup-java@v6.0.0
with:
distribution: temurin
java-version: "17"
- name: Configure the MSVC environment
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64
- name: Build C++ core and CPack metadata with Maven
env:
ARCHIVE_VERSION: ${{ needs.prepare.outputs.archive_version }}
DEBIAN_VERSION: ${{ needs.prepare.outputs.deb_version }}
RPM_VERSION: ${{ needs.prepare.outputs.rpm_version }}
RPM_RELEASE: ${{ needs.prepare.outputs.rpm_release }}
shell: pwsh
run: |
$ErrorActionPreference = 'Stop'
$PSNativeCommandUseErrorActionPreference = $true
$projectInclude = (Resolve-Path cpp/cmake/tests/CheckStaticMSVCRuntime.cmake).Path
.\mvnw.cmd -Pwith-cpp package `
"-Dcpp.toolchain=msvc" `
"-Dbuild.type=Release" `
"-Dbuild.test=OFF" `
"-DskipTests" `
"-Dspotless.skip=true" `
"-Dtsfile.dependency.source=BUNDLED" `
"-Dtsfile.msvc.static.runtime=ON" `
"-Denable.lzma2=ON" `