-
Notifications
You must be signed in to change notification settings - Fork 17
1022 lines (915 loc) · 32.8 KB
/
Copy pathci-build.yml
File metadata and controls
1022 lines (915 loc) · 32.8 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: CI Build
on:
workflow_call:
jobs:
checked:
name: checked-${{ matrix.platform }}
runs-on: ${{ matrix.runs-on }}
timeout-minutes: 20
env:
CFLAGS: -O2 -g -Werror
strategy:
fail-fast: true
matrix:
include:
- platform: ubuntu
runs-on: ubuntu-latest
- platform: windows
runs-on: windows-latest
- platform: macos
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Test bounded apt retries
if: matrix.platform == 'ubuntu'
run: bash .github/scripts/retry-apt-get-test.sh
- name: Install Linux build dependencies
if: matrix.platform == 'ubuntu'
run: |
bash .github/scripts/install-apt-deps.sh \
build-essential ripgrep tcl-dev zlib1g-dev
- name: Install Windows build dependencies
if: matrix.platform == 'windows'
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
install: mingw-w64-x86_64-gcc mingw-w64-x86_64-python mingw-w64-x86_64-tcl mingw-w64-x86_64-zlib make perl tcl openssl
- name: Install macOS build dependencies
if: matrix.platform == 'macos'
run: brew install ripgrep tcl-tk
- name: Install Go toolchain
if: matrix.platform == 'ubuntu'
uses: actions/setup-go@v5
with:
go-version: '1.23'
cache: false
- name: Configure Unix build
if: matrix.platform != 'windows'
run: |
mkdir -p build
cd build
if [ "${{ matrix.platform }}" = "macos" ]; then
export PATH="$(brew --prefix tcl-tk)/bin:$PATH"
../configure
else
TCL_CONFIG=$(find /usr/lib -name tclConfig.sh -print -quit 2>/dev/null)
if [ -n "$TCL_CONFIG" ]; then
../configure --with-tcl=$(dirname "$TCL_CONFIG")
else
../configure
fi
fi
- name: Configure Windows build
if: matrix.platform == 'windows'
shell: msys2 {0}
run: |
mkdir -p build
cd build
../configure
- name: Build checked Unix binaries
if: matrix.platform != 'windows'
run: |
cd build
set -o pipefail
{
make -j2 DOLTLITE_PROLLY_CHECK=1 \
doltlite doltlite-remotesrv doltlite-lib
make DOLTLITE_PROLLY=0 sqlite3
make libsqlite3.a USE_AMALGAMATION=0
rm -f sqlite3.c .target_source
make DOLTLITE_PROLLY=1 DOLTLITE_PROLLY_CHECK=1 \
sqlite3.c sqlite3.h
} 2>&1 | tee build.log
DOLTLITE_CHECK_AMALGAMATION=0 \
bash ../test/assert_doltlite_artifacts.sh .
bash ../test/amalgamation_vec1_option_test.sh .
if grep -E "warning:" build.log; then
echo "::error::compiler warnings in checked build"
exit 1
fi
make lint
- name: Install layout
if: matrix.platform != 'windows'
run: bash test/install_layout_test.sh build
timeout-minutes: 10
- name: Build Linux-only test binaries
if: matrix.platform == 'ubuntu'
run: |
cd build
set -o pipefail
{
make DOLTLITE_PROLLY_CHECK=1 doltlite-c-tests-build
cc $CFLAGS -Wno-comment -DDOLTLITE_PROLLY=1 -I. -I../src \
-o threadtest4 ../test/threadtest4.c sqlite3.c \
-ldl -lpthread -lm -lz
cc $CFLAGS -Wno-comment -I. -I../src \
-o threadtest5 ../test/threadtest5.c sqlite3.c \
-ldl -lpthread -lm -lz
gcc $CFLAGS -o quickstart \
../examples/quickstart.c -I. libdoltlite.a -lpthread -lz -lm
cc $CFLAGS -O0 -I. -I../src \
-DDOLTLITE_PROLLY=1 -D_HAVE_SQLITE_CONFIG_H -DBUILD_sqlite \
-o concurrent_branch_test ../test/concurrent_branch_test.c \
libsqlite3.a -lz -lpthread -lm
gcc $CFLAGS -O0 -I. \
-o concurrent_write_test ../test/concurrent_write_test.c \
libdoltlite.a -lz -lpthread -lm
cc $CFLAGS -I. -I../src \
-o crash_recovery_test ../test/crash_recovery_test.c \
libdoltlite.a -lz -lpthread -lm
(
cd ../examples/go
CGO_CFLAGS="-I../../build" \
CGO_LDFLAGS="../../build/libdoltlite.a -lz -lpthread -lm" \
go build -tags libsqlite3 -o ../../build/go_quickstart .
)
} 2>&1 | tee -a build.log
if grep -E "warning:" build.log; then
echo "::error::compiler warnings in checked build"
exit 1
fi
- name: Build macOS-only test binaries
if: matrix.platform == 'macos'
run: |
cd build
set -o pipefail
{
gcc $CFLAGS -o quickstart \
../examples/quickstart.c -I. libdoltlite.a -lpthread -lz -lm
cc $CFLAGS -O0 -I. -I../src \
-DDOLTLITE_PROLLY=1 -D_HAVE_SQLITE_CONFIG_H -DBUILD_sqlite \
-o concurrent_branch_test ../test/concurrent_branch_test.c \
libsqlite3.a -lz -lpthread -lm
gcc $CFLAGS -O0 -I. \
-o concurrent_write_test ../test/concurrent_write_test.c \
libdoltlite.a -lz -lpthread -lm
gcc $CFLAGS -O0 -I. \
-o prepared_stmt_reuse_test ../test/prepared_stmt_reuse_test.c \
libdoltlite.a -lz -lpthread -lm
} 2>&1 | tee -a build.log
if grep -E "warning:" build.log; then
echo "::error::compiler warnings in checked build"
exit 1
fi
- name: Build Windows binaries
if: matrix.platform == 'windows'
shell: msys2 {0}
run: |
cd build
set -o pipefail
{
make -j$(nproc) DOLTLITE_PROLLY_CHECK=1 \
doltlite.exe doltlite-remotesrv.exe doltlite-lib
rm -f doltlite.exe
make -j$(nproc) DOLTLITE_PROLLY_CHECK=1 \
'T.link=$(T.cc.sqlite) -static' doltlite.exe
if objdump -p doltlite.exe | grep -Eq 'DLL Name: (libwinpthread-1\.dll|zlib1\.dll)'; then
exit 1
fi
make DOLTLITE_PROLLY=1 DOLTLITE_PROLLY_CHECK=1 sqlite3.c sqlite3.h
cc $CFLAGS -I. -I../src \
-o doltlite_regression_test_c \
../test/doltlite_regression_test_c.c libdoltlite.a \
-lz -lpthread -lm -lws2_32 -lbcrypt -lcrypt32
} 2>&1 | tee build.log
DOLTLITE_CHECK_AMALGAMATION=0 DOLTLITE_CHECK_SHARED=0 \
bash ../test/assert_doltlite_artifacts.sh .
cp -f "$(command -v sqlite3)" sqlite3
if grep -E "warning:" build.log; then
echo "::error::compiler warnings in checked build"
exit 1
fi
- name: Build standalone Unix test probes
if: matrix.platform != 'windows'
run: |
cd build
set -o pipefail
{
cc $CFLAGS -Wall \
-I../src -I../ext/ed25519 \
../test/doltlite_creds_kat.c ../test/sqlite3_alloc_stub.c \
../src/doltlite_creds.c \
../ext/ed25519/fe.c ../ext/ed25519/ge.c \
../ext/ed25519/sc.c ../ext/ed25519/sha512.c \
../ext/ed25519/keypair.c ../ext/ed25519/sign.c \
../ext/ed25519/verify.c ../ext/ed25519/add_scalar.c \
-o creds_kat
cc $CFLAGS -Wall \
-I../src -I../ext/ed25519 \
../test/creds_verify_kat.c ../test/sqlite3_alloc_stub.c \
../src/doltlite_creds.c \
../ext/ed25519/fe.c ../ext/ed25519/ge.c \
../ext/ed25519/sc.c ../ext/ed25519/sha512.c \
../ext/ed25519/keypair.c ../ext/ed25519/sign.c \
../ext/ed25519/verify.c ../ext/ed25519/add_scalar.c \
-o creds_verify_kat
cc $CFLAGS -I../src -I../ext/mbedtls/include \
../test/doltlite_tls_test_main.c ../test/sqlite3_alloc_stub.c \
../src/doltlite_tls.c \
../ext/mbedtls/library/*.c \
-o tls_test
blake_objects=(blake3.o blake3_portable.o blake3_dispatch.o)
for object in blake3_sse2.o blake3_sse41.o blake3_avx2.o blake3_avx512.o blake3_neon.o; do
[ ! -f "$object" ] || blake_objects+=("$object")
done
cc $CFLAGS ../test/blake3_kat.c \
prolly_hash.o "${blake_objects[@]}" \
-I../src -I../ext/blake3 -DDOLTLITE_PROLLY=1 \
-lm -o blake3_kat
probe_libs=(-lz -lpthread -lm)
if [ "${{ matrix.platform }}" = "ubuntu" ]; then
probe_libs+=(-ldl)
fi
cc $CFLAGS -Wno-comment -I. \
../test/amalgamation_http_probe.c sqlite3.c \
"${probe_libs[@]}" -o amalgamation_http_probe
} 2>&1 | tee -a build.log
if grep -E "warning:" build.log; then
echo "::error::compiler warnings in standalone probes"
exit 1
fi
- name: Build standalone Windows test probes
if: matrix.platform == 'windows'
shell: msys2 {0}
run: |
cd build
set -o pipefail
{
cc $CFLAGS -Wall \
-I../src -I../ext/ed25519 \
../test/doltlite_creds_kat.c ../test/sqlite3_alloc_stub.c \
../src/doltlite_creds.c \
../ext/ed25519/fe.c ../ext/ed25519/ge.c \
../ext/ed25519/sc.c ../ext/ed25519/sha512.c \
../ext/ed25519/keypair.c ../ext/ed25519/sign.c \
../ext/ed25519/verify.c ../ext/ed25519/add_scalar.c \
-lws2_32 -lbcrypt -lcrypt32 -o creds_kat.exe
cc $CFLAGS -Wall \
-I../src -I../ext/ed25519 \
../test/creds_verify_kat.c ../test/sqlite3_alloc_stub.c \
../src/doltlite_creds.c \
../ext/ed25519/fe.c ../ext/ed25519/ge.c \
../ext/ed25519/sc.c ../ext/ed25519/sha512.c \
../ext/ed25519/keypair.c ../ext/ed25519/sign.c \
../ext/ed25519/verify.c ../ext/ed25519/add_scalar.c \
-lws2_32 -lbcrypt -lcrypt32 -o creds_verify_kat.exe
cc $CFLAGS -I../src -I../ext/mbedtls/include \
../test/doltlite_tls_test_main.c ../test/sqlite3_alloc_stub.c \
../src/doltlite_tls.c \
../ext/mbedtls/library/*.c \
-lws2_32 -lbcrypt -lcrypt32 -o tls_test.exe
blake_objects=(blake3.o blake3_portable.o blake3_dispatch.o)
for object in blake3_sse2.o blake3_sse41.o blake3_avx2.o blake3_avx512.o blake3_neon.o; do
[ ! -f "$object" ] || blake_objects+=("$object")
done
cc $CFLAGS ../test/blake3_kat.c \
prolly_hash.o "${blake_objects[@]}" \
-I../src -I../ext/blake3 -DDOLTLITE_PROLLY=1 \
-lm -o blake3_kat.exe
cc $CFLAGS -Wno-comment -I. \
../test/amalgamation_http_probe.c sqlite3.c \
-lz -lpthread -lm -lws2_32 -lbcrypt -lcrypt32 \
-o amalgamation_http_probe.exe
} 2>&1 | tee -a build.log
if grep -E "warning:" build.log; then
echo "::error::compiler warnings in standalone probes"
exit 1
fi
- name: Package checked build
if: matrix.platform != 'windows'
run: tar -czf checked-build-${{ matrix.platform }}.tar.gz build
- name: Package checked Windows build
if: matrix.platform == 'windows'
shell: msys2 {0}
run: tar -czf checked-build-windows.tar.gz build
- name: Upload checked build
uses: actions/upload-artifact@v4
with:
name: checked-build-${{ matrix.platform }}
path: checked-build-${{ matrix.platform }}.tar.gz
retention-days: 1
sqllogictest-build:
name: sqllogictest
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
bash .github/scripts/install-apt-deps.sh \
build-essential fossil tcl-dev unixodbc-dev zlib1g-dev
- name: Generate DoltLite amalgamation
run: |
mkdir -p build
cd build
TCL_CONFIG=$(find /usr/lib -name tclConfig.sh -print -quit 2>/dev/null)
if [ -n "$TCL_CONFIG" ]; then
../configure --with-tcl=$(dirname "$TCL_CONFIG")
else
../configure
fi
make DOLTLITE_PROLLY=1 DOLTLITE_PROLLY_CHECK=1 sqlite3.c sqlite3.h
- name: Build sqllogictest runners
run: |
fossil clone https://www.sqlite.org/sqllogictest/ /tmp/sqllogictest.fossil
mkdir -p build/sqllogictest
cd build/sqllogictest
fossil open /tmp/sqllogictest.fossil db57eba95d7c412bb413da5480c8be24109a8faf
perl ../../test/patch_sqllogictest.pl \
< src/sqllogictest.c > src/sqllogictest.c.patched
mv src/sqllogictest.c.patched src/sqllogictest.c
# unixODBC declares SQLGetData's indicator as SQLLEN*. The pinned
# upstream source still uses the 32-bit SQLINTEGER typedef.
grep -q 'SQLINTEGER indicator' src/slt_odbc3.c
perl -pi -e 's/SQLINTEGER indicator/SQLLEN indicator/g' \
src/slt_odbc3.c
cd src
gcc -Werror -g -O2 -DSQLITE_NO_SYNC=1 -DSQLITE_THREADSAFE=0 \
-DSQLITE_OMIT_LOAD_EXTENSION -c md5.c
gcc -Werror -g -O2 -DSQLITE_NO_SYNC=1 -DSQLITE_THREADSAFE=0 \
-DSQLITE_OMIT_LOAD_EXTENSION -c sqlite3.c
gcc -Werror -g -O2 -o sqllogictest-stock \
sqllogictest.c md5.o sqlite3.o -lpthread -lm -lodbc
cp ../../sqlite3.c sqlite3.c
cp ../../sqlite3.h sqlite3.h
gcc -Werror -Wno-comment -g -O2 \
-DSQLITE_NO_SYNC=1 -DSQLITE_THREADSAFE=1 \
-DSQLITE_OMIT_LOAD_EXTENSION -c sqlite3.c \
-o sqlite3-doltlite.o
gcc -Werror -g -O2 -o sqllogictest-doltlite \
sqllogictest.c md5.o sqlite3-doltlite.o \
-lpthread -lm -lz -lodbc
- name: Package
run: tar -czf sqllogictest-build.tar.gz build/sqllogictest
- name: Upload
uses: actions/upload-artifact@v4
with:
name: sqllogictest-build
path: sqllogictest-build.tar.gz
retention-days: 1
coverage-build:
name: coverage
runs-on: ubuntu-latest
timeout-minutes: 20
env:
CC: clang
CFLAGS: -O1 -g -Werror -Wno-comment -fprofile-instr-generate -fcoverage-mapping
LDFLAGS: -fprofile-instr-generate
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
bash .github/scripts/install-apt-deps.sh \
build-essential clang llvm tcl-dev zlib1g-dev
- name: Configure
run: |
mkdir -p build-coverage
cd build-coverage
TCL_CONFIG=$(find /usr/lib -name tclConfig.sh -print -quit 2>/dev/null)
if [ -n "$TCL_CONFIG" ]; then
../configure --with-tcl=$(dirname "$TCL_CONFIG")
else
../configure
fi
- name: Build
run: |
cd build-coverage
set -o pipefail
{
make -j2 DOLTLITE_PROLLY_CHECK=1 \
doltlite doltlite-remotesrv doltlite-lib testfixture \
doltlite-c-tests-build doltlite-regression-test-c-build
make DOLTLITE_PROLLY=0 sqlite3
blake_objects=(blake3.o blake3_portable.o blake3_dispatch.o)
for object in blake3_sse2.o blake3_sse41.o blake3_avx2.o blake3_avx512.o blake3_neon.o; do
[ ! -f "$object" ] || blake_objects+=("$object")
done
clang $CFLAGS ../test/blake3_kat.c \
prolly_hash.o "${blake_objects[@]}" \
-I../src -I../ext/blake3 -DDOLTLITE_PROLLY=1 \
$LDFLAGS -lm -o blake3_kat_test
} 2>&1 | tee build.log
if grep -E "warning:" build.log; then
echo "::error::compiler warnings in coverage build"
exit 1
fi
find . -type f -name '*.profraw' -delete
- name: Build the stock reference
run: bash test/build_stock_reference.sh build-stockref build-coverage/doltlite
- name: Package
run: |
mkdir -p coverage-artifact/build-coverage
cp build-coverage/doltlite \
build-coverage/doltlite-remotesrv \
build-coverage/doltlite_regression_test_c \
build-coverage/testfixture \
build-coverage/prolly_hash.o \
build-coverage/blake3*.o \
build-coverage/*_test \
coverage-artifact/build-coverage/
cp build-stockref/sqlite3 \
coverage-artifact/build-coverage/sqlite3-stock
llvm-strip --strip-debug coverage-artifact/build-coverage/*
# The consumers compare against this copy, so assert the copy: it is
# what ships, and stripping it is the last thing that touches it.
bash test/assert_stock_reference.sh \
coverage-artifact/build-coverage/sqlite3-stock \
coverage-artifact/build-coverage/doltlite
tar -C coverage-artifact -czf coverage-build.tar.gz build-coverage
- name: Upload
uses: actions/upload-artifact@v4
with:
name: coverage-build
path: coverage-build.tar.gz
retention-days: 1
benchmark-build:
name: optimized-benchmark
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Check out candidate
uses: actions/checkout@v4
- name: Check out PR base
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.base.sha || github.event.repository.default_branch }}
path: benchmark-base
- name: Install dependencies
run: |
bash .github/scripts/install-apt-deps.sh \
build-essential tcl-dev zlib1g-dev
- name: Configure
run: |
TCL_CONFIG=$(find /usr/lib -name tclConfig.sh -print -quit 2>/dev/null)
for source in . benchmark-base; do
mkdir -p "$source/build"
if [ -n "$TCL_CONFIG" ]; then
(cd "$source/build" && ../configure --with-tcl=$(dirname "$TCL_CONFIG"))
else
(cd "$source/build" && ../configure)
fi
done
- name: Build
run: |
set -o pipefail
{
(
cd build
make -j2 doltlite doltlite-lib
cc -O2 -Werror -I. -I../src \
-o bench_timer_doltlite ../test/sysbench_timer.c \
libdoltlite.a -lpthread -lz -lm
)
(
cd benchmark-base/build
make -j2 doltlite doltlite-lib
cc -O2 -Werror -I. -I../src \
-o bench_timer_doltlite ../test/sysbench_timer.c \
libdoltlite.a -lpthread -lz -lm
)
} 2>&1 | tee build.log
if grep -E "warning:" build.log; then
echo "::error::compiler warnings in optimized build"
exit 1
fi
- name: Package
run: |
mv benchmark-base/build benchmark-baseline
git rev-parse HEAD > benchmark-candidate-sha
git -C benchmark-base rev-parse HEAD > benchmark-baseline-sha
tar -czf benchmark-build.tar.gz \
build benchmark-baseline \
benchmark-candidate-sha benchmark-baseline-sha
- name: Upload
uses: actions/upload-artifact@v4
with:
name: benchmark-build
path: benchmark-build.tar.gz
retention-days: 1
asan-ubsan-build:
name: asan-ubsan-${{ matrix.platform }}
runs-on: ${{ matrix.runs-on }}
timeout-minutes: 20
strategy:
fail-fast: true
matrix:
include:
- platform: ubuntu
runs-on: ubuntu-latest
warning-flags: ''
- platform: macos
runs-on: macos-latest
warning-flags: -Wno-deprecated-declarations
env:
ASAN_CFLAGS: -O1 -g -Werror ${{ matrix.warning-flags }} -fsanitize=address,undefined -fno-omit-frame-pointer -fno-sanitize-recover=all
ASAN_LDFLAGS: -fsanitize=address,undefined
steps:
- uses: actions/checkout@v4
- name: Install Linux dependencies
if: matrix.platform == 'ubuntu'
run: |
bash .github/scripts/install-apt-deps.sh \
build-essential tcl-dev zlib1g-dev
- name: Install macOS dependencies
if: matrix.platform == 'macos'
run: brew install tcl-tk
- name: Configure
run: |
mkdir -p build
cd build
if [ "${{ matrix.platform }}" = "macos" ]; then
export PATH="$(brew --prefix tcl-tk)/bin:$PATH"
../configure
else
TCL_CONFIG=$(find /usr/lib -name tclConfig.sh -print -quit 2>/dev/null)
if [ -n "$TCL_CONFIG" ]; then
../configure --with-tcl=$(dirname "$TCL_CONFIG")
else
../configure
fi
fi
- name: Build
run: |
cd build
set -o pipefail
{
make CFLAGS="$ASAN_CFLAGS" LDFLAGS="$ASAN_LDFLAGS" \
doltlite libdoltlite.a
make DOLTLITE_PROLLY=0 sqlite3
cc $ASAN_CFLAGS -I. -I../src \
-o doltlite_regression_test_c \
../test/doltlite_regression_test_c.c \
libdoltlite.a $ASAN_LDFLAGS -lz -lpthread -lm
} 2>&1 | tee build.log
if grep -E "warning:" build.log; then
echo "::error::compiler warnings in sanitizer build"
exit 1
fi
- name: Package
run: tar -czf asan-ubsan-${{ matrix.platform }}.tar.gz build
- name: Upload
uses: actions/upload-artifact@v4
with:
name: asan-ubsan-${{ matrix.platform }}
path: asan-ubsan-${{ matrix.platform }}.tar.gz
retention-days: 1
tsan-build:
name: tsan
runs-on: ubuntu-latest
timeout-minutes: 20
env:
TSAN_CFLAGS: -O1 -g -Werror -Wno-comment -fsanitize=thread -fno-omit-frame-pointer
TSAN_LDFLAGS: -fsanitize=thread
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
bash .github/scripts/install-apt-deps.sh \
build-essential clang zlib1g-dev
- name: Configure
run: |
mkdir -p build
cd build
CC=clang ../configure
- name: Build
run: |
cd build
set -o pipefail
{
make CC=clang CFLAGS="$TSAN_CFLAGS" LDFLAGS="$TSAN_LDFLAGS" \
sqlite3.c sqlite3.h
clang $TSAN_CFLAGS -DDOLTLITE_PROLLY=1 -I. -I../src \
-o threadtest4 ../test/threadtest4.c sqlite3.c \
$TSAN_LDFLAGS -ldl -lpthread -lm -lz
clang $TSAN_CFLAGS -I. -I../src \
-o threadtest5 ../test/threadtest5.c sqlite3.c \
$TSAN_LDFLAGS -ldl -lpthread -lm -lz
make CC=clang CFLAGS="$TSAN_CFLAGS" LDFLAGS="$TSAN_LDFLAGS" \
doltlite doltlite-remotesrv vc_concurrency_test \
vc_ref_mutation_stress_test
} 2>&1 | tee build.log
if grep -E "warning:" build.log; then
echo "::error::compiler warnings in TSan build"
exit 1
fi
- name: Package
run: tar -czf tsan-build.tar.gz build
- name: Upload
uses: actions/upload-artifact@v4
with:
name: tsan-build
path: tsan-build.tar.gz
retention-days: 1
crash-build:
name: crash
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
bash .github/scripts/install-apt-deps.sh \
build-essential libtommath-dev tcl-dev zlib1g-dev
- name: Configure
run: |
mkdir -p build-crash
cd build-crash
TCL_CONFIG=$(find /usr/lib -name tclConfig.sh -print -quit 2>/dev/null)
if [ -n "$TCL_CONFIG" ]; then
../configure --with-tcl=$(dirname "$TCL_CONFIG")
else
../configure
fi
- name: Build
run: |
cd build-crash
TCL_CONFIG=$(find /usr/lib -name tclConfig.sh -print -quit 2>/dev/null)
. "$TCL_CONFIG"
set -o pipefail
make OPTIONS='-DSQLITE_TEST=1 -DSQLITE_CRASH_TEST=1' \
OPTS="$TCL_INCLUDE_SPEC" \
libdoltlite.a doltlite-crashtest crash_recovery_test_sqlite_test \
2>&1 | tee build.log
if grep -E "warning:" build.log; then
echo "::error::compiler warnings in crash-test build"
exit 1
fi
- name: Package
run: tar -czf crash-build.tar.gz build-crash
- name: Upload
uses: actions/upload-artifact@v4
with:
name: crash-build
path: crash-build.tar.gz
retention-days: 1
fuzz-build:
name: libfuzzer
runs-on: ubuntu-latest
timeout-minutes: 15
env:
FUZZ_CFLAGS: -O1 -g -Werror -fsanitize=fuzzer-no-link,address -fno-omit-frame-pointer -fno-sanitize-recover=address
FUZZ_LDFLAGS: -fsanitize=fuzzer-no-link,address
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
bash .github/scripts/install-apt-deps.sh \
build-essential clang tcl-dev zlib1g-dev
- name: Configure
run: |
mkdir -p build-fuzz
cd build-fuzz
TCL_CONFIG=$(find /usr/lib -name tclConfig.sh -print -quit 2>/dev/null)
if [ -n "$TCL_CONFIG" ]; then
../configure --with-tcl=$(dirname "$TCL_CONFIG")
else
../configure
fi
- name: Build
run: |
cd build-fuzz
set -o pipefail
{
make CC=clang CFLAGS="$FUZZ_CFLAGS" LDFLAGS="$FUZZ_LDFLAGS" \
libdoltlite.a
for target in fuzz_replaywal fuzz_prolly_node fuzz_deserialize_refs fuzz_read_index fuzz_deserialize_catalog fuzz_wire_response fuzz_commit fuzz_working_set fuzz_conflicts fuzz_constraint_violations; do
clang -O1 -g -Werror \
-fsanitize=fuzzer,address -fno-omit-frame-pointer \
-fno-sanitize-recover=address \
-DDOLTLITE_PROLLY=1 -D_HAVE_SQLITE_CONFIG_H \
-I. -I../src \
-o "$target" "../test/$target.c" libdoltlite.a \
-lz -lpthread
done
} 2>&1 | tee build.log
if grep -E "warning:" build.log; then
echo "::error::compiler warnings in libFuzzer build"
exit 1
fi
- name: Package
run: tar -czf fuzz-build.tar.gz build-fuzz
- name: Upload
uses: actions/upload-artifact@v4
with:
name: fuzz-build
path: fuzz-build.tar.gz
retention-days: 1
wasm-build:
name: wasm
runs-on: ubuntu-latest
timeout-minutes: 20
env:
EMSDK_VERSION: 3.1.74
EMCC_CFLAGS: -Wno-limited-postlink-optimizations
WABT_VERSION: 1.0.36
steps:
- uses: actions/checkout@v4
- name: Cache Emscripten SDK
uses: actions/cache@v4
with:
path: ${{ runner.tool_cache }}/emsdk
key: emsdk-${{ runner.os }}-${{ env.EMSDK_VERSION }}
- name: Install Emscripten SDK
run: |
EMSDK_DIR="${RUNNER_TOOL_CACHE}/emsdk"
if [ ! -d "$EMSDK_DIR/.git" ]; then
rm -rf "$EMSDK_DIR"
git clone https://github.com/emscripten-core/emsdk.git "$EMSDK_DIR"
fi
cd "$EMSDK_DIR"
git fetch --tags --quiet
./emsdk install "$EMSDK_VERSION"
./emsdk activate "$EMSDK_VERSION"
echo "EMSDK=$EMSDK_DIR" >> "$GITHUB_ENV"
- name: Cache WABT
uses: actions/cache@v4
with:
path: ${{ runner.tool_cache }}/wabt-${{ env.WABT_VERSION }}
key: wabt-${{ runner.os }}-${{ env.WABT_VERSION }}
- name: Install WABT
run: |
WABT_DIR="${RUNNER_TOOL_CACHE}/wabt-${WABT_VERSION}"
if [ ! -x "$WABT_DIR/bin/wasm-strip" ]; then
rm -rf "$WABT_DIR"
mkdir -p "$WABT_DIR"
curl -fsSL "https://github.com/WebAssembly/wabt/releases/download/${WABT_VERSION}/wabt-${WABT_VERSION}-ubuntu-20.04.tar.gz" \
| tar -xz --strip-components=1 -C "$WABT_DIR"
fi
echo "$WABT_DIR/bin" >> "$GITHUB_PATH"
- name: Build
run: |
source "$EMSDK/emsdk_env.sh"
set -o pipefail
{
./configure
make sqlite3.c sqlite3.h sqlite3ext.h
bash test/amalgamation_wasm_compile_test.sh sqlite3.c
mkdir -p build
cd build
../configure
make doltlite doltlite-remotesrv
cd ..
make -C ext/wasm fiddle npm
bash test/wasm_incremental_build_test.sh
mkdir -p ci-wasm-runtime
cp -a ext/wasm/jswasm/. ci-wasm-runtime/
make -C ext/wasm dist
rm -rf ext/wasm/jswasm
mv ci-wasm-runtime ext/wasm/jswasm
} 2>&1 | tee wasm-build.log
if grep -E "warning:" wasm-build.log; then
echo "::error::compiler warnings in wasm build"
exit 1
fi
- name: Package
run: |
tar -czf ci-wasm-build.tar.gz \
build/doltlite \
build/doltlite-remotesrv \
ext/wasm/jswasm \
ext/wasm/sqlite-wasm-*.zip
- name: Upload
uses: actions/upload-artifact@v4
with:
name: ci-wasm-build
path: ci-wasm-build.tar.gz
retention-days: 1
compat-build:
name: compatibility-references
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install dependencies
run: |
bash .github/scripts/install-apt-deps.sh \
build-essential tcl-dev zlib1g-dev
- name: Cache old-version binaries
uses: actions/cache@v4
with:
path: .compat-cache
key: compat-bins-${{ runner.os }}-${{ github.base_ref || github.ref_name }}
restore-keys: |
compat-bins-${{ runner.os }}-
- name: Build compatibility references
run: |
DOLTLITE_COMPAT_JOBS=4 \
bash test/doltlite_compat_test.sh --build-only
- name: Package
run: tar -czf compat-build.tar.gz .compat-cache
- name: Upload
uses: actions/upload-artifact@v4
with:
name: compat-build
path: compat-build.tar.gz
retention-days: 1
development-builds:
name: development-${{ matrix.configuration }}
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
configuration:
- All-Debug
- All-O0
env:
CFLAGS: -O2 -g -Werror
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
bash .github/scripts/install-apt-deps.sh \
build-essential tcl-dev zlib1g-dev
- name: Configure
run: |
mkdir -p build
cd build
TCL_CONFIG=$(find /usr/lib -name tclConfig.sh -print -quit 2>/dev/null)
if [ -n "$TCL_CONFIG" ]; then
../configure --with-tcl=$(dirname "$TCL_CONFIG")
else
../configure
fi
- name: Compile development configurations
run: |
cd build
make DOLTLITE_PROLLY=1 testfixture
./testfixture ../test/testrunner.tcl \
--buildonly --jobs 4 \
--config ${{ matrix.configuration }} mdevtest
assert-build:
name: assert-enabled
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
bash .github/scripts/install-apt-deps.sh \
build-essential tcl-dev zlib1g-dev
- name: Build dirty-check probe
env:
CFLAGS: -g -O0 -Werror
run: |
mkdir -p build-assert
cd build-assert
TCL_CONFIG=$(find /usr/lib -name tclConfig.sh -print -quit 2>/dev/null)
if [ -n "$TCL_CONFIG" ]; then
../configure --with-debug --with-tcl=$(dirname "$TCL_CONFIG")
else
../configure --with-debug
fi
if grep -E 'T\.cc \+= .* -DNDEBUG' Makefile; then
echo "::error::assert-enabled configure still sets -DNDEBUG"
exit 1
fi
if ! grep -E 'T\.cc \+= .* -DSQLITE_DEBUG=1' Makefile; then
echo "::error::assert-enabled configure did not set -DSQLITE_DEBUG=1"
exit 1
fi
make -j"$(nproc)" DOLTLITE_PROLLY=1 \
catalog_serialize_determinism_test \
doltlite-regression-test-c-build
- name: Package
run: |
sha256sum \
build-assert/catalog_serialize_determinism_test \
build-assert/doltlite_regression_test_c \
> build-assert/development-build.sha256
echo "$GITHUB_SHA" > build-assert/development-build.commit
tar -czf development-build.tar.gz \
build-assert/catalog_serialize_determinism_test \
build-assert/doltlite_regression_test_c \
build-assert/development-build.sha256 \
build-assert/development-build.commit
- name: Upload
uses: actions/upload-artifact@v4
with:
name: development-build
path: development-build.tar.gz
retention-days: 1
no-dead-code:
name: no-dead-code
needs: checked
runs-on: ubuntu-latest
timeout-minutes: 10
steps: