Skip to content

Commit fa79182

Browse files
committed
Minor improvements to GH workflows
This change adds debugging job for vendoring process to investigate why vendoring PRs are not closed automatically (job skipped), while the check expression for it looks correct. It also adds a number of minor cleanups to workflows.
1 parent 6508f58 commit fa79182

File tree

2 files changed

+51
-44
lines changed

2 files changed

+51
-44
lines changed

.github/workflows/Java.yml

Lines changed: 49 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -2,39 +2,40 @@ name: Java JDBC
22
on:
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'
912
env:
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

1316
jobs:
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
@@ -82,7 +81,6 @@ jobs:
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,27 @@ 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.base_ref: ${{ github.base_ref }}"
355+
echo "github.ref_name: ${{ github.ref_name }}"
356+
echo "format('vendoring-{0}', github.ref_name): ${{ format('vendoring-{0}', github.ref_name) }}"
357+
echo "format('vendoring-{0}', github.base_ref): ${{ format('vendoring-{0}', github.base_ref) }}"
358+
echo "startsWith(github.head_ref, 'workflows_minor_'): ${{ startsWith(github.head_ref, 'vendoring-') }}"
359+
echo "github.event.pull_request.number: ${{ github.event.pull_request.number }}"
360+
echo "github.event.pull_request.title: ${{ github.event.pull_request.title }}"

.github/workflows/Vendor.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ jobs:
7373
7474
- name: Commit and push the changes
7575
id: commit_and_push
76-
if: ${{ steps.vendor.outcome == 'success' }}
7776
run: |
7877
MSG="Update vendored DuckDB sources to ${{ steps.vendor.outputs.vendor_rev }}"
7978
git commit -m "${MSG}"
@@ -89,7 +88,6 @@ jobs:
8988
9089
- name: Check PR exists
9190
id: check_pr_exists
92-
if: ${{ steps.commit_and_push.outcome == 'success' }}
9391
env:
9492
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9593
run: |
@@ -105,7 +103,6 @@ jobs:
105103
106104
- name: Prepare PR message
107105
id: prepare_pr_message
108-
if: ${{ steps.check_pr_exists.outcome == 'success' }}
109106
run: |
110107
DATE="$(date +"%Y-%m-%d %H:%M:%S")"
111108
CHANGE_LABEL="duckdb/duckdb#${{ steps.vendor.outputs.vendor_rev }}"
@@ -116,7 +113,7 @@ jobs:
116113
117114
- name: Create PR
118115
id: create_pr
119-
if: ${{ steps.prepare_pr_message.outcome == 'success' && steps.check_pr_exists.outputs.pr_exists == 'false' }}
116+
if: ${{ steps.check_pr_exists.outputs.pr_exists == 'false' }}
120117
env:
121118
# We cannot use default workflow's GITHUB_TOKEN here, because
122119
# it is restricted to not trigger 'pull_request' event that
@@ -136,7 +133,7 @@ jobs:
136133
137134
- name: Update PR
138135
id: update_pr
139-
if: ${{ steps.prepare_pr_message.outcome == 'success' && steps.check_pr_exists.outputs.pr_exists == 'true' }}
136+
if: ${{ steps.check_pr_exists.outputs.pr_exists == 'true' }}
140137
env:
141138
# We cannot use default workflow's GITHUB_TOKEN here, because
142139
# it is restricted to not trigger 'pull_request' event that

0 commit comments

Comments
 (0)