Skip to content

Commit 7038260

Browse files
committed
fix: use sparse checkout to exclude LayoutTests/JSTests (Windows path length)
1 parent 208d624 commit 7038260

File tree

1 file changed

+44
-25
lines changed

1 file changed

+44
-25
lines changed

.github/workflows/build-reusable.yml

Lines changed: 44 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -88,20 +88,24 @@ jobs:
8888
path: libbun-webkit
8989

9090
- name: Clone WebKit
91-
run: |
92-
git clone --depth 1 https://github.com/oven-sh/WebKit.git webkit
93-
cd webkit
94-
git fetch --depth 1 origin ${{ inputs.webkit_sha }}
95-
git checkout ${{ inputs.webkit_sha }}
91+
uses: actions/checkout@v4
92+
with:
93+
repository: oven-sh/WebKit
94+
ref: ${{ inputs.webkit_sha }}
95+
path: webkit
96+
sparse-checkout-cone-mode: false
97+
sparse-checkout: |
98+
/*
99+
!LayoutTests/
100+
!JSTests/
96101
97102
- name: Apply patches
98103
run: |
99104
cd webkit
100105
for patch in ${{ github.workspace }}/libbun-webkit/patches/*.patch; do
101106
if [ -f "$patch" ]; then
102107
echo "Applying patch: $patch"
103-
git apply "$patch" || echo "Patch may have already been applied or doesn't match exactly, trying with --3way"
104-
git apply --3way "$patch" 2>/dev/null || true
108+
git apply "$patch" || git apply --3way "$patch" 2>/dev/null || echo "Patch $patch may not apply cleanly"
105109
fi
106110
done
107111
@@ -227,19 +231,24 @@ jobs:
227231
path: libbun-webkit
228232

229233
- name: Clone WebKit
230-
run: |
231-
git clone --depth 1 https://github.com/oven-sh/WebKit.git webkit
232-
cd webkit
233-
git fetch --depth 1 origin ${{ inputs.webkit_sha }}
234-
git checkout ${{ inputs.webkit_sha }}
234+
uses: actions/checkout@v4
235+
with:
236+
repository: oven-sh/WebKit
237+
ref: ${{ inputs.webkit_sha }}
238+
path: webkit
239+
sparse-checkout-cone-mode: false
240+
sparse-checkout: |
241+
/*
242+
!LayoutTests/
243+
!JSTests/
235244
236245
- name: Apply patches
237246
run: |
238247
cd webkit
239248
for patch in ${{ github.workspace }}/libbun-webkit/patches/*.patch; do
240249
if [ -f "$patch" ]; then
241250
echo "Applying patch: $patch"
242-
git apply "$patch" || git apply --3way "$patch" 2>/dev/null || true
251+
git apply "$patch" || git apply --3way "$patch" 2>/dev/null || echo "Patch $patch may not apply cleanly"
243252
fi
244253
done
245254
@@ -292,11 +301,16 @@ jobs:
292301
path: libbun-webkit
293302

294303
- name: Clone WebKit
295-
run: |
296-
git clone --depth 1 https://github.com/oven-sh/WebKit.git webkit
297-
cd webkit
298-
git fetch --depth 1 origin ${{ inputs.webkit_sha }}
299-
git checkout ${{ inputs.webkit_sha }}
304+
uses: actions/checkout@v4
305+
with:
306+
repository: oven-sh/WebKit
307+
ref: ${{ inputs.webkit_sha }}
308+
path: webkit
309+
sparse-checkout-cone-mode: false
310+
sparse-checkout: |
311+
/*
312+
!LayoutTests/
313+
!JSTests/
300314
301315
- name: Apply patches
302316
shell: bash
@@ -305,7 +319,7 @@ jobs:
305319
for patch in ${{ github.workspace }}/libbun-webkit/patches/*.patch; do
306320
if [ -f "$patch" ]; then
307321
echo "Applying patch: $patch"
308-
git apply "$patch" || git apply --3way "$patch" 2>/dev/null || true
322+
git apply "$patch" || git apply --3way "$patch" 2>/dev/null || echo "Patch $patch may not apply cleanly"
309323
fi
310324
done
311325
@@ -386,19 +400,24 @@ jobs:
386400
path: libbun-webkit
387401

388402
- name: Clone WebKit
389-
run: |
390-
git clone --depth 1 https://github.com/oven-sh/WebKit.git webkit
391-
cd webkit
392-
git fetch --depth 1 origin ${{ inputs.webkit_sha }}
393-
git checkout ${{ inputs.webkit_sha }}
403+
uses: actions/checkout@v4
404+
with:
405+
repository: oven-sh/WebKit
406+
ref: ${{ inputs.webkit_sha }}
407+
path: webkit
408+
sparse-checkout-cone-mode: false
409+
sparse-checkout: |
410+
/*
411+
!LayoutTests/
412+
!JSTests/
394413
395414
- name: Apply patches
396415
run: |
397416
cd webkit
398417
for patch in ${{ github.workspace }}/libbun-webkit/patches/*.patch; do
399418
if [ -f "$patch" ]; then
400419
echo "Applying patch: $patch"
401-
git apply "$patch" || git apply --3way "$patch" 2>/dev/null || true
420+
git apply "$patch" || git apply --3way "$patch" 2>/dev/null || echo "Patch $patch may not apply cleanly"
402421
fi
403422
done
404423

0 commit comments

Comments
 (0)