You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by li...@apache.org on 2022/11/22 19:20:07 UTC

[arrow-adbc] branch main updated: ci(c): factor out build scripts (#191)

This is an automated email from the ASF dual-hosted git repository.

lidavidm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-adbc.git


The following commit(s) were added to refs/heads/main by this push:
     new 7328255  ci(c): factor out build scripts (#191)
7328255 is described below

commit 73282557174b927abd20f42d1f8190c7047f7a3a
Author: David Li <li...@gmail.com>
AuthorDate: Tue Nov 22 14:20:02 2022 -0500

    ci(c): factor out build scripts (#191)
---
 .github/workflows/cpp.yml                        | 146 ++++++++---------------
 .github/workflows/go.yml                         |  37 ++----
 ci/conda_env_python.txt                          |   1 +
 ci/scripts/cpp_build.sh                          |  86 +++++++++++++
 ci/scripts/cpp_test.sh                           |  69 +++++++++++
 ci/scripts/glib_build.sh                         |  67 +++++++++++
 ci/scripts/glib_test.sh                          |  70 +++++++++++
 ci/{conda_env_python.txt => scripts/go_build.sh} |  29 ++++-
 ci/{conda_env_python.txt => scripts/go_test.sh}  |  33 ++++-
 ci/scripts/python_build.sh                       |  61 ++++++++++
 ci/scripts/python_test.sh                        |  58 +++++++++
 11 files changed, 522 insertions(+), 135 deletions(-)

diff --git a/.github/workflows/cpp.yml b/.github/workflows/cpp.yml
index 3681dc8..4b47db3 100644
--- a/.github/workflows/cpp.yml
+++ b/.github/workflows/cpp.yml
@@ -82,119 +82,67 @@ jobs:
             --file ci/conda_env_docs.txt \
             --file ci/conda_env_glib.txt \
             --file ci/conda_env_python.txt
-      - name: Build/Test SQLite3 Driver
+
+      - name: Build SQLite3 Driver
         shell: bash -l {0}
         run: |
-          mkdir -p build/driver_sqlite
-          pushd build/driver_sqlite
-          cmake ../../c/driver/sqlite \
-            -DADBC_BUILD_SHARED=ON \
-            -DADBC_BUILD_STATIC=OFF \
-            -DADBC_BUILD_TESTS=ON \
-            -DADBC_USE_ASAN=ON \
-            -DADBC_USE_UBSAN=ON \
-            -DCMAKE_BUILD_TYPE=Debug \
-            -DCMAKE_INSTALL_LIBDIR=lib \
-            -DCMAKE_INSTALL_PREFIX=$HOME/local \
-            -DCMAKE_PREFIX_PATH=$CONDA_PREFIX
-          cmake --build . --target install
-          ctest --output-on-failure --no-tests=error
-          popd
-      - name: Build/Test Driver Manager
+          env BUILD_ALL=0 BUILD_DRIVER_SQLITE=1 ./ci/scripts/cpp_build.sh "$(pwd)" "$(pwd)/build"
+      - name: Test SQLite3 Driver
         shell: bash -l {0}
         run: |
-          mkdir -p build/driver_manager
-          pushd build/driver_manager
-          cmake ../../c/driver_manager \
-            -DADBC_BUILD_SHARED=ON \
-            -DADBC_BUILD_STATIC=OFF \
-            -DADBC_BUILD_TESTS=ON \
-            -DADBC_USE_ASAN=ON \
-            -DADBC_USE_UBSAN=ON \
-            -DCMAKE_BUILD_TYPE=Debug \
-            -DCMAKE_INSTALL_LIBDIR=lib \
-            -DCMAKE_INSTALL_PREFIX=$HOME/local \
-            -DCMAKE_PREFIX_PATH=$CONDA_PREFIX
-          cmake --build .
-          export DYLD_LIBRARY_PATH=$(pwd):$HOME/local/lib
-          export LD_LIBRARY_PATH=$(pwd):$HOME/local/lib
-          ./adbc-driver-manager-test
-          popd
-      - name: Install Driver Manager (No ASan)
+          env BUILD_ALL=0 BUILD_DRIVER_SQLITE=1 ./ci/scripts/cpp_test.sh "$(pwd)" "$(pwd)/build"
+      - name: Build Postgres Driver
         shell: bash -l {0}
+        # No test for now, since we need to spin up Postgres itself
         run: |
-          mkdir -p build/driver_manager_no_asan
-          pushd build/driver_manager_no_asan
-          cmake ../../c/driver_manager \
-            -DADBC_BUILD_SHARED=ON \
-            -DADBC_BUILD_STATIC=OFF \
-            -DCMAKE_BUILD_TYPE=Debug \
-            -DCMAKE_INSTALL_LIBDIR=lib \
-            -DCMAKE_INSTALL_PREFIX=$HOME/local \
-            -DCMAKE_PREFIX_PATH=$CONDA_PREFIX
-          cmake --build . --target install
-          popd
-      - name: Build/Test SQLite3 Driver (No ASan)
+          env BUILD_ALL=0 BUILD_DRIVER_POSTGRES=1 ./ci/scripts/cpp_build.sh "$(pwd)" "$(pwd)/build"
+      - name: Build Driver Manager
         shell: bash -l {0}
         run: |
-          # Build a no-ASan version that Python can easily load
-          mkdir -p build/driver_sqlite_no_asan
-          pushd build/driver_sqlite_no_asan
-          cmake ../../c/driver/sqlite \
-            -DADBC_BUILD_SHARED=ON \
-            -DADBC_BUILD_STATIC=OFF \
-            -DCMAKE_BUILD_TYPE=Debug \
-            -DCMAKE_INSTALL_LIBDIR=lib \
-            -DCMAKE_INSTALL_PREFIX=$HOME/local \
-            -DCMAKE_PREFIX_PATH=$CONDA_PREFIX
-          cmake --build . --target install
-          popd
-      - name: Build/Test Python Driver Manager
+          env BUILD_ALL=0 BUILD_DRIVER_MANAGER=1 ./ci/scripts/cpp_build.sh "$(pwd)" "$(pwd)/build"
+      - name: Test Driver Manager
         shell: bash -l {0}
         run: |
-          pushd python/adbc_driver_manager
-          pip install -e .[test]
-          export DYLD_LIBRARY_PATH=$HOME/local/lib
-          export LD_LIBRARY_PATH=$HOME/local/lib
-          python -m pytest -vv
-          popd
-      - name: Build/Test GLib Driver Manager
+          env BUILD_ALL=0 BUILD_DRIVER_MANAGER=1 ./ci/scripts/cpp_build.sh "$(pwd)" "$(pwd)/build"
+          env BUILD_ALL=0 BUILD_DRIVER_MANAGER=1 ./ci/scripts/cpp_test.sh "$(pwd)" "$(pwd)/build"
+
+      - name: Build and Install (No ASan)
+        shell: bash -l {0}
+        run: |
+          # Python and others need something that don't use the ASAN runtime
+          rm -rf "$(pwd)/build"
+          export BUILD_ALL=1
+          export ADBC_BUILD_TESTS=OFF
+          export ADBC_USE_ASAN=OFF
+          export ADBC_USE_UBSAN=OFF
+          ./ci/scripts/cpp_build.sh "$(pwd)" "$(pwd)/build" "$HOME/local"
+
+      - name: Build Python Driver Manager
         shell: bash -l {0}
         run: |
-          meson setup \
-            --buildtype=debug \
-            --cmake-prefix-path=$HOME/local:$CONDA_PREFIX \
-            --libdir=lib \
-            --pkg-config-path=$HOME/local/lib/pkgconfig:$CONDA_PREFIX/lib/pkgconfig \
-            --prefix=$HOME/local \
-            build/glib \
-            glib
-          meson install -C build/glib
-          export BUNDLE_GEMFILE=$(pwd)/glib/Gemfile
-          export DYLD_LIBRARY_PATH=$HOME/local/lib
-          export GI_TYPELIB_PATH=$(pwd)/build/glib/adbc-glib:$CONDA_PREFIX/lib/girepository-1.0
-          export LD_LIBRARY_PATH=$HOME/local/lib
-          bundle install
-          pushd build/glib
-          bundle exec \
-            env DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH} \
-              ruby ../../glib/test/run.rb
-          popd
-      - name: Test Ruby Driver Manager
+          env BUILD_ALL=0 BUILD_DRIVER_MANAGER=1 ./ci/scripts/python_build.sh "$(pwd)" "$(pwd)/build" "$HOME/local"
+      - name: Test Python Driver Manager
         shell: bash -l {0}
         run: |
-          export DYLD_LIBRARY_PATH=$HOME/local/lib
-          export GI_TYPELIB_PATH=$HOME/local/lib/girepository-1.0:$CONDA_PREFIX/lib/girepository-1.0
-          export LD_LIBRARY_PATH=$HOME/local/lib
-          export PKG_CONFIG_PATH=$HOME/local/lib/pkgconfig:$CONDA_PREFIX/lib/pkgconfig
-          pushd ruby
-          bundle install
-          bundle exec \
-            env DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH} \
-              ruby test/run.rb
-          bundle exec rake build
-          gem install pkg/*.gem
-          popd
+          env BUILD_ALL=0 BUILD_DRIVER_MANAGER=1 ./ci/scripts/python_test.sh "$(pwd)" "$(pwd)/build" "$HOME/local"
+      - name: Build Python Driver Postgres
+        shell: bash -l {0}
+        run: |
+          env BUILD_ALL=0 BUILD_DRIVER_POSTGRES=1 ./ci/scripts/python_build.sh "$(pwd)" "$(pwd)/build" "$HOME/local"
+      - name: Test Python Driver Postgres
+        shell: bash -l {0}
+        run: |
+          env BUILD_ALL=0 BUILD_DRIVER_POSTGRES=1 ./ci/scripts/python_test.sh "$(pwd)" "$(pwd)/build" "$HOME/local"
+
+      - name: Build GLib Driver Manager
+        shell: bash -l {0}
+        run: |
+          env BUILD_ALL=0 BUILD_DRIVER_MANAGER=1 ./ci/scripts/glib_build.sh "$(pwd)" "$(pwd)/build" "$HOME/local"
+      - name: Test GLib/Ruby Driver Manager
+        shell: bash -l {0}
+        run: |
+          env BUILD_ALL=0 BUILD_DRIVER_MANAGER=1 ./ci/scripts/glib_test.sh "$(pwd)" "$(pwd)/build" "$HOME/local"
+
       - name: Build Docs
         shell: bash -l {0}
         run: |
diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml
index dc2cc9c..1d7620e 100644
--- a/.github/workflows/go.yml
+++ b/.github/workflows/go.yml
@@ -64,9 +64,7 @@ jobs:
         run: go install honnef.co/go/tools/cmd/staticcheck@latest
       - name: Go Build
         run: |
-          pushd go/adbc
-          go build -v ./...
-          popd
+          ./ci/scripts/go_build.sh "$(pwd)" "$(pwd)/build" "$HOME/local"
       - name: Run Staticcheck
         run: |
           pushd go/adbc
@@ -74,9 +72,7 @@ jobs:
           popd
       - name: Go Test
         run: |
-          pushd go/adbc
-          go test -v ./...
-          popd
+          ./ci/scripts/go_test.sh "$(pwd)" "$(pwd)/build" "$HOME/local"
 
   go-driver-mgr-unix:
     name: "${{ matrix.os }} - CGO driver mgr"
@@ -124,18 +120,11 @@ jobs:
       - name: Build SQLite3 Driver
         shell: bash -l {0}
         run: |
-          mkdir -p build/driver_sqlite
-          pushd build/driver_sqlite
-          cmake ../../c/driver/sqlite \
-            -DADBC_BUILD_SHARED=ON \
-            -DADBC_BUILD_STATIC=OFF \
-            -DADBC_BUILD_TESTS=OFF \
-            -DCMAKE_BUILD_TYPE=Debug \
-            -DCMAKE_INSTALL_LIBDIR=lib \
-            -DCMAKE_INSTALL_PREFIX=$HOME/local \
-            -DCMAKE_PREFIX_PATH=$CONDA_PREFIX
-          cmake --build . --target install
-          popd
+          export BUILD_ALL=0
+          export BUILD_DRIVER_SQLITE=1
+          export ADBC_USE_ASAN=OFF
+          export ADBC_USE_UBSAN=OFF
+          ./ci/scripts/cpp_build.sh "$(pwd)" "$(pwd)/build" "$HOME/local"
       - name: Install staticcheck
         shell: bash -l {0}
         if: ${{ !contains('macos-latest', matrix.os) }}
@@ -143,12 +132,8 @@ jobs:
       - name: Go Build
         shell: bash -l {0}
         run: |
-          pushd go/adbc
           export PATH=$RUNNER_TOOL_CACHE/go/1.18.6/x64/bin:$PATH
-          export LD_LIBRARY_PATH=$HOME/local/lib
-          export DYLD_LIBRARY_PATH=$HOME/local/lib
-          go build -v ./...
-          popd
+          ./ci/scripts/go_build.sh "$(pwd)" "$(pwd)/build" "$HOME/local"
       - name: Run Staticcheck
         if: ${{ !contains('macos-latest', matrix.os) }}
         shell: bash -l {0}
@@ -159,9 +144,5 @@ jobs:
       - name: Go Test
         shell: bash -l {0}
         run: |
-          pushd go/adbc
           export PATH=$RUNNER_TOOL_CACHE/go/1.18.6/x64/bin:$PATH
-          export LD_LIBRARY_PATH=$HOME/local/lib
-          export DYLD_LIBRARY_PATH=$HOME/local/lib
-          go test -exec "env DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH" -v ./...
-          popd
+          ./ci/scripts/go_test.sh "$(pwd)" "$(pwd)/build" "$HOME/local"
diff --git a/ci/conda_env_python.txt b/ci/conda_env_python.txt
index 702f899..4c8b129 100644
--- a/ci/conda_env_python.txt
+++ b/ci/conda_env_python.txt
@@ -16,6 +16,7 @@
 # under the License.
 
 Cython
+pandas
 pyarrow>=8.0.0
 pytest
 setuptools
diff --git a/ci/scripts/cpp_build.sh b/ci/scripts/cpp_build.sh
new file mode 100755
index 0000000..5a6ed4c
--- /dev/null
+++ b/ci/scripts/cpp_build.sh
@@ -0,0 +1,86 @@
+#!/usr/bin/env bash
+# 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
+#
+#   http://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.
+
+set -e
+
+: ${BUILD_ALL:=1}
+: ${BUILD_DRIVER_MANAGER:=${BUILD_ALL}}
+: ${BUILD_DRIVER_POSTGRES:=${BUILD_ALL}}
+: ${BUILD_DRIVER_SQLITE:=${BUILD_ALL}}
+
+: ${ADBC_BUILD_SHARED:=ON}
+: ${ADBC_BUILD_STATIC:=OFF}
+: ${ADBC_BUILD_TESTS:=ON}
+: ${ADBC_USE_ASAN:=ON}
+: ${ADBC_USE_UBSAN:=ON}
+
+: ${CMAKE_BUILD_TYPE:=Debug}
+
+build_subproject() {
+    local -r source_dir="${1}"
+    local -r build_dir="${2}"
+    local -r install_dir="${3}"
+    local -r subproject="${4}"
+
+    if [[ -z "${CMAKE_INSTALL_PREFIX}" ]]; then
+        CMAKE_INSTALL_PREFIX="${install_dir}"
+    fi
+    echo "Installing to ${CMAKE_INSTALL_PREFIX}"
+
+    mkdir -p "${build_dir}/${subproject}"
+    pushd "${build_dir}/${subproject}"
+
+    set -x
+    cmake "${source_dir}/c/${subproject}" \
+          -DADBC_BUILD_SHARED="${ADBC_BUILD_SHARED}" \
+          -DADBC_BUILD_STATIC="${ADBC_BUILD_STATIC}" \
+          -DADBC_BUILD_TESTS="${ADBC_BUILD_TESTS}" \
+          -DADBC_USE_ASAN="${ADBC_USE_ASAN}" \
+          -DADBC_USE_UBSAN="${ADBC_USE_UBSAN}" \
+          -DCMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE}" \
+          -DCMAKE_INSTALL_LIBDIR=lib \
+          -DCMAKE_INSTALL_PREFIX="${CMAKE_INSTALL_PREFIX}"
+    set +x
+    cmake --build . --target install -j
+
+    popd
+}
+
+main() {
+    local -r source_dir="${1}"
+    local -r build_dir="${2}"
+    local install_dir="${3}"
+
+    if [[ -z "${install_dir}" ]]; then
+        install_dir="${build_dir}/local"
+    fi
+
+    if [[ "${BUILD_DRIVER_MANAGER}" -gt 0 ]]; then
+        build_subproject "${source_dir}" "${build_dir}" "${install_dir}" driver_manager
+    fi
+
+    if [[ "${BUILD_DRIVER_POSTGRES}" -gt 0 ]]; then
+        build_subproject "${source_dir}" "${build_dir}" "${install_dir}" driver/postgres
+    fi
+
+    if [[ "${BUILD_DRIVER_SQLITE}" -gt 0 ]]; then
+        build_subproject "${source_dir}" "${build_dir}" "${install_dir}" driver/sqlite
+    fi
+}
+
+main "$@"
diff --git a/ci/scripts/cpp_test.sh b/ci/scripts/cpp_test.sh
new file mode 100755
index 0000000..4f4b56b
--- /dev/null
+++ b/ci/scripts/cpp_test.sh
@@ -0,0 +1,69 @@
+#!/usr/bin/env bash
+# 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
+#
+#   http://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.
+
+set -e
+
+: ${BUILD_ALL:=1}
+: ${BUILD_DRIVER_MANAGER:=${BUILD_ALL}}
+: ${BUILD_DRIVER_POSTGRES:=${BUILD_ALL}}
+: ${BUILD_DRIVER_SQLITE:=${BUILD_ALL}}
+
+test_subproject() {
+    local -r build_dir="${1}"
+    local -r subproject="${2}"
+
+    echo "=== Testing ${subproject} ==="
+
+    pushd "${build_dir}/${subproject}"
+
+    if [[ "${subproject}" = "driver_manager" ]]; then
+        # macOS will not propagate DYLD_LIBRARY_PATH through a subprocess
+        ./adbc-driver-manager-test
+    else
+        ctest --output-on-failure --no-tests=error
+    fi
+
+    popd
+}
+
+main() {
+    local -r source_dir="${1}"
+    local -r build_dir="${2}"
+    local install_dir="${3}"
+
+    if [[ -z "${install_dir}" ]]; then
+        install_dir="${build_dir}/local"
+    fi
+
+    export DYLD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${install_dir}/lib"
+    export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${install_dir}/lib"
+
+    if [[ "${BUILD_DRIVER_MANAGER}" -gt 0 ]]; then
+        test_subproject "${build_dir}" driver_manager
+    fi
+
+    if [[ "${BUILD_DRIVER_POSTGRES}" -gt 0 ]]; then
+        test_subproject "${build_dir}" driver/postgres
+    fi
+
+    if [[ "${BUILD_DRIVER_SQLITE}" -gt 0 ]]; then
+        test_subproject "${build_dir}" driver/sqlite
+    fi
+}
+
+main "$@"
diff --git a/ci/scripts/glib_build.sh b/ci/scripts/glib_build.sh
new file mode 100755
index 0000000..c4e49a0
--- /dev/null
+++ b/ci/scripts/glib_build.sh
@@ -0,0 +1,67 @@
+#!/usr/bin/env bash
+# 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
+#
+#   http://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.
+
+set -e
+
+: ${BUILD_ALL:=1}
+: ${BUILD_DRIVER_MANAGER:=${BUILD_ALL}}
+
+build_subproject() {
+    local -r source_dir="${1}"
+    local -r build_dir="${2}"
+    local -r install_dir="${3}"
+
+    local cmake_prefix_path="${install_dir}"
+    local pkg_config_path="${install_dir}/lib/pkgconfig"
+    if [[ -n "${CMAKE_PREFIX_PATH}" ]]; then
+        cmake_prefix_path="${cmake_prefix_path}:${CMAKE_PREFIX_PATH}"
+    fi
+    if [[ -n "${PKG_CONFIG_PATH}" ]]; then
+        pkg_config_path="${pkg_config_path}:${PKG_CONFIG_PATH}"
+    fi
+    if [[ -n "${CONDA_PREFIX}" ]]; then
+        cmake_prefix_path="${CONDA_PREFIX}:${cmake_prefix_path}"
+        pkg_config_path="${pkg_config_path}:${CONDA_PREFIX}/lib/pkgconfig"
+    fi
+
+    meson setup \
+          --buildtype=debug \
+          --cmake-prefix-path="${cmake_prefix_path}" \
+          --libdir=lib \
+          --pkg-config-path="${pkg_config_path}" \
+          --prefix="${install_dir}" \
+          "${build_dir}/glib" \
+          "${source_dir}/glib"
+    meson install -C build/glib
+}
+
+main() {
+    local -r source_dir="${1}"
+    local -r build_dir="${2}"
+    local install_dir="${3}"
+
+    if [[ -z "${install_dir}" ]]; then
+        install_dir="${build_dir}/local"
+    fi
+
+    if [[ "${BUILD_DRIVER_MANAGER}" -gt 0 ]]; then
+        build_subproject "${source_dir}" "${build_dir}" "${install_dir}" adbc_driver_manager
+    fi
+}
+
+main "$@"
diff --git a/ci/scripts/glib_test.sh b/ci/scripts/glib_test.sh
new file mode 100755
index 0000000..d5d880a
--- /dev/null
+++ b/ci/scripts/glib_test.sh
@@ -0,0 +1,70 @@
+#!/usr/bin/env bash
+# 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
+#
+#   http://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.
+
+set -e
+
+: ${BUILD_ALL:=1}
+: ${BUILD_DRIVER_MANAGER:=${BUILD_ALL}}
+
+test_subproject() {
+    local -r source_dir="${1}"
+    local -r build_dir="${2}"
+    local -r install_dir="${3}"
+
+    export DYLD_LIBRARY_PATH="${install_dir}/lib"
+    export GI_TYPELIB_PATH="${source_dir}/build/glib/adbc-glib"
+    export LD_LIBRARY_PATH="${install_dir}/lib"
+    export PKG_CONFIG_PATH="${install_dir}/lib/pkgconfig"
+    if [[ -n "${CONDA_PREFIX}" ]]; then
+        export GI_TYPELIB_PATH="${GI_TYPELIB_PATH}:${CONDA_PREFIX}/lib/girepository-1.0"
+        export PKG_CONFIG_PATH="${PKG_CONFIG_PATH}:${CONDA_PREFIX}/lib/pkgconfig"
+    fi
+
+    pushd "${source_dir}/glib"
+    bundle install
+    bundle exec \
+           env DYLD_LIBRARY_PATH="${DYLD_LIBRARY_PATH}" \
+           ruby "${source_dir}/glib/test/run.rb"
+    popd
+
+    export GI_TYPELIB_PATH="${install_dir}/lib/girepository-1.0:${GI_TYPELIB_PATH}"
+    pushd "${source_dir}/ruby"
+    bundle install
+    bundle exec \
+           env DYLD_LIBRARY_PATH="${DYLD_LIBRARY_PATH}" \
+           ruby test/run.rb
+    bundle exec rake build
+    gem install pkg/*.gem
+    popd
+}
+
+main() {
+    local -r source_dir="${1}"
+    local -r build_dir="${2}"
+    local install_dir="${3}"
+
+    if [[ -z "${install_dir}" ]]; then
+        install_dir="${build_dir}/local"
+    fi
+
+    if [[ "${BUILD_DRIVER_MANAGER}" -gt 0 ]]; then
+        test_subproject "${source_dir}" "${build_dir}" "${install_dir}" adbc_driver_manager
+    fi
+}
+
+main "$@"
diff --git a/ci/conda_env_python.txt b/ci/scripts/go_build.sh
old mode 100644
new mode 100755
similarity index 63%
copy from ci/conda_env_python.txt
copy to ci/scripts/go_build.sh
index 702f899..23cdfcc
--- a/ci/conda_env_python.txt
+++ b/ci/scripts/go_build.sh
@@ -1,3 +1,4 @@
+#!/usr/bin/env bash
 # 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
@@ -15,7 +16,27 @@
 # specific language governing permissions and limitations
 # under the License.
 
-Cython
-pyarrow>=8.0.0
-pytest
-setuptools
+set -e
+
+main() {
+    local -r source_dir="${1}"
+    local -r build_dir="${2}"
+    local install_dir="${3}"
+
+    if [[ -z "${install_dir}" ]]; then
+        install_dir="${build_dir}/local"
+    fi
+
+    if [[ "${CGO_ENABLED}" = 1 ]]; then
+        export LD_LIBRARY_PATH="${install_dir}/lib"
+        export DYLD_LIBRARY_PATH="${install_dir}/lib"
+    fi
+
+    pushd "${source_dir}/go/adbc"
+
+    go build -v ./...
+
+    popd
+}
+
+main "$@"
diff --git a/ci/conda_env_python.txt b/ci/scripts/go_test.sh
old mode 100644
new mode 100755
similarity index 55%
copy from ci/conda_env_python.txt
copy to ci/scripts/go_test.sh
index 702f899..645a714
--- a/ci/conda_env_python.txt
+++ b/ci/scripts/go_test.sh
@@ -1,3 +1,4 @@
+#!/usr/bin/env bash
 # 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
@@ -15,7 +16,31 @@
 # specific language governing permissions and limitations
 # under the License.
 
-Cython
-pyarrow>=8.0.0
-pytest
-setuptools
+set -e
+
+main() {
+    local -r source_dir="${1}"
+    local -r build_dir="${2}"
+    local install_dir="${3}"
+
+    if [[ -z "${install_dir}" ]]; then
+        install_dir="${build_dir}/local"
+    fi
+
+    if [[ "${CGO_ENABLED}" = 1 ]]; then
+        export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${install_dir}/lib"
+        export DYLD_LIBRARY_PATH="${DYLD_LIBRARY_PATH}:${install_dir}/lib"
+    fi
+
+    pushd "${source_dir}/go/adbc"
+
+    if [[ "${CGO_ENABLED}" = 1 ]]; then
+        go test -exec "env DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH" -v ./...
+    else
+        go test -v ./...
+    fi
+
+    popd
+}
+
+main "$@"
diff --git a/ci/scripts/python_build.sh b/ci/scripts/python_build.sh
new file mode 100755
index 0000000..6d39a53
--- /dev/null
+++ b/ci/scripts/python_build.sh
@@ -0,0 +1,61 @@
+#!/usr/bin/env bash
+# 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
+#
+#   http://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.
+
+set -e
+
+: ${BUILD_ALL:=1}
+: ${BUILD_DRIVER_MANAGER:=${BUILD_ALL}}
+: ${BUILD_DRIVER_POSTGRES:=${BUILD_ALL}}
+
+if [[ $(uname) = "Darwin" ]]; then
+    ADBC_LIBRARY_SUFFIX="dylib"
+else
+    ADBC_LIBRARY_SUFFIX="so"
+fi
+
+build_subproject() {
+    local -r source_dir="${1}"
+    local -r install_dir="${2}"
+    local -r subproject="${3}"
+
+    if [[ "${subproject}" -eq "adbc_driver_postgres" ]]; then
+        export ADBC_POSTGRES_LIBRARY="${install_dir}/lib/libadbc_driver_postgres.${ADBC_LIBRARY_SUFFIX}"
+    fi
+
+    python -m pip install -e "${source_dir}/python/${subproject}"
+}
+
+main() {
+    local -r source_dir="${1}"
+    local -r build_dir="${2}"
+    local install_dir="${3}"
+
+    if [[ -z "${install_dir}" ]]; then
+        install_dir="${build_dir}/local"
+    fi
+
+    if [[ "${BUILD_DRIVER_MANAGER}" -gt 0 ]]; then
+        build_subproject "${source_dir}" "${install_dir}" adbc_driver_manager
+    fi
+
+    if [[ "${BUILD_DRIVER_POSTGRES}" -gt 0 ]]; then
+        build_subproject "${source_dir}" "${install_dir}" adbc_driver_postgres
+    fi
+}
+
+main "$@"
diff --git a/ci/scripts/python_test.sh b/ci/scripts/python_test.sh
new file mode 100755
index 0000000..17c56c1
--- /dev/null
+++ b/ci/scripts/python_test.sh
@@ -0,0 +1,58 @@
+#!/usr/bin/env bash
+# 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
+#
+#   http://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.
+
+set -e
+
+: ${BUILD_ALL:=1}
+: ${BUILD_DRIVER_MANAGER:=${BUILD_ALL}}
+: ${BUILD_DRIVER_POSTGRES:=${BUILD_ALL}}
+
+test_subproject() {
+    local -r source_dir=${1}
+    local -r install_dir=${2}
+    local -r subproject=${3}
+
+    if [[ "${subproject}" -eq "adbc_driver_manager" ]]; then
+        env \
+            DYLD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${install_dir}/lib" \
+            LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${install_dir}/lib" \
+            python -m pytest -vv "${source_dir}/python/${subproject}/tests"
+    else
+        python -m pytest -vv "${source_dir}/python/${subproject}/tests"
+    fi
+}
+
+main() {
+    local -r source_dir="${1}"
+    local -r build_dir="${2}"
+    local install_dir="${3}"
+
+    if [[ -z "${install_dir}" ]]; then
+        install_dir="${build_dir}/local"
+    fi
+
+    if [[ "${BUILD_DRIVER_MANAGER}" -gt 0 ]]; then
+        test_subproject "${source_dir}" "${install_dir}" adbc_driver_manager
+    fi
+
+    if [[ "${BUILD_DRIVER_POSTGRES}" -gt 0 ]]; then
+        test_subproject "${source_dir}" "${install_dir}" adbc_driver_postgres
+    fi
+}
+
+main "$@"