Skip to content

Commit

Permalink
first pass
Browse files Browse the repository at this point in the history
  • Loading branch information
paleolimbot committed Aug 14, 2023
1 parent 36f7233 commit 5b04f9b
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 1 deletion.
1 change: 1 addition & 0 deletions ci/conda_env_docs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ sphinx-autobuild
sphinx-copybutton
sphinx-design
sphinxcontrib-mermaid
r-pkgdown
8 changes: 8 additions & 0 deletions ci/scripts/docs_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@ main() {
pushd "$source_dir/docs"
make html
make doctest
popd

for desc_file in $(find "${source_dir}/r" -name DESCRIPTION); do
local -r pkg=$(dirname "$desc_file")
local -r pkg_name=$(basename $pkg)
R -e "pkgdown::build_site_github_pages(pkg = '$pkg', dest_dir = '$source_dir/docs/r/$pkg_name')"
done

}

main "$@"
68 changes: 68 additions & 0 deletions ci/scripts/r_build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
#!/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_FLIGHTSQL:=${BUILD_ALL}}
: ${BUILD_DRIVER_MANAGER:=${BUILD_ALL}}
: ${BUILD_DRIVER_POSTGRESQL:=${BUILD_ALL}}
: ${BUILD_DRIVER_SQLITE:=${BUILD_ALL}}
: ${BUILD_DRIVER_SNOWFLAKE:=${BUILD_ALL}}

if [[ $(uname) = "Darwin" ]]; then
ADBC_LIBRARY_SUFFIX="dylib"
else
ADBC_LIBRARY_SUFFIX="so"
fi

install_pkg() {
local -r source_dir="${1}"
local -r install_dir="${2}"
local -r pkg="${3}"
R CMD INSTALL "${source_dir}/r/${pkg}" --preclean --library="${install_dir}"
}

main() {
local -r source_dir="${1}"
local -r install_dir="${2}"

R_LIBS_USER="${install_dir}" R -e 'install.packages("nanoarrow", repos = "https://cloud.r-project.org/")' --vanilla

if [[ "${BUILD_DRIVER_MANAGER}" -gt 0 ]]; then
install_pkg "${source_dir}" "${install_dir}" adbcdrivermanager
fi

if [[ "${BUILD_DRIVER_FLIGHTSQL}" -gt 0 ]]; then
install_pkg "${source_dir}" "${install_dir}" adbcflightsql
fi

if [[ "${BUILD_DRIVER_POSTGRESQL}" -gt 0 ]]; then
install_pkg "${source_dir}" "${install_dir}" adbcpostgresql
fi

if [[ "${BUILD_DRIVER_SQLITE}" -gt 0 ]]; then
install_pkg "${source_dir}" "${install_dir}" adbcsqlite
fi

if [[ "${BUILD_DRIVER_SNOWFLAKE}" -gt 0 ]]; then
install_pkg "${source_dir}" "${install_dir}" adbcsnowflake
fi
}

main "$@"
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ services:
volumes:
- .:/adbc:delegated
command: |
/bin/bash -c 'git config --global --add safe.directory /adbc && source /opt/conda/etc/profile.d/conda.sh && mamba create -y -n adbc -c conda-forge go --file /adbc/ci/conda_env_cpp.txt --file /adbc/ci/conda_env_docs.txt --file /adbc/ci/conda_env_python.txt && conda activate adbc && env ADBC_USE_ASAN=0 ADBC_USE_UBSAN=0 /adbc/ci/scripts/cpp_build.sh /adbc /adbc/build && env CGO_ENABLED=1 /adbc/ci/scripts/go_build.sh /adbc /adbc/build && /adbc/ci/scripts/python_build.sh /adbc /adbc/build && /adbc/ci/scripts/docs_build.sh /adbc'
/bin/bash -c 'git config --global --add safe.directory /adbc && source /opt/conda/etc/profile.d/conda.sh && mamba create -y -n adbc -c conda-forge go --file /adbc/ci/conda_env_cpp.txt --file /adbc/ci/conda_env_docs.txt --file /adbc/ci/conda_env_python.txt && conda activate adbc && env ADBC_USE_ASAN=0 ADBC_USE_UBSAN=0 /adbc/ci/scripts/cpp_build.sh /adbc /adbc/build && env CGO_ENABLED=1 /adbc/ci/scripts/go_build.sh /adbc /adbc/build && /adbc/ci/scripts/python_build.sh /adbc /adbc/build && /adbc/ci/scripts/r_build.sh /adbc && /adbc/ci/scripts/docs_build.sh /adbc'
golang-sqlite-flightsql:
image: ${REPO}:golang-${GO}-sqlite-flightsql
Expand Down

0 comments on commit 5b04f9b

Please sign in to comment.