@@ -339,6 +339,9 @@ jobs:
339339 # every group before it merges, so a passing fast core reports as Verify and each pull
340340 # request runs the heavy suites once, in the queue. Unsetting the variable restores the old
341341 # behaviour.
342+ # GitHub takes the required Verify from the newest Verify check suite on the head. Re-running
343+ # an older suite never repaints it: to recover a head whose newest suite reported another
344+ # name, start a new suite (push, or remove and re-add full-verify), not a rerun.
342345 # The label and draft state come from the pull request as it is now, not the event payload:
343346 # `gh pr create --label` can deliver `labeled` before `opened`, and the later run cancels the
344347 # earlier one, so the surviving run must still see the label.
@@ -372,26 +375,56 @@ jobs:
372375 if : ${{ !((github.event.action == 'labeled' || github.event.action == 'unlabeled') && github.event.label.name != 'full-verify') }}
373376 runs-on : ubuntu-24.04
374377 steps :
378+ # Release Please pushes its version bump before release-please.yml refreshes Cargo.lock and
379+ # uv.lock in a commit of its own, so a bump head always disagrees with its lockfiles. That
380+ # head waits for the refresh commit, whose run checks the lockfiles. The refresh step itself
381+ # runs cargo metadata --locked and uv sync --locked before it commits, and the merge queue
382+ # always checks the lockfiles.
383+ - name : Wait for the release lockfile refresh
384+ id : release
385+ if : >-
386+ github.event_name == 'pull_request'
387+ && github.event.pull_request.head.repo.full_name == github.repository
388+ && startsWith(github.event.pull_request.head.ref, 'release-please--branches--')
389+ env :
390+ GH_TOKEN : ${{ github.token }}
391+ HEAD_SHA : ${{ github.event.pull_request.head.sha }}
392+ run : |
393+ subject="$(gh api "repos/${GITHUB_REPOSITORY}/commits/${HEAD_SHA}" \
394+ --jq '.commit.message | split("\n")[0]')"
395+ if [[ "${subject}" != "chore: refresh release lockfiles" ]]; then
396+ echo "pending=true" >> "${GITHUB_OUTPUT}"
397+ echo "Version bump ${HEAD_SHA}: the lockfile refresh commit's run checks the lockfiles" \
398+ | tee -a "${GITHUB_STEP_SUMMARY}"
399+ fi
375400 - uses : actions/checkout@v4
401+ if : steps.release.outputs.pending != 'true'
376402 - uses : ./.github/actions/setup-uv
403+ if : steps.release.outputs.pending != 'true'
377404 with :
378405 version : " 0.12.3"
379406 - uses : dtolnay/rust-toolchain@master
407+ if : steps.release.outputs.pending != 'true'
380408 with :
381409 toolchain : stable
382410 - name : Install Python
411+ if : steps.release.outputs.pending != 'true'
383412 run : uv python install 3.12
384413 - name : Verify lockfile
414+ if : steps.release.outputs.pending != 'true'
385415 run : uv lock --check --python 3.12
386416 - name : Verify native workspace lockfile
417+ if : steps.release.outputs.pending != 'true'
387418 run : cargo metadata --locked --format-version 1 > /dev/null
388419
389- checks :
390- name : Static checks and unit + integration tests
420+ # The extension and CLI build once here; the static job and every test shard install these
421+ # wheels instead of compiling them again.
422+ native_build :
423+ name : Build the extension and CLI wheels
391424 needs : [changes, lockfile]
392425 if : needs.changes.outputs.checks == 'true'
393426 runs-on : ubuntu-24.04
394- timeout-minutes : 45
427+ timeout-minutes : 30
395428 steps :
396429 - uses : actions/checkout@v4
397430 - uses : ./.github/actions/setup-uv
@@ -413,8 +446,58 @@ jobs:
413446 save-if : false
414447 - name : Install Python
415448 run : uv python install 3.12
416- - name : Install dependencies
417- run : uv sync --locked --all-groups --all-extras
449+ - name : Install the build tools without building the packages
450+ run : uv sync --locked --all-groups --all-extras --no-install-package sqlbuild --no-install-package sqlbuild-cli
451+ - name : Build the extension and CLI wheels
452+ run : |
453+ uv run --no-sync maturin build --release --compatibility linux --out dist
454+ uv run --no-sync maturin build --manifest-path crates/sqlbuild-cli/Cargo.toml --release --compatibility linux --out dist
455+ - uses : actions/upload-artifact@v4
456+ with :
457+ name : verify-native-wheels
458+ path : dist/*.whl
459+ if-no-files-found : error
460+ compression-level : 0
461+ # Long enough for "Re-run failed jobs" on a shard, which reuses this run's wheels.
462+ retention-days : 3
463+ overwrite : true
464+
465+ checks :
466+ name : Static checks
467+ needs : [changes, lockfile, native_build]
468+ if : needs.changes.outputs.checks == 'true'
469+ runs-on : ubuntu-24.04
470+ timeout-minutes : 30
471+ env :
472+ # A syncing `uv run` would replace the installed wheels with a fresh editable build.
473+ UV_NO_SYNC : " 1"
474+ steps :
475+ - uses : actions/checkout@v4
476+ - uses : ./.github/actions/setup-uv
477+ with :
478+ version : " 0.12.3"
479+ enable-cache : true
480+ cache-dependency-glob : |
481+ uv.lock
482+ Cargo.lock
483+ # Clippy in check-ci builds its own check artifacts from the same cache as the native checks.
484+ - uses : dtolnay/rust-toolchain@master
485+ with :
486+ toolchain : stable
487+ - uses : Swatinem/rust-cache@v2
488+ with :
489+ shared-key : verify-checks
490+ save-if : false
491+ - name : Install Python
492+ run : uv python install 3.12
493+ - name : Install dependencies without building the packages
494+ run : uv sync --locked --all-groups --all-extras --no-install-package sqlbuild --no-install-package sqlbuild-cli
495+ - uses : actions/download-artifact@v4
496+ with :
497+ name : verify-native-wheels
498+ path : dist
499+ - name : Install the prebuilt extension and CLI
500+ run : uv pip install --no-deps dist/*.whl
418501 - uses : actions/setup-node@v4
419502 with :
420503 node-version : " 22"
@@ -428,14 +511,55 @@ jobs:
428511 run : make check-ci
429512 env :
430513 DUPES_BASE : ${{ github.event.pull_request.base.sha || github.event.merge_group.base_sha || 'origin/main' }}
514+
515+ tests :
516+ # check-test-shards, part of the static checks, proves that the TEST_SHARD_*_PATHS lists in
517+ # the Makefile run every test once; each of those lists needs an entry here.
518+ name : Unit + integration tests (${{ matrix.name }})
519+ needs : [changes, lockfile, native_build]
520+ if : needs.changes.outputs.checks == 'true'
521+ runs-on : ubuntu-24.04
522+ timeout-minutes : 30
523+ strategy :
524+ fail-fast : false
525+ matrix :
526+ include :
527+ - name : core
528+ target : test-shard-core
529+ workers : " 4"
530+ - name : publication
531+ target : test-shard-publication
532+ workers : " 2"
533+ - name : warehouse history
534+ target : test-shard-history
535+ workers : " 4"
536+ env :
537+ UV_NO_SYNC : " 1"
538+ PYTEST_XDIST_AUTO_NUM_WORKERS : ${{ matrix.workers }}
539+ steps :
540+ - uses : actions/checkout@v4
541+ - uses : ./.github/actions/setup-uv
542+ with :
543+ version : " 0.12.3"
544+ enable-cache : true
545+ - name : Install Python
546+ run : uv python install 3.12
547+ - name : Install dependencies without building the packages
548+ run : uv sync --locked --all-groups --all-extras --no-install-package sqlbuild --no-install-package sqlbuild-cli
549+ - uses : actions/download-artifact@v4
550+ with :
551+ name : verify-native-wheels
552+ path : dist
553+ - name : Install the prebuilt extension and CLI
554+ run : uv pip install --no-deps dist/*.whl
431555 - name : Prepare Docker worker tests
432556 run : |
433557 docker info > /dev/null
434558 docker pull alpine:3.23
435559 - name : Run unit and integration tests
436560 env :
437561 SQLBUILD_REQUIRE_DOCKER_TESTS : " 1"
438- run : make test
562+ run : make ${{ matrix.target }}
439563
440564 native_checks :
441565 name : Native workspace checks
@@ -1330,7 +1454,9 @@ jobs:
13301454 [
13311455 changes,
13321456 lockfile,
1457+ native_build,
13331458 checks,
1459+ tests,
13341460 native_checks,
13351461 e2e_shards,
13361462 compiler_differential,
@@ -1358,7 +1484,9 @@ jobs:
13581484 CHANGES_RESULT : ${{ needs.changes.result }}
13591485 CHECKS_SELECTED : ${{ needs.changes.outputs.checks }}
13601486 LOCKFILE_RESULT : ${{ needs.lockfile.result }}
1487+ NATIVE_BUILD_RESULT : ${{ needs.native_build.result }}
13611488 CHECKS_RESULT : ${{ needs.checks.result }}
1489+ TESTS_RESULT : ${{ needs.tests.result }}
13621490 NATIVE_CHECKS_RESULT : ${{ needs.native_checks.result }}
13631491 E2E_SHARDS_RESULT : ${{ needs.e2e_shards.result }}
13641492 COMPILER_DIFFERENTIAL_RESULT : ${{ needs.compiler_differential.result }}
@@ -1399,7 +1527,7 @@ jobs:
13991527 echo "Required classification or lockfile checks did not pass" >&2
14001528 exit 1
14011529 fi
1402- for result in "${CHECKS_RESULT}" "${NATIVE_CHECKS_RESULT}"; do
1530+ for result in "${NATIVE_BUILD_RESULT}" "${ CHECKS_RESULT}" "${TESTS_RESULT }" "${NATIVE_CHECKS_RESULT}"; do
14031531 if [[ "${result}" != "success" ]] && \
14041532 ! [[ "${CHECKS_SELECTED}" == "false" && "${result}" == "skipped" ]]; then
14051533 echo "Required static or native checks did not pass: ${result}" >&2
0 commit comments