| # Shared client CI: run only affected language jobs via changed path detection. | |
| name: Multi-Language Client | |
| on: | |
| push: | |
| branches: | |
| - master | |
| - "rc/*" | |
| paths: | |
| - 'pom.xml' | |
| - 'iotdb-client/pom.xml' | |
| - 'iotdb-client/client-py/**' | |
| - 'iotdb-client/client-cpp/**' | |
| - 'iotdb-protocol/thrift-datanode/src/main/thrift/client.thrift' | |
| - 'iotdb-protocol/thrift-commons/src/main/thrift/common.thrift' | |
| - '.github/workflows/multi-language-client.yml' | |
| - '.github/workflows/client-cpp-package.yml' | |
| - '.github/scripts/package-client-cpp-*.sh' | |
| pull_request: | |
| branches: | |
| - master | |
| - "rc/*" | |
| - 'force_ci/**' | |
| paths: | |
| - 'pom.xml' | |
| - 'iotdb-client/pom.xml' | |
| - 'iotdb-client/client-py/**' | |
| - 'iotdb-client/client-cpp/**' | |
| - 'iotdb-protocol/thrift-datanode/src/main/thrift/client.thrift' | |
| - 'iotdb-protocol/thrift-commons/src/main/thrift/common.thrift' | |
| - '.github/workflows/multi-language-client.yml' | |
| - '.github/workflows/client-cpp-package.yml' | |
| - '.github/scripts/package-client-cpp-*.sh' | |
| # allow manually run the action: | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryHandler.class=standard -Dmaven.wagon.http.retryHandler.count=3 | |
| MAVEN_ARGS: --batch-mode --no-transfer-progress | |
| jobs: | |
| # Per-language path filters: a client-cpp-only PR runs cpp, not go/python. | |
| changes: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| cpp: ${{ steps.filter.outputs.cpp }} | |
| python: ${{ steps.filter.outputs.python }} | |
| go: ${{ steps.filter.outputs.go }} | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| - name: Detect changed client paths | |
| id: filter | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| if [[ "${{ github.event_name }}" == "pull_request" ]]; then | |
| BASE="${{ github.event.pull_request.base.sha }}" | |
| HEAD="${{ github.sha }}" | |
| elif [[ "${{ github.event_name }}" == "push" ]]; then | |
| BASE="${{ github.event.before }}" | |
| HEAD="${{ github.sha }}" | |
| else | |
| echo "cpp=true" >> "$GITHUB_OUTPUT" | |
| echo "python=true" >> "$GITHUB_OUTPUT" | |
| echo "go=true" >> "$GITHUB_OUTPUT" | |
| exit 0 | |
| fi | |
| if [[ "$BASE" =~ ^0+$ ]]; then | |
| BASE="$(git hash-object -t tree /dev/null)" | |
| fi | |
| cpp=false | |
| python=false | |
| go=false | |
| while IFS= read -r file; do | |
| case "$file" in | |
| pom.xml|iotdb-client/pom.xml|iotdb-client/client-cpp/*|iotdb-protocol/thrift-datanode/src/main/thrift/client.thrift|iotdb-protocol/thrift-commons/src/main/thrift/common.thrift|.github/workflows/multi-language-client.yml|.github/workflows/client-cpp-package.yml|.github/scripts/package-client-cpp-*.sh) | |
| cpp=true | |
| ;; | |
| esac | |
| case "$file" in | |
| pom.xml|iotdb-client/pom.xml|iotdb-client/client-py/*|docker/src/main/Dockerfile-1c1d|.github/workflows/multi-language-client.yml) | |
| python=true | |
| ;; | |
| esac | |
| case "$file" in | |
| pom.xml|iotdb-core/*|iotdb-api/*|iotdb-protocol/*|distribution/*|integration-test/*|iotdb-client/session/*|iotdb-client/jdbc/*|iotdb-client/cli/*|iotdb-client/service-rpc/*|.github/workflows/multi-language-client.yml) | |
| go=true | |
| ;; | |
| esac | |
| done < <(git diff --name-only "$BASE" "$HEAD") | |
| echo "cpp=${cpp}" >> "$GITHUB_OUTPUT" | |
| echo "python=${python}" >> "$GITHUB_OUTPUT" | |
| echo "go=${go}" >> "$GITHUB_OUTPUT" | |
| cpp: | |
| needs: changes | |
| # Full client validation (format + server build + verify) for C++ examples and SDK. | |
| if: github.event_name == 'workflow_dispatch' || needs.changes.outputs.cpp == 'true' | |
| strategy: | |
| fail-fast: false | |
| max-parallel: 15 | |
| matrix: | |
| os: [ubuntu-22.04, ubuntu-24.04, ubuntu-22.04-arm, windows-2022, windows-2025-vs2026, macos-latest] | |
| runs-on: ${{ matrix.os}} | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: corretto | |
| java-version: 17 | |
| - name: Install CPP Dependencies (Ubuntu) | |
| if: runner.os == 'Linux' | |
| shell: bash | |
| run: | | |
| set -euxo pipefail | |
| sudo apt-get update | |
| sudo apt-get install -y libboost-all-dev openssl libssl-dev wget | |
| # jammy (22.04): no clang-format-17 in default repos — use apt.llvm.org (same LLVM 17 as noble/choco/brew) | |
| . /etc/os-release | |
| if [[ "${VERSION_CODENAME}" == "jammy" ]]; then | |
| wget -qO /tmp/llvm.sh https://apt.llvm.org/llvm.sh | |
| chmod +x /tmp/llvm.sh | |
| sudo DEBIAN_FRONTEND=noninteractive /tmp/llvm.sh 17 | |
| # llvm.sh installs clang-17/lldb/lld/clangd but not the clang-format-17 package | |
| sudo apt-get install -y clang-format-17 | |
| else | |
| sudo apt-get install -y clang-format-17 | |
| fi | |
| sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-17 100 | |
| sudo update-alternatives --set clang-format /usr/bin/clang-format-17 | |
| clang-format --version | |
| - name: Install CPP Dependencies (Mac) | |
| # remove some xcode to release disk space | |
| if: runner.os == 'macOS' | |
| shell: bash | |
| run: | | |
| # Pin openssl@3 (Apache-2.0); the default formula will move to OpenSSL 4.0. | |
| brew install boost openssl@3 llvm@17 bison | |
| ln -sf "$(brew --prefix llvm@17)/bin/clang-format" "$(brew --prefix)/bin/clang-format" | |
| echo "$(brew --prefix bison)/bin" >> "$GITHUB_PATH" | |
| echo "$(brew --prefix llvm@17)/bin" >> "$GITHUB_PATH" | |
| # Homebrew OpenSSL is keg-only, so point find_package(OpenSSL) at it. | |
| echo "OPENSSL_ROOT_DIR=$(brew --prefix openssl@3)" >> "$GITHUB_ENV" | |
| clang-format --version | |
| bison --version | |
| sudo rm -rf /Applications/Xcode_14.3.1.app | |
| sudo rm -rf /Applications/Xcode_15.0.1.app | |
| sudo rm -rf /Applications/Xcode_15.1.app | |
| sudo rm -rf /Applications/Xcode_15.2.app | |
| sudo rm -rf /Applications/Xcode_15.3.app | |
| - name: Install CPP Dependencies (Windows) | |
| if: runner.os == 'Windows' | |
| run: | | |
| choco install winflexbison3 -y | |
| choco install boost-msvc-14.3 -y | |
| $boost_path = (Get-ChildItem -Path 'C:\local\' -Filter 'boost_*').FullName | |
| echo $boost_path >> $env:GITHUB_PATH | |
| # Pinned OpenSSL 3.x (Apache-2.0): 'choco install openssl' now installs | |
| # OpenSSL 4.0, which removed the legacy TLS-method APIs Thrift uses. | |
| $sslZip = "$env:RUNNER_TEMP\openssl-3.5.3.zip" | |
| $sslDir = "$env:RUNNER_TEMP\openssl-3" | |
| curl.exe -L --fail --retry 3 -o $sslZip 'https://download.firedaemon.com/FireDaemon-OpenSSL/openssl-3.5.3.zip' | |
| Expand-Archive -Path $sslZip -DestinationPath $sslDir -Force | |
| $sslPath = (Get-ChildItem $sslDir -Recurse -Directory -Filter 'x64' | Select-Object -First 1).FullName | |
| if (-not $sslPath) { throw "OpenSSL x64 dir not found under $sslDir" } | |
| echo "$sslPath\bin" >> $env:GITHUB_PATH | |
| echo "OPENSSL_ROOT_DIR=$sslPath" >> $env:GITHUB_ENV | |
| choco install llvm --version=17.0.6 --force -y | |
| clang-format --version | |
| - name: Cache Maven packages | |
| uses: actions/cache@v5 | |
| with: | |
| path: ~/.m2 | |
| key: ${{ runner.os }}-${{ runner.arch }}-m2-${{ hashFiles('**/pom.xml') }} | |
| restore-keys: ${{ runner.os }}-${{ runner.arch }}-m2- | |
| - name: Check C++ format (Spotless) | |
| shell: bash | |
| run: | | |
| ./mvnw -P with-cpp -pl iotdb-client/client-cpp spotless:check | |
| - name: Build IoTDB server | |
| shell: bash | |
| run: ./mvnw clean install -pl distribution -am -DskipTests | |
| - name: Test with Maven | |
| shell: bash | |
| # Explicitly using mvnw here as the build requires maven 3.9 and the default installation is older | |
| # Explicitly using "install" instead of package in order to be sure we're using libs built on this machine | |
| # (was causing problems on windows, but could cause problem on linux, when updating the thrift module) | |
| run: | | |
| if [[ "${{ matrix.os }}" == "windows-2025-vs2026" ]]; then | |
| ./mvnw clean verify -P with-cpp -pl iotdb-client/client-cpp -am -Diotdb.openssl.from.source=OFF -Dcmake.generator="Visual Studio 18 2026" | |
| elif [[ "${{ runner.os }}" == "macOS" ]]; then | |
| # Exercise the default source build, including bundled dylib relocation, on pull requests. | |
| ./mvnw clean verify -P with-cpp -pl iotdb-client/client-cpp -am | |
| else | |
| ./mvnw clean verify -P with-cpp -pl iotdb-client/client-cpp -am -Diotdb.openssl.from.source=OFF | |
| fi | |
| - name: Upload Artifact | |
| if: failure() | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: cpp-IT-${{ matrix.os }} | |
| path: distribution/target/apache-iotdb-*-all-bin/apache-iotdb-*-all-bin/logs | |
| retention-days: 1 | |
| go: | |
| needs: changes | |
| if: github.event_name == 'workflow_dispatch' || needs.changes.outputs.go == 'true' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| token: ${{secrets.GITHUB_TOKEN}} | |
| submodules: recursive | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: corretto | |
| java-version: 17 | |
| - name: Cache Maven packages | |
| uses: actions/cache@v5 | |
| with: | |
| path: ~/.m2 | |
| key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} | |
| restore-keys: ${{ runner.os }}-m2- | |
| - name: Compile IoTDB Server | |
| run: mvn clean package -pl distribution -am -DskipTests | |
| - name: Integration test | |
| shell: bash | |
| run: | | |
| cd iotdb-client | |
| git clone https://github.com/apache/iotdb-client-go.git | |
| cd iotdb-client-go | |
| make e2e_test_for_parent_git_repo e2e_test_clean_for_parent_git_repo | |
| python: | |
| needs: changes | |
| if: github.event_name == 'workflow_dispatch' || needs.changes.outputs.python == 'true' | |
| strategy: | |
| fail-fast: false | |
| max-parallel: 15 | |
| matrix: | |
| python: ['3.x'] | |
| runs-on: ${{ 'ubuntu-latest' }} | |
| steps: | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python }} | |
| - uses: actions/checkout@v5 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: corretto | |
| java-version: 17 | |
| - name: Cache Maven packages | |
| uses: actions/cache@v5 | |
| with: | |
| path: ~/.m2 | |
| key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} | |
| restore-keys: ${{ runner.os }}-m2- | |
| - name: Cache pip packages | |
| uses: actions/cache@v5 | |
| with: | |
| path: ~/.cache/pip | |
| key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | |
| restore-keys: ${{ runner.os }}-pip- | |
| - name: Build IoTDB server distribution zip and python client | |
| run: mvn -B clean install -pl distribution,iotdb-client/client-py -am -DskipTests | |
| - name: Build IoTDB server docker image | |
| run: | | |
| docker build . -f docker/src/main/Dockerfile-1c1d -t "iotdb:dev" | |
| docker images | |
| - name: Install IoTDB python client requirements | |
| run: pip3 install -r iotdb-client/client-py/requirements_dev.txt | |
| - name: Check code style | |
| if: ${{ matrix.python == '3.x'}} | |
| shell: bash | |
| run: black iotdb-client/client-py/ --check --diff | |
| - name: Integration test and test make package | |
| shell: bash | |
| run: | | |
| cd iotdb-client/client-py/ && pytest . | |
| ./release.sh |