Merge pull request #630 from chdb-io/fix/playground-remove-cloud-cred… #1278
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build & Test Linux arm64 | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| TAG_NAME: | |
| description: 'Release Version Tag' | |
| required: true | |
| release: | |
| types: [created] | |
| push: | |
| branches: | |
| - main | |
| paths-ignore: | |
| - 'docs/**' | |
| - '.github/workflows/build_*_wheels*.yml' | |
| - '.github/workflows/external_clickhouse_integration.yaml' | |
| pull_request: | |
| types: [opened, synchronize, reopened, ready_for_review] | |
| branches: | |
| - main | |
| paths-ignore: | |
| - 'docs/**' | |
| - '.github/workflows/build_*_wheels*.yml' | |
| - '.github/workflows/external_clickhouse_integration.yaml' | |
| jobs: | |
| test_datastore: | |
| name: Test DataStore (Linux arm64) | |
| runs-on: [self-hosted, linux, arm64, ubuntu-latest] | |
| if: ${{ !github.event.pull_request.draft }} | |
| steps: | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y make build-essential libssl-dev zlib1g-dev \ | |
| libbz2-dev libreadline-dev wget curl \ | |
| libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev \ | |
| libffi-dev liblzma-dev libsqlite3-dev | |
| - name: Setup pyenv | |
| run: | | |
| rm -rf $HOME/.pyenv | |
| curl https://pyenv.run | bash | |
| export PATH="$HOME/.pyenv/bin:$PATH" | |
| eval "$(pyenv init -)" | |
| plain_pyenv_version() { | |
| local pattern="${1//./\\.}" | |
| pyenv versions --bare 2>/dev/null | grep -E "^${pattern}\.[0-9]+$" | tail -1 | |
| } | |
| INSTALLED="" | |
| set +e | |
| for v in 3.9 3.10 3.11 3.12 3.13 3.14; do | |
| echo "=== Installing Python $v ===" | |
| if pyenv install "$v:latest"; then | |
| installed_version="$(plain_pyenv_version "$v")" | |
| if [ -n "$installed_version" ]; then | |
| INSTALLED="$INSTALLED $installed_version" | |
| else | |
| echo "WARNING: pyenv installed no non-free-threaded Python $v, skipping" | |
| fi | |
| else | |
| echo "Normal install failed, retrying without ensurepip..." | |
| installed_ver=$(pyenv latest "$v" 2>/dev/null) | |
| if [ -n "$installed_ver" ]; then pyenv uninstall -f "$installed_ver" 2>/dev/null; fi | |
| PYTHON_CONFIGURE_OPTS="--without-ensurepip" pyenv install "$v:latest" || true | |
| installed_version="$(plain_pyenv_version "$v")" | |
| if [ -n "$installed_version" ]; then | |
| INSTALLED="$INSTALLED $installed_version" | |
| echo "Python $installed_version binary installed (pip bootstrap deferred)" | |
| else | |
| echo "WARNING: Python $v install failed completely, skipping" | |
| fi | |
| fi | |
| done | |
| set -e | |
| if [ -z "$INSTALLED" ]; then echo "No Python installed!"; exit 1; fi | |
| pyenv global $INSTALLED | |
| echo "Installed versions:" | |
| pyenv versions | |
| - name: Install dependencies for all Python versions | |
| run: | | |
| export PATH="$HOME/.pyenv/bin:$PATH" | |
| eval "$(pyenv init -)" | |
| plain_pyenv_version() { | |
| local pattern="${1//./\\.}" | |
| pyenv versions --bare 2>/dev/null | grep -E "^${pattern}\.[0-9]+$" | tail -1 | |
| } | |
| for version in 3.9 3.10 3.11 3.12 3.13 3.14; do | |
| PYTHON_VERSION="$(plain_pyenv_version "$version")" | |
| if [ -z "$PYTHON_VERSION" ]; then continue; fi | |
| echo "Installing dependencies for Python $PYTHON_VERSION" | |
| pyenv shell "$PYTHON_VERSION" | |
| if ! python -m pip --version 2>/dev/null; then | |
| echo "pip missing, bootstrapping..." | |
| curl -sS https://bootstrap.pypa.io/get-pip.py -o /tmp/get-pip.py | |
| python /tmp/get-pip.py || python -m ensurepip --upgrade || true | |
| fi | |
| python -m pip install --upgrade pip | |
| # pyarrow 25.0.0 corrupts parquet reads on linux-aarch64; remove this pin once a fixed pyarrow release is out | |
| python -m pip install setuptools tox pandas "pyarrow<25" wheel pytest pytest-cov | |
| pyenv shell --unset | |
| done | |
| - uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 | |
| - name: Build wheel | |
| run: | | |
| export PATH="$HOME/.pyenv/bin:$PATH" | |
| eval "$(pyenv init -)" | |
| plain_pyenv_version() { | |
| local pattern="${1//./\\.}" | |
| pyenv versions --bare 2>/dev/null | grep -E "^${pattern}\.[0-9]+$" | tail -1 | |
| } | |
| PYTHON_VERSION="$(plain_pyenv_version 3.9)" | |
| if [ -z "$PYTHON_VERSION" ]; then echo "Python 3.9 not available"; exit 1; fi | |
| pyenv shell "$PYTHON_VERSION" | |
| make wheel | |
| - name: Show files | |
| run: | | |
| ls -lh dist | |
| shell: bash | |
| - name: Test DataStore on all Python versions with pandas 2.x and 3.x | |
| run: | | |
| export PATH="$HOME/.pyenv/bin:$PATH" | |
| eval "$(pyenv init -)" | |
| plain_pyenv_version() { | |
| local pattern="${1//./\\.}" | |
| pyenv versions --bare 2>/dev/null | grep -E "^${pattern}\.[0-9]+$" | tail -1 | |
| } | |
| for version in 3.9 3.10 3.11 3.12 3.13 3.14; do | |
| PYTHON_VERSION="$(plain_pyenv_version "$version")" | |
| if [ -z "$PYTHON_VERSION" ]; then | |
| echo "Python $version not available, skipping" | |
| continue | |
| fi | |
| # pandas 3.x requires Python >= 3.11 | |
| if [[ "$version" == "3.9" || "$version" == "3.10" ]]; then | |
| PANDAS_CONSTRAINTS=("pandas<3.0") | |
| else | |
| PANDAS_CONSTRAINTS=("pandas<3.0" "pandas>=3.0") | |
| fi | |
| for PANDAS_CONSTRAINT in "${PANDAS_CONSTRAINTS[@]}"; do | |
| echo "==============================================" | |
| echo "Testing DataStore on Python $PYTHON_VERSION with $PANDAS_CONSTRAINT" | |
| echo "==============================================" | |
| pyenv shell "$PYTHON_VERSION" | |
| python -m pip install dist/*.whl --force-reinstall | |
| # pyarrow 25.0.0 corrupts parquet reads on linux-aarch64; remove this pin once a fixed pyarrow release is out | |
| python -m pip install pytest pytest-cov hypothesis ray "$PANDAS_CONSTRAINT" "pyarrow<25" | |
| echo "Installed pandas version:" | |
| python -c "import pandas; print(pandas.__version__)" | |
| echo "Running DataStore tests on Python $PYTHON_VERSION with $PANDAS_CONSTRAINT ..." | |
| cd datastore | |
| python -m pytest tests/ -v --tb=short -x | |
| cd .. | |
| echo "==============================================" | |
| echo "DataStore tests PASSED on Python $PYTHON_VERSION with $PANDAS_CONSTRAINT" | |
| echo "==============================================" | |
| pyenv shell --unset | |
| done | |
| done | |
| continue-on-error: false |