@@ -2,39 +2,40 @@ name: Java JDBC
22on :
33 push :
44 pull_request :
5- workflow_call :
65 workflow_dispatch :
7- repository_dispatch :
8-
6+ inputs :
7+ skip_tests :
8+ description : ' Skip test runs'
9+ required : false
10+ default : ' false'
11+ type : ' string'
912env :
10- GH_TOKEN : ${{ secrets.GH_TOKEN }}
11- OVERRIDE_GIT_DESCRIBE : ${{ inputs.override_git_describe }}
13+ AWS_ACCESS_KEY_ID : ${{ secrets.S3_DUCKDB_STAGING_ID }}
14+ AWS_SECRET_ACCESS_KEY : ${{ secrets.S3_DUCKDB_STAGING_KEY }}
1215
1316jobs :
14- format_check :
17+ format-check :
18+ name : Format Check
1519 runs-on : ubuntu-latest
16-
1720 steps :
1821 - uses : actions/checkout@v4
1922 with :
2023 fetch-depth : 0
21- ref : ${{ inputs.git_ref }}
22-
2324 - run : |
2425 python3 -m pip install --user clang_format==11.0.1
2526 make format-check
2627
2728 java-linux-amd64 :
2829 name : Java Linux (amd64)
2930 runs-on : ubuntu-latest
31+ needs : format-check
3032 env :
3133 MANYLINUX_IMAGE : quay.io/pypa/manylinux_2_28_x86_64
3234 MANYLINUX_PACKAGES : java-1.8.0-openjdk-devel ninja-build
3335 steps :
3436 - uses : actions/checkout@v4
3537 with :
3638 fetch-depth : 0
37- ref : ${{ inputs.git_ref }}
3839
3940 - name : Build
4041 shell : bash
@@ -59,12 +60,10 @@ jobs:
5960
6061 - name : Deploy
6162 shell : bash
62- env :
63- AWS_ACCESS_KEY_ID : ${{ secrets.S3_DUCKDB_STAGING_ID }}
64- AWS_SECRET_ACCESS_KEY : ${{ secrets.S3_DUCKDB_STAGING_KEY }}
6563 run : |
6664 cp build/release/duckdb_jdbc.jar duckdb_jdbc-linux-amd64.jar
6765 ./scripts/upload-assets-to-staging.sh github_release duckdb_jdbc-linux-amd64.jar
66+
6867 - uses : actions/upload-artifact@v4
6968 with :
7069 name : java-linux-amd64
8281 - uses : actions/checkout@v4
8382 with :
8483 fetch-depth : 0
85- ref : ${{ inputs.git_ref }}
8684
8785 - name : Build
8886 shell : bash
@@ -107,12 +105,9 @@ jobs:
107105
108106 - name : Deploy
109107 shell : bash
110- env :
111- AWS_ACCESS_KEY_ID : ${{ secrets.S3_DUCKDB_STAGING_ID }}
112- AWS_SECRET_ACCESS_KEY : ${{ secrets.S3_DUCKDB_STAGING_KEY }}
113108 run : |
114109 cp build/release/duckdb_jdbc.jar duckdb_jdbc-linux-aarch64.jar
115- # ./scripts/upload-assets-to-staging.sh github_release duckdb_jdbc-linux-aarch64.jar
110+ ./scripts/upload-assets-to-staging.sh github_release duckdb_jdbc-linux-aarch64.jar
116111
117112 - uses : actions/upload-artifact@v4
118113 with :
@@ -130,39 +125,34 @@ jobs:
130125 with :
131126 fetch-depth : 0
132127 ref : ${{ inputs.git_ref }}
128+
133129 - uses : actions/setup-python@v5
134130 with :
135131 python-version : " 3.12"
136- - name : Setup Ccache
137- uses : hendrikmuhs/ccache-action@main
138- with :
139- key : ${{ github.job }}
140- save : ${{ github.ref == 'refs/heads/main' || github.repository != 'duckdb/duckdb-java' }}
141132
142133 - name : Build
143134 shell : bash
144135 run : make release
136+
145137 - name : Java Tests
146138 if : ${{ inputs.skip_tests != 'true' }}
147139 shell : bash
148140 run : |
149141 ls -R .
150142 make test
143+
151144 - name : Deploy
152145 shell : bash
153- env :
154- AWS_ACCESS_KEY_ID : ${{ secrets.S3_DUCKDB_STAGING_ID }}
155- AWS_SECRET_ACCESS_KEY : ${{ secrets.S3_DUCKDB_STAGING_KEY }}
156146 run : |
157147 cp build/release/duckdb_jdbc.jar duckdb_jdbc-windows-amd64.jar
158148 ./scripts/upload-assets-to-staging.sh github_release duckdb_jdbc-windows-amd64.jar
149+
159150 - uses : actions/upload-artifact@v4
160151 with :
161152 name : java-windows-amd64
162153 path : |
163154 build/release/duckdb_jdbc.jar
164155
165-
166156 java-osx-universal :
167157 name : Java OSX (Universal)
168158 runs-on : macos-14
@@ -171,33 +161,30 @@ jobs:
171161 - uses : actions/checkout@v4
172162 with :
173163 fetch-depth : 0
174- ref : ${{ inputs.git_ref }}
164+
175165 - uses : actions/setup-python@v5
176166 with :
177167 python-version : " 3.12"
178- - name : Setup Ccache
179- uses : hendrikmuhs/ccache-action@main
180- with :
181- key : ${{ github.job }}
182- save : ${{ github.ref == 'refs/heads/main' }}
168+
183169 - name : Build
184170 shell : bash
185171 run : make release
172+
186173 - name : Java Tests
187174 if : ${{ inputs.skip_tests != 'true' }}
188175 shell : bash
189176 run : make test
177+
190178 - name : See if this actually universal
191179 shell : bash
192180 run : lipo -archs build/release/libduckdb_java.so_osx_universal | grep "x86_64 arm64"
181+
193182 - name : Deploy
194183 shell : bash
195- env :
196- AWS_ACCESS_KEY_ID : ${{ secrets.S3_DUCKDB_STAGING_ID }}
197- AWS_SECRET_ACCESS_KEY : ${{ secrets.S3_DUCKDB_STAGING_KEY }}
198184 run : |
199185 cp build/release/duckdb_jdbc.jar duckdb_jdbc-osx-universal.jar
200186 ./scripts/upload-assets-to-staging.sh github_release duckdb_jdbc-osx-universal.jar
187+
201188 - uses : actions/upload-artifact@v4
202189 with :
203190 name : java-osx-universal
@@ -219,7 +206,6 @@ jobs:
219206 - uses : actions/checkout@v4
220207 with :
221208 fetch-depth : 0
222- ref : ${{ inputs.git_ref }}
223209
224210 - shell : bash
225211 run : mkdir jdbc-artifacts
@@ -315,7 +301,7 @@ jobs:
315301
316302 java-merge-vendoring-pr :
317303 name : Merge vendoring PR
318- if : ${{ github.repository == 'duckdb/duckdb-java' && github.event_name == 'pull_request' && github.head_ref == format( 'vendoring-{0}', github.ref_name ) }}
304+ if : ${{ github.repository == 'duckdb/duckdb-java' && github.event_name == 'pull_request' && startsWith( github.head_ref, 'vendoring-' ) }}
319305 needs :
320306 - java-linux-aarch64
321307 - java-linux-amd64
@@ -332,7 +318,7 @@ jobs:
332318 env :
333319 GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
334320 run : |
335- # echo "Merging PR number: ${{ github.event.pull_request.number }} with message: ${{ github.event.pull_request.title }}"
321+ echo "Merging PR number: ${{ github.event.pull_request.number }} with message: ${{ github.event.pull_request.title }}"
336322 gh pr merge vendoring-${{ github.ref_name }} \
337323 --rebase \
338324 --subject "${{ github.event.pull_request.title }}" \
@@ -348,3 +334,25 @@ jobs:
348334 git pull --ff-only
349335 git branch vendoring-${{ github.ref_name }}
350336 git push origin vendoring-${{ github.ref_name }}
337+
338+ java-merge-vendoring-pr-debug :
339+ name : Merge vendoring PR Debug
340+ runs-on : ubuntu-latest
341+ steps :
342+ - uses : actions/checkout@v4
343+ with :
344+ fetch-depth : 0
345+
346+ - name : Merge vendoring PR Debug
347+ id : merge_vendoring_pr_debug
348+ env :
349+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
350+ run : |
351+ echo "github.repository: ${{ github.repository }}"
352+ echo "github.event_name: ${{ github.event_name }}"
353+ echo "github.head_ref: ${{ github.head_ref }}"
354+ echo "github.ref_name: ${{ github.ref_name }}"
355+ echo "format('vendoring-{0}', github.ref_name): ${{ format('vendoring-{0}', github.ref_name) }}"
356+ echo "startsWith(github.head_ref, 'workflows_minor_'): ${{ startsWith(github.head_ref, 'workflows_minor_') }}"
357+ echo "github.event.pull_request.number: ${{ github.event.pull_request.number }}"
358+ echo "github.event.pull_request.title: ${{ github.event.pull_request.title }}"
0 commit comments