Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 30 additions & 44 deletions .github/workflows/Java.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,39 +2,40 @@ name: Java JDBC
on:
push:
pull_request:
workflow_call:
workflow_dispatch:
repository_dispatch:

inputs:
skip_tests:
description: 'Skip test runs'
required: false
default: 'false'
type: 'string'
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
OVERRIDE_GIT_DESCRIBE: ${{ inputs.override_git_describe }}
AWS_ACCESS_KEY_ID: ${{ secrets.S3_DUCKDB_STAGING_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_DUCKDB_STAGING_KEY }}

jobs:
format_check:
format-check:
name: Format Check
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ inputs.git_ref }}

- 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
ref: ${{ inputs.git_ref }}

- name: Build
shell: bash
Expand All @@ -59,12 +60,10 @@ jobs:

- name: Deploy
shell: bash
env:
AWS_ACCESS_KEY_ID: ${{ secrets.S3_DUCKDB_STAGING_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_DUCKDB_STAGING_KEY }}
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
Expand All @@ -82,7 +81,6 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ inputs.git_ref }}

- name: Build
shell: bash
Expand All @@ -107,12 +105,9 @@ jobs:

- name: Deploy
shell: bash
env:
AWS_ACCESS_KEY_ID: ${{ secrets.S3_DUCKDB_STAGING_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_DUCKDB_STAGING_KEY }}
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
./scripts/upload-assets-to-staging.sh github_release duckdb_jdbc-linux-aarch64.jar

- uses: actions/upload-artifact@v4
with:
Expand All @@ -130,39 +125,34 @@ jobs:
with:
fetch-depth: 0
ref: ${{ inputs.git_ref }}

- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Setup Ccache
uses: hendrikmuhs/ccache-action@main
with:
key: ${{ github.job }}
save: ${{ github.ref == 'refs/heads/main' || github.repository != 'duckdb/duckdb-java' }}

- 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
env:
AWS_ACCESS_KEY_ID: ${{ secrets.S3_DUCKDB_STAGING_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_DUCKDB_STAGING_KEY }}
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
Expand All @@ -171,33 +161,30 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ inputs.git_ref }}

- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Setup Ccache
uses: hendrikmuhs/ccache-action@main
with:
key: ${{ github.job }}
save: ${{ github.ref == 'refs/heads/main' }}

- 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
env:
AWS_ACCESS_KEY_ID: ${{ secrets.S3_DUCKDB_STAGING_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_DUCKDB_STAGING_KEY }}
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
Expand All @@ -219,7 +206,6 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ inputs.git_ref }}

- shell: bash
run: mkdir jdbc-artifacts
Expand Down Expand Up @@ -315,7 +301,7 @@ jobs:

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.ref_name) }}
if: ${{ github.repository == 'duckdb/duckdb-java' && github.event_name == 'pull_request' && github.head_ref == format('vendoring-{0}', github.base_ref) }}
needs:
- java-linux-aarch64
- java-linux-amd64
Expand All @@ -332,8 +318,8 @@ jobs:
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.ref_name }} \
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 ""
Expand All @@ -342,9 +328,9 @@ jobs:
id: update_vendoring_branch
if: ${{ steps.merge_vendoring_pr.outcome == 'success' }}
run: |
# Delete vendoring-${{ github.ref_name }} branch and re-create it for future PRs
git push --delete origin vendoring-${{ github.ref_name }}
# 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.ref_name }}
git push origin vendoring-${{ github.ref_name }}
git branch vendoring-${{ github.base_ref }}
git push origin vendoring-${{ github.base_ref }}
7 changes: 2 additions & 5 deletions .github/workflows/Vendor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ jobs:

- name: Commit and push the changes
id: commit_and_push
if: ${{ steps.vendor.outcome == 'success' }}
run: |
MSG="Update vendored DuckDB sources to ${{ steps.vendor.outputs.vendor_rev }}"
git commit -m "${MSG}"
Expand All @@ -89,7 +88,6 @@ jobs:

- name: Check PR exists
id: check_pr_exists
if: ${{ steps.commit_and_push.outcome == 'success' }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
Expand All @@ -105,7 +103,6 @@ jobs:

- name: Prepare PR message
id: prepare_pr_message
if: ${{ steps.check_pr_exists.outcome == 'success' }}
run: |
DATE="$(date +"%Y-%m-%d %H:%M:%S")"
CHANGE_LABEL="duckdb/duckdb#${{ steps.vendor.outputs.vendor_rev }}"
Expand All @@ -116,7 +113,7 @@ jobs:

- name: Create PR
id: create_pr
if: ${{ steps.prepare_pr_message.outcome == 'success' && steps.check_pr_exists.outputs.pr_exists == 'false' }}
if: ${{ steps.check_pr_exists.outputs.pr_exists == 'false' }}
env:
# We cannot use default workflow's GITHUB_TOKEN here, because
# it is restricted to not trigger 'pull_request' event that
Expand All @@ -136,7 +133,7 @@ jobs:

- name: Update PR
id: update_pr
if: ${{ steps.prepare_pr_message.outcome == 'success' && steps.check_pr_exists.outputs.pr_exists == 'true' }}
if: ${{ steps.check_pr_exists.outputs.pr_exists == 'true' }}
env:
# We cannot use default workflow's GITHUB_TOKEN here, because
# it is restricted to not trigger 'pull_request' event that
Expand Down