From 6562e5c95ad5788dceef455ca20680f0fcb171c6 Mon Sep 17 00:00:00 2001 From: Arun Sharma Date: Sat, 4 Jul 2026 09:04:35 -0700 Subject: [PATCH 1/3] CI: consolidate three separate rebuilds into one release build with ccache Replace the three separate cmake configure+build cycles (extension-release, relwithdebinfo, extension-test-build) with a single Release-mode build that includes extensions, extension tests, base tests, and the shell. Pass `release` to generate-tinysnb.py so it picks the right build dir. Also update test_helper.py in the ladybug repo to read LBUG_BUILD_TYPE from the environment (defaults to relwithdebinfo). Fixes https://github.com/LadybugDB/extensions/issues/24 --- .github/workflows/ci.yml | 56 +++++++++++++--------------------------- 1 file changed, 18 insertions(+), 38 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 352274e..36b5c99 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -306,8 +306,11 @@ jobs: con.close() PY - # ── Build extensions (release) ──────────────────────────────── - - name: Build extensions + # ── Build extensions, test infrastructure, and extension tests ── + # Single release build with ccache — replaces what was previously 3 + # separate cmake invocations (extension-release + relwithdebinfo + + # extension-test-build). + - name: Build extensions and tests working-directory: ladybug env: GH_TOKEN: ${{ github.token }} @@ -320,45 +323,21 @@ jobs: -DOPENSSL_INCLUDE_DIR=/usr/include/openssl3 \ -DOPENSSL_CRYPTO_LIBRARY=/usr/lib64/openssl3/libcrypto.so \ -DOPENSSL_SSL_LIBRARY=/usr/lib64/openssl3/libssl.so" - make extension-release - - # ── Build test infrastructure ───────────────────────────────── - - name: Build full test infrastructure (relwithdebinfo) - working-directory: ladybug - env: - GH_TOKEN: ${{ github.token }} - run: | - source /opt/rh/gcc-toolset-13/enable - export CC=gcc - export CXX=g++ - export EXTRA_CMAKE_FLAGS="\ - -DOPENSSL_ROOT_DIR=/usr/lib64/openssl3 \ - -DOPENSSL_INCLUDE_DIR=/usr/include/openssl3 \ - -DOPENSSL_CRYPTO_LIBRARY=/usr/lib64/openssl3/libcrypto.so \ - -DOPENSSL_SSL_LIBRARY=/usr/lib64/openssl3/libssl.so" - make relwithdebinfo - cp build/relwithdebinfo/tools/shell/lbug lbug.prod - - - name: Build extension tests - working-directory: ladybug - env: - GH_TOKEN: ${{ github.token }} - run: | - source /opt/rh/gcc-toolset-13/enable - export CC=gcc - export CXX=g++ - export EXTRA_CMAKE_FLAGS="\ - -DOPENSSL_ROOT_DIR=/usr/lib64/openssl3 \ - -DOPENSSL_INCLUDE_DIR=/usr/include/openssl3 \ - -DOPENSSL_CRYPTO_LIBRARY=/usr/lib64/openssl3/libcrypto.so \ - -DOPENSSL_SSL_LIBRARY=/usr/lib64/openssl3/libssl.so" - make extension-test-build - cp lbug.prod build/relwithdebinfo/tools/shell/lbug + cmake -B build/release \ + -DCMAKE_BUILD_TYPE=Release \ + -DBUILD_EXTENSIONS="${EXTENSION_LIST}" \ + -DBUILD_EXTENSION_TESTS=TRUE \ + -DBUILD_TESTS=TRUE \ + -DBUILD_SHELL=TRUE \ + -DENABLE_BACKTRACES=TRUE \ + ${EXTRA_CMAKE_FLAGS} . + cmake --build build/release -j "$(nproc)" + cp build/release/tools/shell/lbug lbug.prod # ── Test fixtures ───────────────────────────────────────────── - name: Generate test dataset working-directory: ladybug - run: uv run python3 scripts/generate-tinysnb.py + run: uv run python3 scripts/generate-tinysnb.py release - name: Start extension repo server (for remote-load tests) working-directory: ladybug @@ -373,7 +352,8 @@ jobs: E2E_TEST_FILES_DIRECTORY: extension run: | source /opt/rh/gcc-toolset-13/enable - ctest --test-dir build/relwithdebinfo/extension --output-on-failure -j "$(nproc)" + cp lbug.prod build/release/tools/shell/lbug + ctest --test-dir build/release/extension --output-on-failure -j "$(nproc)" # ── Collect & upload artifacts ──────────────────────────────── - name: Collect built artifacts From a10137415193b1ada745af82b5948781142130a1 Mon Sep 17 00:00:00 2001 From: Arun Sharma Date: Sat, 4 Jul 2026 09:59:10 -0700 Subject: [PATCH 2/3] CI: run both test suites (e2e runner + extension tests) matching make extension-test The test step now runs both ctest commands that runs: 1. python3 scripts/run_pgembed_fixture.py -- ctest --test-dir build/release/test/runner ... 2. ctest --test-dir build/release/extension ... --- .github/workflows/ci.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 36b5c99..9880303 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -346,6 +346,8 @@ jobs: sleep 3 # ── Run tests ───────────────────────────────────────────────── + # Runs both the e2e test runner (via pgembed Postgres fixture) and + # extension unit tests — matching what `make extension-test` does. - name: Run extension tests working-directory: ladybug env: @@ -353,7 +355,9 @@ jobs: run: | source /opt/rh/gcc-toolset-13/enable cp lbug.prod build/release/tools/shell/lbug - ctest --test-dir build/release/extension --output-on-failure -j "$(nproc)" + python3 scripts/run_pgembed_fixture.py -- \ + ctest --test-dir build/release/test/runner --output-on-failure -j 1 --exclude-regex "" && \ + ctest --test-dir build/release/extension --output-on-failure -j "$(nproc)" --exclude-regex "" # ── Collect & upload artifacts ──────────────────────────────── - name: Collect built artifacts From 751530b718fbd8e20128f65c77f182c92705ee5c Mon Sep 17 00:00:00 2001 From: Arun Sharma Date: Sat, 4 Jul 2026 10:09:18 -0700 Subject: [PATCH 3/3] CI: use uv run --python 3.12 for run_pgembed_fixture.py Avoids depending on the system Python version in the manylinux container. Also keeps from __future__ import annotations in the script itself as a safety net for older Python. --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9880303..e4b2733 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -355,7 +355,7 @@ jobs: run: | source /opt/rh/gcc-toolset-13/enable cp lbug.prod build/release/tools/shell/lbug - python3 scripts/run_pgembed_fixture.py -- \ + uv run --python 3.12 python3 scripts/run_pgembed_fixture.py -- \ ctest --test-dir build/release/test/runner --output-on-failure -j 1 --exclude-regex "" && \ ctest --test-dir build/release/extension --output-on-failure -j "$(nproc)" --exclude-regex ""