Repository navigation
1062 lines (1030 loc) · 39.2 KB
/
Copy pathverify.yml
File metadata and controls
1062 lines (1030 loc) · 39.2 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: Verify
on:
pull_request:
merge_group:
workflow_dispatch:
permissions:
contents: read
# Each merge group has its own gh-readonly-queue ref, so queued groups never cancel each other; the
# queue itself discards a group's run when it rebuilds the group.
concurrency:
group: verify-${{ github.workflow }}-${{ github.event.merge_group.head_ref || github.ref }}
cancel-in-progress: ${{ github.event_name != 'merge_group' }}
jobs:
changes:
name: Classify verification scope
runs-on: ubuntu-24.04
outputs:
checks: ${{ steps.scope.outputs.checks }}
compiler_differential: ${{ steps.scope.outputs.compiler_differential }}
duckdb: ${{ steps.scope.outputs.duckdb }}
postgres: ${{ steps.scope.outputs.postgres }}
clickhouse: ${{ steps.scope.outputs.clickhouse }}
performance: ${{ steps.scope.outputs.performance }}
format_performance: ${{ steps.scope.outputs.format_performance }}
rules_performance: ${{ steps.scope.outputs.rules_performance }}
wheels: ${{ steps.scope.outputs.wheels }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Select relevant suites
id: scope
env:
EVENT_NAME: ${{ github.event_name }}
BASE_SHA: ${{ github.event.pull_request.base.sha || github.event.merge_group.base_sha }}
HEAD_SHA: ${{ github.event.pull_request.head.sha || github.event.merge_group.head_sha }}
HEAD_REF: ${{ github.event.pull_request.head.ref }}
HEAD_REPOSITORY: ${{ github.event.pull_request.head.repo.full_name }}
run: |
write_scope() {
{
echo "duckdb=$1"
echo "postgres=$2"
echo "performance=$3"
echo "format_performance=$4"
echo "rules_performance=$5"
echo "checks=$6"
echo "wheels=$7"
echo "compiler_differential=$8"
echo "clickhouse=$9"
} >> "${GITHUB_OUTPUT}"
}
if [[ "${EVENT_NAME}" != "pull_request" && "${EVENT_NAME}" != "merge_group" ]]; then
write_scope true true true true true true true true true
exit 0
fi
# A merge group's head is its base plus every queued pull request ahead of and including
# this one, so the base..head diff covers the whole group. Anything that prevents an exact
# diff runs everything rather than risk skipping a suite. Three dots compare with the merge
# base, so changes that landed on main after a branch started are not counted as its own.
changed_paths="${RUNNER_TEMP}/changed-paths"
if [[ -z "${BASE_SHA}" || -z "${HEAD_SHA}" ]] || \
! git diff --name-only -z "${BASE_SHA}...${HEAD_SHA}" > "${changed_paths}"; then
echo "Could not diff ${BASE_SHA:-<none>}...${HEAD_SHA:-<none>}; running every suite" >&2
write_scope true true true true true true true true true
exit 0
fi
# Succeeds when every change is a release metadata change: the manifest, the changelog,
# or version lines of the package and lock files, so no dependency or build setting
# moves. Keep the file list in sync with the release checks in release-please.yml.
release_metadata_only() {
local path diff offending changed_any=false
local metadata_paths="${RUNNER_TEMP}/release-metadata-paths"
local version='[0-9]+\.[0-9]+\.[0-9]+'
local version_line="^[-+](version = \"${version}\""
version_line+="| \"[a-z0-9_-]+==${version}\", # x-release-please-version)\$"
git diff --name-only --no-renames -z "${BASE_SHA}...${HEAD_SHA}" > "${metadata_paths}" \
|| return 1
while IFS= read -r -d '' path; do
changed_any=true
case "${path}" in
.release-please-manifest.json|CHANGELOG.md) ;;
crates/sqlbuild-cli/Cargo.toml|crates/sqlbuild-python/Cargo.toml|Cargo.lock|pyproject.toml|uv.lock)
diff="$(git diff -U0 --text --no-color --no-renames "${BASE_SHA}...${HEAD_SHA}" -- "${path}")" \
|| return 1
offending="$(awk '/^@@/ { hunk = 1; next } hunk && /^[-+]/' <<< "${diff}" \
| grep -Ev "${version_line}" || true)"
if [[ -n "${offending}" ]]; then
echo "${path} changes more than version lines:" >&2
echo "${offending}" >&2
return 1
fi
;;
*) return 1 ;;
esac
done < "${metadata_paths}"
[[ "${changed_any}" == "true" ]]
}
# Release Please pull requests change only release metadata on top of product code that
# already passed every suite before it reached main, so the suites are skipped. Their
# required Verify status is posted only by the trusted release checks in
# release-please.yml after the metadata, version and distribution checks pass; the
# verify job below reports under another name on Release Please branches.
if [[ "${EVENT_NAME}" == "pull_request" \
&& "${HEAD_REPOSITORY}" == "${GITHUB_REPOSITORY}" \
&& "${HEAD_REF}" == release-please--branches--* ]] && release_metadata_only; then
echo "Release Please pull request changes only release metadata; skipping the suites" \
| tee -a "${GITHUB_STEP_SUMMARY}"
write_scope false false false false false false false false false
exit 0
fi
duckdb=false
postgres=false
clickhouse=false
performance=false
format_performance=false
rules_performance=false
wheels=false
compiler_differential=false
broad=false
changed=false
# A change that only touches the website, root-level Markdown, the README demo GIFs or the
# skill pages generated from the website docs skips the Python checks and test suites.
# The website builds in its own workflow.
docs_only=true
while IFS= read -r -d '' path; do
changed=true
case "${path}" in
website/*|.github/workflows/website.yml|.github/demos/*) ;;
src/sqlbuild/.agents/skills/sqlbuild/references/docs/*.md) ;;
*/*) docs_only=false ;;
*.md) ;;
*) docs_only=false ;;
esac
case "${path}" in
crates/*|Cargo.toml|Cargo.lock|pyproject.toml|.github/workflows/verify.yml|.github/workflows/build-distributions.yml)
wheels=true
;;
esac
case "${path}" in
scripts/compiler_differential/*|scripts/run_compiler_differential.py|tests/*/scripts/compiler_differential/*|tests/goldens/*|tests/e2e/fixtures/*|website/examples/*|.github/workflows/verify.yml|Makefile)
compiler_differential=true
;;
esac
case "${path}" in
crates/*|Cargo.toml|Cargo.lock|pyproject.toml|uv.lock)
broad=true
performance=true
format_performance=true
rules_performance=true
;;
src/sqlbuild/compiler/*|src/sqlbuild/adapter/type_system/*)
broad=true
performance=true
rules_performance=true
;;
benchmarks/duckshop-10k/*|src/sqlbuild/executor/testing/*|scripts/cold_compile_performance/*|scripts/compile_performance_ratio/*|scripts/compare_compile_performance.py|tests/e2e/src/sqlbuild/cli/commands/main/compile/*)
broad=true
performance=true
;;
src/sqlbuild/executor/build/*|src/sqlbuild/executor/run/*|src/sqlbuild/presentation/*)
# Inspection, plan, and build guards run inside the fresh-process compile jobs.
broad=true
performance=true
;;
src/sqlbuild/rule_engine/*|src/sqlbuild/lint/*|scripts/rules_benchmark/*|scripts/benchmark_rules_ci.py)
broad=true
performance=true
format_performance=true
rules_performance=true
;;
tests/e2e/src/sqlbuild/cli/commands/main/format/*)
duckdb=true
format_performance=true
;;
tests/e2e/src/sqlbuild/cli/commands/main/postgres/*|tests/integration/src/sqlbuild/adapters/postgres/*|tests/integration/src/sqlbuild/runtime/execution_history/*)
postgres=true
;;
src/sqlbuild/adapters/clickhouse/*|tests/e2e/src/sqlbuild/cli/commands/main/clickhouse/*|tests/integration/src/sqlbuild/adapters/clickhouse/*)
clickhouse=true
;;
tests/e2e/*)
duckdb=true
;;
tests/unit/*|tests/integration/*)
;;
.github/workflows/verify.yml|Makefile)
performance=true
format_performance=true
rules_performance=true
;;
.github/*|docs/*|website/*|*.md|.gitignore|LICENSE)
;;
*)
broad=true
;;
esac
done < "${changed_paths}"
if [[ "${changed}" != "true" ]]; then
write_scope true true true true true true true true true
exit 0
fi
checks=true
if [[ "${docs_only}" == "true" ]]; then
checks=false
fi
if [[ "${broad}" == "true" ]]; then
duckdb=true
postgres=true
clickhouse=true
format_performance=true
compiler_differential=true
fi
write_scope \
"${duckdb}" \
"${postgres}" \
"${performance}" \
"${format_performance}" \
"${rules_performance}" \
"${checks}" \
"${wheels}" \
"${compiler_differential}" \
"${clickhouse}"
lockfile:
name: Lockfile consistency
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
with:
version: "0.12.3"
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
- name: Install Python
run: uv python install 3.12
- name: Verify lockfile
run: uv lock --check --python 3.12
checks:
name: Static checks and unit + integration tests
needs: [changes, lockfile]
if: needs.changes.outputs.checks == 'true'
runs-on: ubuntu-24.04
timeout-minutes: 45
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
with:
version: "0.12.3"
enable-cache: true
cache-dependency-glob: |
uv.lock
Cargo.lock
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
# Restores the native dependency builds that rust-cache.yml saves on main; workspace crates
# always build from source. Verify never saves: a pull request or merge queue cache is
# visible only to its own ref. Jobs that run the same cargo builds share a key.
- uses: Swatinem/rust-cache@v2
with:
shared-key: verify-checks
save-if: false
- name: Install Python
run: uv python install 3.12
- name: Install dependencies
run: uv sync --locked --all-groups --all-extras
- name: Fetch pull request base for the new-duplicate check
if: github.event_name == 'pull_request' || github.event_name == 'merge_group'
run: git fetch --no-tags --depth=1 origin "$BASE_SHA"
env:
BASE_SHA: ${{ github.event.pull_request.base.sha || github.event.merge_group.base_sha }}
- name: Run static checks
run: make check-ci
env:
DUPES_BASE: ${{ github.event.pull_request.base.sha || github.event.merge_group.base_sha || 'origin/main' }}
- name: Run native checks
run: make rust-check
- name: Run unit and integration tests
run: make test
e2e_shards:
name: DuckDB E2E (${{ matrix.name }})
needs: [changes, lockfile]
if: needs.changes.outputs.duckdb == 'true'
runs-on: ubuntu-24.04
timeout-minutes: 45
strategy:
fail-fast: false
matrix:
include:
- name: build core
target: test-e2e-duckdb-build-core
- name: build incremental
target: test-e2e-duckdb-build-incremental
- name: CLI data
target: test-e2e-duckdb-cli-data
- name: CLI commands
target: test-e2e-duckdb-cli
- name: CLI inspection
target: test-e2e-duckdb-inspection
- name: integrations
target: test-e2e-duckdb-integrations
env:
PYTEST_XDIST_AUTO_NUM_WORKERS: "4"
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
with:
version: "0.12.3"
enable-cache: true
cache-dependency-glob: |
uv.lock
Cargo.lock
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
- uses: Swatinem/rust-cache@v2
with:
shared-key: verify-linux
save-if: false
- name: Install Python
run: uv python install 3.12
- name: Install dependencies
run: uv sync --locked --all-groups --all-extras
- name: Report runner CPU topology
run: |
echo "nproc=$(nproc)"
echo "online_processors=$(getconf _NPROCESSORS_ONLN)"
lscpu
uv run python - <<'PY'
import os
print(f"os.cpu_count={os.cpu_count()}")
print(f"sched_getaffinity={sorted(os.sched_getaffinity(0))}")
print(
"PYTEST_XDIST_AUTO_NUM_WORKERS="
f"{os.environ.get('PYTEST_XDIST_AUTO_NUM_WORKERS', '<unset>')}"
)
PY
- name: Run DuckDB E2E shard
run: make ${{ matrix.target }}
compiler_differential:
name: Compiler golden outputs
needs: [changes, lockfile]
if: needs.changes.outputs.compiler_differential == 'true'
runs-on: ubuntu-24.04
timeout-minutes: 45
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
with:
version: "0.12.3"
enable-cache: true
cache-dependency-glob: |
uv.lock
Cargo.lock
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
- uses: Swatinem/rust-cache@v2
with:
shared-key: verify-linux
save-if: false
- name: Install Python
run: uv python install 3.12
- name: Install dependencies
run: uv sync --locked --all-groups --all-extras
- name: Check fixtures, examples, generated seeds and the failure corpus against the goldens
run: >-
make compiler-differential
COMPILER_DIFFERENTIAL_ARGS="--stage-captures --require-discovery-coverage
--require-render-coverage --require-analysis-coverage
--evidence-dir ${{ runner.temp }}/compiler-differential-evidence"
- name: Upload failing projects' targets, stderr and compiled-test stats
if: failure()
uses: actions/upload-artifact@v4
with:
name: compiler-differential-evidence-${{ github.run_id }}-${{ github.run_attempt }}
path: ${{ runner.temp }}/compiler-differential-evidence
if-no-files-found: warn
retention-days: 30
compiler_differential_python_versions:
name: Native compiler on Python ${{ matrix.python }}
needs: [changes, lockfile]
if: needs.changes.outputs.compiler_differential == 'true'
runs-on: ubuntu-24.04
timeout-minutes: 45
strategy:
fail-fast: false
matrix:
python: ["3.13", "3.14"]
env:
UV_PYTHON: ${{ matrix.python }}
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
with:
version: "0.12.3"
enable-cache: true
cache-dependency-glob: |
uv.lock
Cargo.lock
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
- uses: Swatinem/rust-cache@v2
with:
shared-key: verify-linux
save-if: false
- name: Install Python
run: uv python install ${{ matrix.python }}
- name: Install dependencies
run: uv sync --locked --all-groups --all-extras --python ${{ matrix.python }}
- name: Check fixtures, examples, the failure corpus and a few seeds against the goldens
env:
PYTHONUNBUFFERED: "1"
run: >-
uv run --no-sync python -m scripts.run_compiler_differential
--goldens check
--corpus fixtures examples failures seeds --seeds 4 --jobs 4
native_discovery_windows:
name: Native compiler on Windows
needs: [changes, lockfile]
if: needs.changes.outputs.compiler_differential == 'true'
runs-on: windows-2025
timeout-minutes: 45
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
with:
version: "0.12.3"
enable-cache: true
cache-dependency-glob: |
uv.lock
Cargo.lock
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
- uses: Swatinem/rust-cache@v2
with:
shared-key: verify-windows
save-if: false
- name: Test the native discovery crate (walk, junctions, ordering, read errors)
run: cargo test --locked -p sqlbuild-discovery
- name: Install Python
run: uv python install 3.12
- name: Install SQLBuild and pytest
run: |
uv sync --locked --no-dev --python 3.12
uv pip install "pytest>=8.4.2" "pytest-xdist>=3.8.0"
- name: Check the native YAML and TOML readers and the lineage fingerprint with this Python
run: >-
uv run --no-sync pytest
tests/integration/src/sqlbuild/compiler/discovery/test_native_yaml_oracle.py
tests/integration/src/sqlbuild/compiler/discovery/test_native_toml_oracle.py
tests/unit/src/sqlbuild/cli/commands/_helpers/lineage/test_cache.py
-n auto --dist loadfile
- name: Compile and build playground projects
run: |
project="${RUNNER_TEMP}/waffle-shop"
uv run --no-sync sqb playground "${project}"
uv run --no-sync sqb --project-dir "${project}" --no-color compile
if ! test -f "${project}/target/cache/compiler-native-v1/macro-calls.bin"; then
echo "The compile did not write the macro-call store; macro bridge debug log:"
rm -rf "${project}/target"
uv run --no-sync sqb --project-dir "${project}" --no-color --debug compile 2>&1 \
| grep "macro_bridge" || true
exit 1
fi
uv run --no-sync sqb --project-dir "${project}" --no-color build
nodes="${RUNNER_TEMP}/python-nodes"
uv run --no-sync sqb playground --template python_nodes "${nodes}"
uv run --no-sync sqb --project-dir "${nodes}" --no-color compile
format_performance:
name: Formatter performance guards
needs: [changes, lockfile]
if: needs.changes.outputs.format_performance == 'true'
runs-on: ubuntu-24.04
timeout-minutes: 45
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
with:
version: "0.12.3"
enable-cache: true
cache-dependency-glob: |
uv.lock
Cargo.lock
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
- uses: Swatinem/rust-cache@v2
with:
shared-key: verify-linux
save-if: false
- name: Install Python
run: uv python install 3.12
- name: Install dependencies
run: uv sync --locked --all-groups --all-extras --python 3.12
- name: Run formatter performance guards
timeout-minutes: 10
run: >-
uv run pytest
tests/e2e/src/sqlbuild/cli/commands/main/format/test_format_performance.py
-n auto --dist loadfile -m performance
performance:
name: Performance guards
needs: [changes, lockfile]
# Temporarily disabled while the Blacksmith runner allowance is unavailable.
# These budgets are calibrated for the 8-vCPU Blacksmith runner.
if: false
runs-on: ubuntu-24.04
timeout-minutes: 45
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
with:
version: "0.12.3"
enable-cache: true
cache-dependency-glob: |
uv.lock
Cargo.lock
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
- uses: Swatinem/rust-cache@v2
with:
shared-key: verify-linux
save-if: false
- name: Install Python
run: uv python install 3.12
- name: Install dependencies
run: uv sync --locked --all-groups --all-extras
- name: Run performance guards
run: make test-e2e-performance
cold_compile_performance:
name: Fresh-process compile (${{ matrix.models }} models)
needs: [changes, lockfile]
if: needs.changes.outputs.performance == 'true'
runs-on: ubuntu-24.04
timeout-minutes: 45
strategy:
fail-fast: false
matrix:
models: [3000, 5000, 10000]
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
with:
version: "0.12.3"
enable-cache: true
cache-dependency-glob: |
uv.lock
Cargo.lock
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
- uses: Swatinem/rust-cache@v2
with:
shared-key: verify-linux
save-if: false
- name: Install Python
run: uv python install 3.12
- name: Install dependencies
run: uv sync --locked --all-groups --all-extras
- name: Run fresh-process compile guard under 4 GiB
env:
BENCHMARK_MODELS: ${{ matrix.models }}
MEMORY_LIMIT_BYTES: "4294967296"
run: |
sudo systemd-run \
--unit="sqlbuild-cold-${BENCHMARK_MODELS}-${GITHUB_RUN_ID}" \
--uid="$(id -u)" \
--gid="$(id -g)" \
--same-dir \
--setenv="HOME=${HOME}" \
--setenv="PATH=${PATH}" \
--setenv="SQLBUILD_REQUIRE_MEMORY_LIMIT_BYTES=${MEMORY_LIMIT_BYTES}" \
--property="MemoryMax=${MEMORY_LIMIT_BYTES}" \
--property="MemorySwapMax=0" \
--wait \
--collect \
--pipe \
make test-e2e-cold-compile-performance \
SQLBUILD_BENCHMARK_MODELS="${BENCHMARK_MODELS}"
dense_compile_performance:
name: Dense all-rules compile (${{ matrix.models }} models)
needs: [changes, lockfile]
if: needs.changes.outputs.performance == 'true'
runs-on: ubuntu-24.04
# The 3k and 10k cells also run the delta edit-loop guard, about five minutes at 10k.
timeout-minutes: 45
strategy:
fail-fast: false
matrix:
models: [1000, 3000, 5000, 10000]
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
with:
version: "0.12.3"
enable-cache: true
cache-dependency-glob: |
uv.lock
Cargo.lock
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
- uses: Swatinem/rust-cache@v2
with:
shared-key: verify-linux
save-if: false
- name: Install Python
run: uv python install 3.12
- name: Install dependencies
run: uv sync --locked --all-groups --all-extras
- name: Run dense all-rules and delta edit-loop guards under 4 GiB
env:
BENCHMARK_MODELS: ${{ matrix.models }}
MEMORY_LIMIT_BYTES: "4294967296"
run: |
sudo systemd-run \
--unit="sqlbuild-dense-${BENCHMARK_MODELS}-${GITHUB_RUN_ID}" \
--uid="$(id -u)" \
--gid="$(id -g)" \
--same-dir \
--setenv="HOME=${HOME}" \
--setenv="PATH=${PATH}" \
--setenv="SQLBUILD_REQUIRE_MEMORY_LIMIT_BYTES=${MEMORY_LIMIT_BYTES}" \
--property="MemoryMax=${MEMORY_LIMIT_BYTES}" \
--property="MemorySwapMax=0" \
--wait \
--collect \
--pipe \
make test-e2e-dense-compile-performance \
SQLBUILD_BENCHMARK_MODELS="${BENCHMARK_MODELS}"
- name: Run diagnostic-heavy compile guards
if: matrix.models == 1000
run: make test-e2e-diagnostic-compile-performance
compile_performance_ratio:
name: Same-runner compile ratio (${{ matrix.label || matrix.kind }} 3000 models)
needs: [changes, lockfile]
if: needs.changes.outputs.performance == 'true'
runs-on: ubuntu-24.04
timeout-minutes: 45
strategy:
fail-fast: false
matrix:
include:
- kind: dense
max_ratio: "1.10"
edit_max_ratio: "1.20"
edit_max_cpu_ratio: "1.75"
- kind: fresh
max_ratio: "1.10"
- kind: dense
label: contracts CPU vs base
gate_phase: contracts_cpu_ms
max_ratio: "1.10"
- kind: dense
label: model analysis CPU vs base
gate_phase: model_analysis_cpu_ms
compile_args: --compile-arg=--select=*
max_ratio: "1.10"
- kind: dense
label: custom rules CPU vs base
gate_phase: custom_rules_cpu_ms
# Temporary migration allowance; restore 1.10 after custom-host projection optimization.
# Whole-command CPU, wall-time, memory and correctness gates retain their limits.
max_ratio: "1.35"
steps:
- uses: actions/checkout@v4
- name: Check out the comparison base
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.base.sha || github.event.merge_group.base_sha || 'main' }}
path: base
- uses: astral-sh/setup-uv@v5
with:
version: "0.12.3"
enable-cache: true
cache-dependency-glob: |
uv.lock
Cargo.lock
base/uv.lock
base/Cargo.lock
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
- uses: Swatinem/rust-cache@v2
with:
shared-key: verify-linux
save-if: false
- name: Install Python
run: uv python install 3.12
- name: Seed the base build directory with the cached dependency builds
run: |
if [[ -d target ]]; then
cp -a target base/target
fi
- name: Install head dependencies
run: uv sync --locked --all-groups --all-extras
- name: Install base dependencies
working-directory: base
run: uv sync --locked --all-groups --all-extras
- name: Compare base and head phase CPU
if: matrix.gate_phase
env:
KIND: ${{ matrix.kind }}
MAX_RATIO: ${{ matrix.max_ratio }}
GATE_PHASE: ${{ matrix.gate_phase }}
COMPILE_ARGS: ${{ matrix.compile_args }}
run: |
uv run python -m scripts.compare_compile_performance \
--kind "${KIND}" \
--modes cold \
--max-ratio "${MAX_RATIO}" \
--models 3000 \
--base-root base \
--base-python base/.venv/bin/python \
--head-python .venv/bin/python \
--gate-phase "${GATE_PHASE}" \
${COMPILE_ARGS:+"${COMPILE_ARGS}"}
- name: Compare base and head cold, warm and one-model edit compiles
if: ${{ !matrix.gate_phase }}
env:
KIND: ${{ matrix.kind }}
MAX_RATIO: ${{ matrix.max_ratio }}
EDIT_MAX_RATIO: ${{ matrix.edit_max_ratio }}
EDIT_MAX_CPU_RATIO: ${{ matrix.edit_max_cpu_ratio }}
run: |
uv run python -m scripts.compare_compile_performance \
--kind "${KIND}" \
--modes cold warm edit \
${EDIT_MAX_RATIO:+--edit-max-ratio "$EDIT_MAX_RATIO"} \
${EDIT_MAX_CPU_RATIO:+--edit-max-cpu-ratio "$EDIT_MAX_CPU_RATIO"} \
--max-ratio "${MAX_RATIO}" \
--models 3000 \
--base-root base \
--base-python base/.venv/bin/python \
--head-python .venv/bin/python
cache_compile_performance:
name: Fresh-process compile cache (${{ matrix.models }} models)
needs: [changes, lockfile]
if: needs.changes.outputs.performance == 'true'
runs-on: ubuntu-24.04
timeout-minutes: 45
strategy:
fail-fast: false
matrix:
models: [3000, 5000, 10000]
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
with:
version: "0.12.3"
enable-cache: true
cache-dependency-glob: |
uv.lock
Cargo.lock
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
- uses: Swatinem/rust-cache@v2
with:
shared-key: verify-linux
save-if: false
- name: Install Python
run: uv python install 3.12
- name: Install dependencies
run: uv sync --locked --all-groups --all-extras
- name: Run fresh-process compile cache guard under 4 GiB
timeout-minutes: 15
env:
BENCHMARK_MODELS: ${{ matrix.models }}
MEMORY_LIMIT_BYTES: "4294967296"
run: |
sudo systemd-run \
--unit="sqlbuild-cache-${BENCHMARK_MODELS}-${GITHUB_RUN_ID}" \
--uid="$(id -u)" \
--gid="$(id -g)" \
--same-dir \
--setenv="HOME=${HOME}" \
--setenv="PATH=${PATH}" \
--setenv="SQLBUILD_REQUIRE_MEMORY_LIMIT_BYTES=${MEMORY_LIMIT_BYTES}" \
--property="MemoryMax=${MEMORY_LIMIT_BYTES}" \
--property="MemorySwapMax=0" \
--wait \
--collect \
--pipe \
make test-e2e-cache-compile-performance \
SQLBUILD_BENCHMARK_MODELS="${BENCHMARK_MODELS}"
- name: Run varied 1k warm-cache guard under 4 GiB
if: matrix.models == 3000
timeout-minutes: 15
env:
MEMORY_LIMIT_BYTES: "4294967296"
run: |
sudo systemd-run \
--unit="sqlbuild-varied-cache-${GITHUB_RUN_ID}" \
--uid="$(id -u)" \
--gid="$(id -g)" \
--same-dir \
--setenv="HOME=${HOME}" \
--setenv="PATH=${PATH}" \
--setenv="SQLBUILD_REQUIRE_MEMORY_LIMIT_BYTES=${MEMORY_LIMIT_BYTES}" \
--property="MemoryMax=${MEMORY_LIMIT_BYTES}" \
--property="MemorySwapMax=0" \
--wait \
--collect \
--pipe \
make test-e2e-varied-cache-performance
rules_performance:
name: Rules performance guards
needs: [changes, lockfile]
# Temporarily disabled while the Blacksmith runner allowance is unavailable.
# These budgets are calibrated for the 8-vCPU Blacksmith runner.
if: false
runs-on: ubuntu-24.04
timeout-minutes: 45
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
with:
version: "0.12.3"
enable-cache: true
cache-dependency-glob: |
uv.lock
Cargo.lock
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
- uses: Swatinem/rust-cache@v2
with:
shared-key: verify-linux
save-if: false
- name: Install Python
run: uv python install 3.12
- name: Install dependencies
run: uv sync --locked --all-groups --all-extras
- name: Run required Rules performance profile
timeout-minutes: 10
run: >-
uv run python -m scripts.benchmark_rules_ci
--output "${RUNNER_TEMP}/rules-performance-ci.json"
--summary-output "${RUNNER_TEMP}/rules-performance-ci.md"
--max-seconds 420
- name: Publish benchmark summary
if: always()
run: |
if [[ -f "${RUNNER_TEMP}/rules-performance-ci.md" ]]; then
cat "${RUNNER_TEMP}/rules-performance-ci.md" >> "${GITHUB_STEP_SUMMARY}"
fi
- name: Upload benchmark evidence
if: always()
uses: actions/upload-artifact@v4
with:
name: rules-performance-${{ github.run_id }}-${{ github.run_attempt }}
path: |
${{ runner.temp }}/rules-performance-ci.json
${{ runner.temp }}/rules-performance-ci.md
if-no-files-found: error
retention-days: 90
postgres:
name: PostgreSQL integration and E2E tests
needs: [changes, lockfile]
if: needs.changes.outputs.postgres == 'true'
runs-on: ubuntu-24.04
timeout-minutes: 45
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
with:
version: "0.12.3"
enable-cache: true
cache-dependency-glob: |
uv.lock
Cargo.lock
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
- uses: Swatinem/rust-cache@v2
with:
shared-key: verify-linux
save-if: false
- name: Install Python
run: uv python install 3.12
- name: Install dependencies
run: uv sync --locked --all-groups --all-extras
- name: Verify Docker
run: docker info
- name: Run PostgreSQL tests
env:
PYTHONUNBUFFERED: "1"
TESTCONTAINERS_RYUK_DISABLED: "true"
run: >-
uv run pytest tests
-m "real_warehouse and postgres"
-vv --color=yes -n auto --dist loadfile
clickhouse:
name: ClickHouse integration and E2E tests
needs: [changes, lockfile]
if: needs.changes.outputs.clickhouse == 'true'
runs-on: ubuntu-24.04
timeout-minutes: 45
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
with:
version: "0.12.3"
enable-cache: true
cache-dependency-glob: |
uv.lock
Cargo.lock
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
- uses: Swatinem/rust-cache@v2
with:
shared-key: verify-linux
save-if: false
- name: Install Python
run: uv python install 3.12
- name: Install dependencies
run: uv sync --locked --all-groups --all-extras
- name: Verify Docker
run: docker info
- name: Run ClickHouse tests
env:
PYTHONUNBUFFERED: "1"
TESTCONTAINERS_RYUK_DISABLED: "true"
run: >-
uv run pytest tests
-m "real_warehouse and clickhouse"
-vv --color=yes -n auto --dist loadfile
wheels:
name: Wheels
needs: [changes]
if: needs.changes.outputs.wheels == 'true'
uses: ./.github/workflows/build-distributions.yml
with:
sdist: false
verify:
# The required Verify of a Release Please pull request is the commit status that the trusted
# release checks in release-please.yml post on the branch's current head, after the lockfile
# refresh and every dispatched check. This job reports under another name there, so its quick
# metadata-only pass can never satisfy Verify first; a skipped job would count as passing, so
# the job always runs and only its name changes. Until those checks post Verify on the head,
# the pull request waits for an expected check, and every new push to the branch waits again.
name: >-
${{ (github.event_name == 'pull_request'
&& github.event.pull_request.head.repo.full_name == github.repository
&& startsWith(github.event.pull_request.head.ref, 'release-please--branches--'))
&& 'Release pull request suites' || 'Verify' }}
if: always()
needs:
[
changes,
lockfile,
checks,
e2e_shards,
compiler_differential,
compiler_differential_python_versions,
native_discovery_windows,
format_performance,
performance,