255 lines
9.3 KiB
YAML
255 lines
9.3 KiB
YAML
# # # # # # # # # # # # # # # # # #
|
|
#
|
|
# WARNING: DEPRECATED!
|
|
#
|
|
# # # # # # # # # # # # # # # # # #
|
|
|
|
name: "Build Extensions"
|
|
description: "Build, test and deploy the DuckDB extensions"
|
|
inputs:
|
|
# Test config
|
|
run_tests:
|
|
description: 'Run extension tests after build'
|
|
default: '1'
|
|
run_autoload_tests:
|
|
description: 'Runs the autoloading tests'
|
|
default: '1'
|
|
|
|
# Deploy config
|
|
deploy_as:
|
|
description: 'Binary architecture name for deploy step - DEPRECATED'
|
|
default: ''
|
|
deploy_version:
|
|
description: 'Version tag or commit short hash for deploy step'
|
|
default: ''
|
|
s3_id:
|
|
description: 'S3 key ID'
|
|
default: ''
|
|
s3_key:
|
|
description: 'S3 key secret'
|
|
default: ''
|
|
signing_pk:
|
|
description: 'Extension signing RSA private key'
|
|
default: ''
|
|
|
|
# Build config
|
|
duckdb_arch:
|
|
description: 'Provide DUCKDB_PLATFORM to build system for cross compilation'
|
|
default: ''
|
|
static_link_build:
|
|
description: 'Links DuckDB statically to the loadable extensions'
|
|
default: '1'
|
|
no_static_linking:
|
|
description: 'Disables linking extensions into DuckDB for testing'
|
|
default: '0'
|
|
vcpkg_build:
|
|
description: 'Installs vcpkg and pass its toolchain to CMakes'
|
|
default: '1'
|
|
build_dir:
|
|
description: 'DuckDB source directory to run the build in'
|
|
default: '.'
|
|
ninja:
|
|
description: 'Use ninja for building'
|
|
default: '0'
|
|
openssl_path:
|
|
description: 'Directory of OpenSSL installation'
|
|
default: ''
|
|
post_install:
|
|
description: 'Post-install scripts to run'
|
|
default: ''
|
|
treat_warn_as_error:
|
|
description: 'Treat compilation warnings as errors'
|
|
default: '1'
|
|
build_in_tree_extensions:
|
|
description: 'Build in-tree extensions'
|
|
default: '1'
|
|
build_out_of_tree_extensions:
|
|
description: 'Build out-of-tree extensions'
|
|
default: '1'
|
|
build_complete_extensions_set:
|
|
description: 'Whether all extensions needs to be built'
|
|
default: '1'
|
|
bundle_static_lib_mode:
|
|
description: 'Build the default bundled extensions to publish the static libs'
|
|
default: '0'
|
|
osx_universal:
|
|
description: 'Build Universal Binary for OSX'
|
|
default: '0'
|
|
osx_arch:
|
|
description: 'Build specific architecture for OSX'
|
|
default: ''
|
|
aarch64_cross_compile:
|
|
description: 'Enable Linux aarch64 cross-compiling'
|
|
default: '0'
|
|
vcpkg_target_triplet:
|
|
description: 'Target triplet for installing vcpkg dependencies'
|
|
default: ''
|
|
override_cc:
|
|
description: 'Override C Compiler'
|
|
default: ''
|
|
override_cxx:
|
|
description: 'Override CXX Compiler'
|
|
default: ''
|
|
unittest_script:
|
|
description: 'Script/program to execute the unittests'
|
|
default: 'python3 scripts/run_tests_one_by_one.py ./build/release/test/unittest'
|
|
cmake_flags:
|
|
description: 'Flags to be passed to cmake'
|
|
default: ''
|
|
|
|
runs:
|
|
using: "composite"
|
|
steps:
|
|
- name: Setup DuckDB extension build config
|
|
shell: bash
|
|
run: |
|
|
export EXTENSION_CONFIGS="$EXTENSION_CONFIGS;${{ inputs.bundle_static_lib_mode == 1 && '.github/config/bundled_extensions.cmake' || ''}}"
|
|
export EXTENSION_CONFIGS="$EXTENSION_CONFIGS;${{ inputs.build_in_tree_extensions == 1 && '.github/config/in_tree_extensions.cmake' || ''}}"
|
|
export EXTENSION_CONFIGS="$EXTENSION_CONFIGS;${{ inputs.build_out_of_tree_extensions == 1 && '.github/config/out_of_tree_extensions.cmake' || '' }}"
|
|
echo "EXTENSION_CONFIGS=$EXTENSION_CONFIGS" >> $GITHUB_ENV
|
|
|
|
- name: Setup vcpkg
|
|
if: ${{ inputs.vcpkg_build == 1 }}
|
|
uses: lukka/run-vcpkg@v11.1
|
|
with:
|
|
vcpkgGitCommitId: ce613c41372b23b1f51333815feb3edd87ef8a8b
|
|
|
|
- name: Set vcpkg env variables
|
|
if: ${{ inputs.vcpkg_build == 1 }}
|
|
shell: bash
|
|
run: |
|
|
echo "VCPKG_TOOLCHAIN_PATH=$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake" >> $GITHUB_ENV
|
|
echo "VCPKG_TARGET_TRIPLET=${{ inputs.vcpkg_target_triplet }}" >> $GITHUB_ENV
|
|
echo "BUILD_COMPLETE_EXTENSION_SET=${{ inputs.build_complete_extensions_set }}" >> $GITHUB_ENV
|
|
|
|
- name: workaround for https://github.com/duckdb/duckdb/issues/8360
|
|
if: inputs.vcpkg_target_triplet == 'x64-windows-static-md'
|
|
shell: bash
|
|
run: |
|
|
cd $VCPKG_ROOT
|
|
mkdir -p downloads
|
|
cd downloads
|
|
curl -O -L https://github.com/duckdb/duckdb-data/releases/download/v1.0/nasm-2.16.01-win64.zip
|
|
ls -al
|
|
pwd
|
|
|
|
- name: Set Openssl dir
|
|
if: inputs.openssl_path != ''
|
|
shell: bash
|
|
run: |
|
|
echo "OPENSSL_ROOT_DIR=${{ inputs.openssl_path }}" >> $GITHUB_ENV
|
|
|
|
- name: Create combined vcpkg manifest
|
|
if: ${{ inputs.vcpkg_build == '1' && inputs.build_out_of_tree_extensions == '1' }}
|
|
shell: bash
|
|
run: |
|
|
make extension_configuration
|
|
|
|
- name: Build
|
|
shell: bash
|
|
env:
|
|
TREAT_WARNINGS_AS_ERRORS: ${{ inputs.treat_warn_as_error}}
|
|
FORCE_WARN_UNUSED: 1
|
|
STATIC_OPENSSL: 1
|
|
EXTENSION_STATIC_BUILD: ${{ inputs.static_link_build }}
|
|
OSX_BUILD_UNIVERSAL: ${{ inputs.osx_universal }}
|
|
OSX_BUILD_ARCH: ${{ inputs.osx_arch }}
|
|
DISABLE_BUILTIN_EXTENSIONS: ${{ inputs.no_static_linking}}
|
|
CC: ${{ inputs.aarch64_cross_compile == 1 && 'aarch64-linux-gnu-gcc' || inputs.override_cc }}
|
|
CXX: ${{ inputs.aarch64_cross_compile == 1 && 'aarch64-linux-gnu-g++' || inputs.override_cxx}}
|
|
LOCAL_EXTENSION_REPO: ${{ inputs.run_autoload_tests == 1 && github.workspace || ''}}
|
|
GEN: ${{ inputs.ninja == 1 && 'ninja' || '' }}
|
|
USE_MERGED_VCPKG_MANIFEST: 1
|
|
# TODO we should no longer override this but we should probably check that it is what we expect
|
|
DUCKDB_PLATFORM: ${{ inputs.duckdb_arch }}
|
|
CMAKE_VARS_BUILD: ${{ inputs.cmake_flags }}
|
|
|
|
run: |
|
|
ls
|
|
cd ${{ inputs.build_dir}}
|
|
ls -al
|
|
pwd
|
|
echo "$USER"
|
|
git config --global --add safe.directory '*'
|
|
make
|
|
ls
|
|
|
|
# Tests extension using regular require mechanism:
|
|
# - statically linked extensions are disable on startup but a sqlogictest require will call their load function
|
|
# - loadable-only extensions have their loadable extension loaded with the LOAD statement on a sqlogictest require
|
|
- name: Test statically linked extensions
|
|
if: ${{ inputs.run_tests == '1' && inputs.no_static_linking == '0' }}
|
|
shell: bash
|
|
run: |
|
|
${{ inputs.unittest_script }}
|
|
|
|
- name: Run post-install scripts
|
|
if: ${{ inputs.post_install != '' }}
|
|
shell: bash
|
|
run: |
|
|
ls
|
|
cd ${{ inputs.build_dir }}
|
|
${{ inputs.post_install }}
|
|
|
|
# The reason we need to rebuild is we need to test auto-loading extensions: this is only possible without the other
|
|
# extensions linked
|
|
- name: Rebuild DuckDB without any extensions, but with all extension tests
|
|
if: ${{ inputs.run_autoload_tests == '1' }}
|
|
shell: bash
|
|
env:
|
|
EXTENSION_TESTS_ONLY: 1
|
|
ENABLE_EXTENSION_AUTOLOADING: 1
|
|
ENABLE_EXTENSION_AUTOINSTALL: 1
|
|
GEN: ${{ inputs.ninja == '1' && 'ninja' || '' }}
|
|
USE_MERGED_VCPKG_MANIFEST: 1
|
|
run: |
|
|
cd ${{ inputs.build_dir}}
|
|
rm -rf duckdb_unittest_tempdir/*
|
|
mv build/release/extension build/extension_tmp
|
|
rm -rf build/release
|
|
VCPKG_TOOLCHAIN_PATH="" make
|
|
|
|
# Run all unittests (including the out-of-tree tests) without any extensions linked, relying on the autoloader
|
|
- name: Run tests with auto loading
|
|
if: ${{ inputs.run_autoload_tests == '1' }}
|
|
shell: bash
|
|
env:
|
|
LOCAL_EXTENSION_REPO: ${{ inputs.run_autoload_tests == '1' && github.workspace || ''}}
|
|
DUCKDB_TEST_DESCRIPTION: 'Extension autoloading tests. All `require` calls are ignored and auto-loading is tested. Use require no_extension_autoloading in the test to skip tests.'
|
|
run: |
|
|
cd ${{ inputs.build_dir}}
|
|
python3 scripts/get_test_list.py --file-contains 'require ' --list '"*.test"' > test.list
|
|
python3 scripts/get_test_list.py --file-contains 'require-env LOCAL_EXTENSION_REPO' --list '"*.test"' >> test.list
|
|
${{ inputs.unittest_script }} '-f test.list'
|
|
rm -rf build/release/extension
|
|
mv build/extension_tmp build/release/extension
|
|
|
|
- name: Run tests with auto loading with VS2019 C++ stdlib
|
|
if: ${{ inputs.run_autoload_tests == '1' && inputs.vcpkg_target_triplet == 'x64-windows-static-md' }}
|
|
shell: bash
|
|
env:
|
|
LOCAL_EXTENSION_REPO: ${{ inputs.run_autoload_tests == '1' && github.workspace || ''}}
|
|
run: |
|
|
rm -rf build/extension_tmp
|
|
mv build/release/extension build/extension_tmp
|
|
choco install wget -y --no-progress
|
|
cd ${{ inputs.build_dir }}
|
|
TEST_RUNNER_DIR=./build/release/test/Release
|
|
if [ ! -f ${TEST_RUNNER_DIR}/unittest.exe ]; then
|
|
echo "Invalid unit tests runner dir: ${TEST_RUNNER_DIR}, check 'inputs.unittest_script' argument"
|
|
exit 1
|
|
fi
|
|
wget -P ${TEST_RUNNER_DIR} https://blobs.duckdb.org/ci/msvcp140.dll
|
|
ls ${TEST_RUNNER_DIR}
|
|
# test.list is generated on the previous step
|
|
${{ inputs.unittest_script }} '-f test.list'
|
|
rm ${TEST_RUNNER_DIR}/msvcp140.dll
|
|
rm -rf ./build/release/extension
|
|
mv ./build/extension_tmp ./build/release/extension
|
|
|
|
- name: Deploy
|
|
if: ${{ inputs.deploy_as != '' }}
|
|
shell: bash
|
|
run: |
|
|
exit 1
|