Add support for query timeouts #462
Workflow file for this run
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: Java JDBC | |
on: | |
push: | |
pull_request: | |
workflow_dispatch: | |
inputs: | |
skip_tests: | |
description: 'Skip test runs' | |
required: false | |
default: 'false' | |
type: 'string' | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.S3_DUCKDB_STAGING_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_DUCKDB_STAGING_KEY }} | |
jobs: | |
format-check: | |
name: Format Check | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- run: | | |
python3 -m pip install --user clang_format==11.0.1 | |
make format-check | |
java-linux-amd64: | |
name: Java Linux (amd64) | |
runs-on: ubuntu-latest | |
needs: format-check | |
env: | |
MANYLINUX_IMAGE: quay.io/pypa/manylinux_2_28_x86_64 | |
MANYLINUX_PACKAGES: java-1.8.0-openjdk-devel ninja-build | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Build | |
shell: bash | |
run: | | |
docker run \ | |
-v.:/duckdb \ | |
-e GEN=ninja \ | |
-e JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk \ | |
${{ env.MANYLINUX_IMAGE }} \ | |
bash -c 'dnf install ${{ env.MANYLINUX_PACKAGES }} -y && make -C /duckdb release' | |
- name: JDBC Tests | |
shell: bash | |
if: ${{ inputs.skip_tests != 'true' }} | |
run: | | |
docker run \ | |
-v.:/duckdb \ | |
-e GEN=ninja \ | |
-e JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk \ | |
${{ env.MANYLINUX_IMAGE }} \ | |
bash -c 'dnf install ${{ env.MANYLINUX_PACKAGES }} -y && make -C /duckdb test' | |
- name: Deploy | |
shell: bash | |
run: | | |
cp build/release/duckdb_jdbc.jar duckdb_jdbc-linux-amd64.jar | |
./scripts/upload-assets-to-staging.sh github_release duckdb_jdbc-linux-amd64.jar | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: java-linux-amd64 | |
path: | | |
build/release/duckdb_jdbc.jar | |
java-linux-aarch64: | |
name: Java Linux (aarch64) | |
runs-on: ubuntu-24.04-arm | |
needs: java-linux-amd64 | |
env: | |
MANYLINUX_IMAGE: quay.io/pypa/manylinux_2_28_aarch64 | |
MANYLINUX_PACKAGES: java-1.8.0-openjdk-devel ninja-build | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Build | |
shell: bash | |
run: | | |
docker run \ | |
-v.:/duckdb \ | |
-e GEN=ninja \ | |
-e JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk \ | |
${{ env.MANYLINUX_IMAGE }} \ | |
bash -c 'dnf install ${{ env.MANYLINUX_PACKAGES }} -y && make -C /duckdb release' | |
- name: JDBC Tests | |
shell: bash | |
if: ${{ inputs.skip_tests != 'true' }} | |
run: | | |
docker run \ | |
-v.:/duckdb \ | |
-e GEN=ninja \ | |
-e JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk \ | |
${{ env.MANYLINUX_IMAGE }} \ | |
bash -c 'dnf install ${{ env.MANYLINUX_PACKAGES }} -y && make -C /duckdb test' | |
- name: Deploy | |
shell: bash | |
run: | | |
cp build/release/duckdb_jdbc.jar duckdb_jdbc-linux-aarch64.jar | |
./scripts/upload-assets-to-staging.sh github_release duckdb_jdbc-linux-aarch64.jar | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: java-linux-aarch64 | |
path: | | |
build/release/duckdb_jdbc.jar | |
java-linux-amd64-musl: | |
name: Java Linux (amd64-musl) | |
runs-on: ubuntu-latest | |
needs: java-linux-amd64 | |
env: | |
ALPINE_IMAGE: alpine:3.21 | |
ALPINE_PACKAGES: cmake g++ make openjdk8-jdk samurai | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Build | |
shell: bash | |
run: | | |
docker run \ | |
-v.:/duckdb \ | |
-e GEN=ninja \ | |
-e JAVA_HOME=/usr/lib/jvm/java-8-openjdk \ | |
${{ env.ALPINE_IMAGE }} \ | |
sh -c 'apk add ${{ env.ALPINE_PACKAGES }} && make -C /duckdb release' | |
- name: JDBC Tests | |
shell: bash | |
if: ${{ inputs.skip_tests != 'true' }} | |
run: | | |
docker run \ | |
-v.:/duckdb \ | |
-e GEN=ninja \ | |
-e JAVA_HOME=/usr/lib/jvm/java-8-openjdk \ | |
${{ env.ALPINE_IMAGE }} \ | |
sh -c 'apk add ${{ env.ALPINE_PACKAGES }} && make -C /duckdb test' | |
- name: Deploy | |
shell: bash | |
run: | | |
cp build/release/duckdb_jdbc.jar duckdb_jdbc-linux-amd64-musl.jar | |
./scripts/upload-assets-to-staging.sh github_release duckdb_jdbc-linux-amd64-musl.jar | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: java-linux-amd64-musl | |
path: | | |
build/release/duckdb_jdbc.jar | |
java-linux-aarch64-musl: | |
name: Java Linux (aarch64-musl) | |
runs-on: ubuntu-24.04-arm | |
needs: java-linux-amd64 | |
env: | |
ALPINE_IMAGE: alpine:3.21 | |
ALPINE_PACKAGES: cmake g++ make openjdk8-jdk samurai | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Build | |
shell: bash | |
run: | | |
docker run \ | |
-v.:/duckdb \ | |
-e GEN=ninja \ | |
-e JAVA_HOME=/usr/lib/jvm/java-8-openjdk \ | |
${{ env.ALPINE_IMAGE }} \ | |
sh -c 'apk add ${{ env.ALPINE_PACKAGES }} && make -C /duckdb release' | |
# Test runs are failing because of linux_arm64_musl extensions missing | |
- name: JDBC Tests | |
shell: bash | |
if: ${{ inputs.skip_tests != 'true' }} | |
run: | | |
docker run \ | |
-v.:/duckdb \ | |
-e GEN=ninja \ | |
-e JAVA_HOME=/usr/lib/jvm/java-8-openjdk \ | |
${{ env.ALPINE_IMAGE }} \ | |
sh -c 'apk add ${{ env.ALPINE_PACKAGES }} && (make -C /duckdb test || true)' | |
- name: Deploy | |
shell: bash | |
run: | | |
cp build/release/duckdb_jdbc.jar duckdb_jdbc-linux-aarch64-musl.jar | |
./scripts/upload-assets-to-staging.sh github_release duckdb_jdbc-linux-aarch64-musl.jar | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: java-linux-aarch64-musl | |
path: | | |
build/release/duckdb_jdbc.jar | |
java-windows-amd64: | |
name: Java Windows (amd64) | |
runs-on: windows-latest | |
needs: java-linux-amd64 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
ref: ${{ inputs.git_ref }} | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
- name: Build | |
shell: bash | |
run: make release | |
- name: Java Tests | |
if: ${{ inputs.skip_tests != 'true' }} | |
shell: bash | |
run: | | |
ls -R . | |
make test | |
- name: Deploy | |
shell: bash | |
run: | | |
cp build/release/duckdb_jdbc.jar duckdb_jdbc-windows-amd64.jar | |
./scripts/upload-assets-to-staging.sh github_release duckdb_jdbc-windows-amd64.jar | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: java-windows-amd64 | |
path: | | |
build/release/duckdb_jdbc.jar | |
java-osx-universal: | |
name: Java OSX (Universal) | |
runs-on: macos-14 | |
needs: java-linux-amd64 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
- name: Build | |
shell: bash | |
run: make release | |
- name: Java Tests | |
if: ${{ inputs.skip_tests != 'true' }} | |
shell: bash | |
run: make test | |
- name: See if this actually universal | |
shell: bash | |
run: lipo -archs build/release/libduckdb_java.so_osx_universal | grep "x86_64 arm64" | |
- name: Deploy | |
shell: bash | |
run: | | |
cp build/release/duckdb_jdbc.jar duckdb_jdbc-osx-universal.jar | |
./scripts/upload-assets-to-staging.sh github_release duckdb_jdbc-osx-universal.jar | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: java-osx-universal | |
path: | | |
build/release/duckdb_jdbc.jar | |
java-combine: | |
if: ${{ inputs.override_git_describe == '' }} | |
name: Java Combine | |
runs-on: ubuntu-latest | |
needs: | |
- java-linux-amd64 | |
- java-linux-aarch64 | |
- java-linux-amd64-musl | |
- java-linux-aarch64-musl | |
- java-windows-amd64 | |
- java-osx-universal | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- shell: bash | |
run: mkdir jdbc-artifacts | |
- uses: actions/download-artifact@v4 | |
with: | |
name: java-linux-amd64 | |
path: jdbc-artifacts/java-linux-amd64 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: java-linux-aarch64 | |
path: jdbc-artifacts/java-linux-aarch64 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: java-linux-amd64-musl | |
path: jdbc-artifacts/java-linux-amd64-musl | |
- uses: actions/download-artifact@v4 | |
with: | |
name: java-linux-aarch64-musl | |
path: jdbc-artifacts/java-linux-aarch64-musl | |
- uses: actions/download-artifact@v4 | |
with: | |
name: java-windows-amd64 | |
path: jdbc-artifacts/java-windows-amd64 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: java-osx-universal | |
path: jdbc-artifacts/java-osx-universal | |
- name: Combine JARs | |
shell: bash | |
run: | | |
mkdir -m 700 -p ~/.gnupg | |
echo -e "passphrase asdf\npinentry-mode loopback\nno-tty\nbatch\n" > ~/.gnupg/gpg.conf | |
if [[ "$GITHUB_REF" =~ ^(refs/heads/main|refs/tags/v.+)$ && "$GITHUB_REPOSITORY" = "duckdb/duckdb-java" ]] ; then | |
export XML=' | |
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 | |
https://maven.apache.org/xsd/settings-1.0.0.xsd"> | |
<servers> | |
<server> | |
<id>ossrh</id> | |
<username>hfmuehleisen</username> <!-- Sonatype OSSRH JIRA user/pw --> | |
<password>PASSWORD</password> | |
</server> | |
</servers> | |
</settings> ' | |
mkdir ~/.m2 | |
echo $XML | sed "s|PASSWORD|${{ secrets.MAVEN_PASSWORD }}|" > ~/.m2/settings.xml | |
echo "${{ secrets.MAVEN_PGP_PK }}" | base64 -d > maven_pgp_key | |
gpg --batch --import maven_pgp_key | |
python scripts/jdbc_maven_deploy.py ${{ github.ref_name }} jdbc-artifacts . | |
fi | |
ls -lahR jdbc-artifacts | |
- name: Upload artifacts | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: java-jars | |
path: | | |
jdbc-artifacts | |
jdbc-compliance: | |
name: JDBC Compliance | |
runs-on: ubuntu-latest | |
if: ${{ inputs.skip_tests != 'true' }} | |
needs: java-linux-amd64 | |
container: quay.io/pypa/manylinux_2_28_x86_64 | |
env: | |
GEN: ninja | |
JAVA_HOME: /usr/lib/jvm/java-1.8.0-openjdk | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
ref: ${{ inputs.git_ref }} | |
- name: Install packages | |
shell: bash | |
run: | | |
dnf install java-1.8.0-openjdk-devel ninja-build -y | |
- name: Install CTS | |
shell: bash | |
run: | | |
git clone https://github.com/cwida/jdbccts.git | |
- name: Build | |
shell: bash | |
run: make release | |
- name: Test | |
shell: bash | |
run: (cd jdbccts && make DUCKDB_JAR=../build/release/duckdb_jdbc.jar test) | |
java-merge-vendoring-pr: | |
name: Merge vendoring PR | |
if: ${{ github.repository == 'duckdb/duckdb-java' && github.event_name == 'pull_request' && github.head_ref == format('vendoring-{0}', github.base_ref) }} | |
needs: | |
- java-linux-amd64 | |
- java-linux-aarch64 | |
- java-linux-amd64-musl | |
- java-linux-aarch64-musl | |
- java-windows-amd64 | |
- java-osx-universal | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Merge vendoring PR | |
id: merge_vendoring_pr | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
echo "Merging PR number: ${{ github.event.pull_request.number }} with message: ${{ github.event.pull_request.title }}" | |
gh pr merge vendoring-${{ github.base_ref }} \ | |
--rebase \ | |
--subject "${{ github.event.pull_request.title }}" \ | |
--body "" | |
- name: Update vendoring branch | |
id: update_vendoring_branch | |
if: ${{ steps.merge_vendoring_pr.outcome == 'success' }} | |
run: | | |
# Delete vendoring-${{ github.base_ref }} branch and re-create it for future PRs | |
git push --delete origin vendoring-${{ github.base_ref }} | |
git checkout --track origin/main | |
git pull --ff-only | |
git branch vendoring-${{ github.base_ref }} | |
git push origin vendoring-${{ github.base_ref }} |