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
75 changes: 64 additions & 11 deletions .github/workflows/Java.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: Java JDBC
on:
push:
branches-ignore:
- 'vendoring-*'
pull_request:
workflow_dispatch:
inputs:
Expand All @@ -9,6 +11,21 @@ on:
required: false
default: 'false'
type: 'string'
duckdb_sha:
description: 'DuckDB SHA for release event tracking'
required: false
default: ''
type: 'string'
duckdb_version:
description: 'DuckDB version for release event tracking'
required: false
default: ''
type: 'string'
pr_number:
description: 'Vendoring PR number to merge after successful CI'
required: false
default: ''
type: 'string'
env:
AWS_ENDPOINT_URL: ${{ secrets.S3_DUCKDB_STAGING_ENDPOINT }}
AWS_ACCESS_KEY_ID: ${{ secrets.S3_DUCKDB_STAGING_ID }}
Expand All @@ -18,6 +35,7 @@ jobs:

format-check:
name: Format Check
if: ${{ github.event_name != 'pull_request' || !startsWith(github.head_ref, 'vendoring-') }}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: we're filtering on the head_ref (= vendoring-*) instead of the base_ref (= main), so pull_request.branch-ignores does not work, unfortunately.

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
Expand All @@ -29,6 +47,7 @@ jobs:

java-linux-amd64:
name: Linux (amd64)
if: ${{ github.event_name != 'pull_request' || !startsWith(github.head_ref, 'vendoring-') }}
runs-on: ubuntu-latest
needs: format-check
env:
Expand Down Expand Up @@ -96,6 +115,7 @@ jobs:

java-linux-amd64-tck:
name: Linux TCK (amd64)
if: ${{ github.event_name != 'pull_request' || !startsWith(github.head_ref, 'vendoring-') }}
runs-on: ubuntu-latest
needs: java-linux-amd64
env:
Expand Down Expand Up @@ -158,6 +178,7 @@ jobs:

java-linux-amd64-spark:
name: Linux Spark (amd64)
if: ${{ github.event_name != 'pull_request' || !startsWith(github.head_ref, 'vendoring-') }}
runs-on: ubuntu-latest
needs: java-linux-amd64
env:
Expand Down Expand Up @@ -255,6 +276,7 @@ jobs:

java-linux-amd64-asan:
name: Linux ASan (amd64)
if: ${{ github.event_name != 'pull_request' || !startsWith(github.head_ref, 'vendoring-') }}
runs-on: ubuntu-latest
needs: java-linux-amd64
env:
Expand Down Expand Up @@ -352,6 +374,7 @@ jobs:

java-linux-amd64-jepsen:
name: Linux Jepsen (amd64)
if: ${{ github.event_name != 'pull_request' || !startsWith(github.head_ref, 'vendoring-') }}
runs-on: ubuntu-latest
needs: java-linux-amd64
env:
Expand Down Expand Up @@ -447,6 +470,7 @@ jobs:

java-linux-aarch64:
name: Linux (aarch64)
if: ${{ github.event_name != 'pull_request' || !startsWith(github.head_ref, 'vendoring-') }}
runs-on: ubuntu-24.04-arm
needs: java-linux-amd64
env:
Expand Down Expand Up @@ -508,6 +532,7 @@ jobs:

java-linux-amd64-musl:
name: Linux (amd64-musl)
if: ${{ github.event_name != 'pull_request' || !startsWith(github.head_ref, 'vendoring-') }}
runs-on: ubuntu-latest
needs: java-linux-amd64
env:
Expand Down Expand Up @@ -565,6 +590,7 @@ jobs:

java-linux-aarch64-musl:
name: Linux (aarch64-musl)
if: ${{ github.event_name != 'pull_request' || !startsWith(github.head_ref, 'vendoring-') }}
runs-on: ubuntu-24.04-arm
needs: java-linux-amd64
env:
Expand Down Expand Up @@ -622,6 +648,7 @@ jobs:

java-windows-amd64:
name: Windows (amd64)
if: ${{ github.event_name != 'pull_request' || !startsWith(github.head_ref, 'vendoring-') }}
runs-on: windows-latest
needs: java-linux-amd64
env:
Expand Down Expand Up @@ -700,6 +727,7 @@ jobs:

java-windows-aarch64:
name: Windows (aarch64)
if: ${{ github.event_name != 'pull_request' || !startsWith(github.head_ref, 'vendoring-') }}
runs-on: windows-11-arm
needs: java-linux-amd64
env:
Expand Down Expand Up @@ -782,6 +810,7 @@ jobs:

java-osx-universal:
name: macOS (Universal)
if: ${{ github.event_name != 'pull_request' || !startsWith(github.head_ref, 'vendoring-') }}
runs-on: macos-latest
needs: java-linux-amd64
env:
Expand Down Expand Up @@ -1010,10 +1039,11 @@ jobs:
run: |
python ./scripts/jdbc_maven_deploy_snapshot.py jdbc-artifacts .

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) }}
java-finalize-vendoring:
name: Finalize vendoring
if: ${{ always() && github.repository == 'duckdb/duckdb-java' && github.event_name == 'workflow_dispatch' && startsWith(github.ref, 'refs/heads/vendoring-') && inputs.pr_number != '' && inputs.duckdb_sha != '' }}
needs:
- format-check
- java-linux-amd64
- java-linux-amd64-tck
- java-linux-amd64-spark
Expand All @@ -1033,22 +1063,45 @@ jobs:

- name: Merge vendoring PR
id: merge_vendoring_pr
if: ${{ !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled') && !contains(needs.*.result, 'skipped') }}
continue-on-error: true
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 }} \
BASE_BRANCH=$(gh pr view ${{ inputs.pr_number }} --json baseRefName --jq '.baseRefName')
PR_TITLE=$(gh pr view ${{ inputs.pr_number }} --json title --jq '.title')
echo "Merging PR number: ${{ inputs.pr_number }} with message: ${PR_TITLE}"
gh pr merge ${{ inputs.pr_number }} \
--rebase \
--subject "${{ github.event.pull_request.title }}" \
--subject "${PR_TITLE}" \
--body ""
echo "base_branch=${BASE_BRANCH}" >> "${GITHUB_OUTPUT}"

- name: Record client status
if: always()
uses: duckdb/duckdb-workflow-trigger/dispatch@main
with:
github_token: ${{ secrets.PAT_TOKEN }}
event: client_ready
client: java
duckdb_version: ${{ inputs.duckdb_version }}
duckdb_commit: ${{ inputs.duckdb_sha }}
status: ${{ (contains(needs.*.result, 'failure') || steps.merge_vendoring_pr.outcome == 'failure') && 'failure' || contains(needs.*.result, 'cancelled') && 'cancelled' || contains(needs.*.result, 'skipped') && 'skipped' || 'success' }}
message: DuckDB Java client ready

- name: Update vendoring branch
id: update_vendoring_branch
if: ${{ steps.merge_vendoring_pr.outcome == 'success' }}
continue-on-error: true
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/${{ github.base_ref }}
BASE_BRANCH="${{ steps.merge_vendoring_pr.outputs.base_branch }}"
# Delete vendoring-${BASE_BRANCH} branch and re-create it for future PRs
git push --delete origin vendoring-${BASE_BRANCH}
git checkout --track origin/${BASE_BRANCH}
git pull --ff-only
git branch vendoring-${{ github.base_ref }}
git push origin vendoring-${{ github.base_ref }}
git branch vendoring-${BASE_BRANCH}
git push origin vendoring-${BASE_BRANCH}

- name: Fail on unsuccessful final status
if: ${{ always() && (contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') || contains(needs.*.result, 'skipped') || steps.merge_vendoring_pr.outcome == 'failure' || steps.update_vendoring_branch.outcome == 'failure') }}
run: exit 1
28 changes: 25 additions & 3 deletions .github/workflows/Vendor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,23 @@ on:
required: false
default: ''
type: 'string'
duckdb-version:
description: 'Vendor Specific DuckDB Version'
required: false
default: ''
type: 'string'
workflow_dispatch:
inputs:
duckdb-sha:
description: 'Vendor Specific DuckDB SHA'
required: false
default: ''
type: 'string'
duckdb-version:
description: 'Vendor Specific DuckDB Version'
required: false
default: ''
type: 'string'

jobs:
vendor:
Expand Down Expand Up @@ -137,6 +147,8 @@ jobs:
--base "${{ github.ref_name }}" \
--title "${{ steps.commit_and_push.outputs.commit_msg }}" \
--body-file body.txt
PR_NUM=$(gh pr list --head vendoring-${{ github.ref_name }} --json number --jq '.[].number')
echo "pr_num=${PR_NUM}" >> "${GITHUB_OUTPUT}"

- name: Update PR
id: update_pr
Expand All @@ -156,6 +168,16 @@ jobs:
gh pr edit ${{ steps.check_pr_exists.outputs.pr_num }} \
--title "${{ steps.commit_and_push.outputs.commit_msg }}" \
--body-file body.txt
# Close and re-open the PR to trigger the tests
gh pr close ${{ steps.check_pr_exists.outputs.pr_num }}
gh pr reopen ${{ steps.check_pr_exists.outputs.pr_num }}

- name: Dispatch Java CI
id: dispatch_java_ci
if: ${{ steps.create_pr.outcome == 'success' || steps.update_pr.outcome == 'success' }}
env:
GH_TOKEN: ${{ secrets.PAT_TOKEN }}
PR_NUM: ${{ steps.create_pr.outputs.pr_num || steps.check_pr_exists.outputs.pr_num }}
run: |
gh workflow run Java.yml \
--ref vendoring-${{ github.ref_name }} \
-f duckdb_sha="${{ inputs.duckdb-sha }}" \
-f duckdb_version="${{ inputs.duckdb-version }}" \
-f pr_number="${PR_NUM}"
Loading