Skip to content

Commit fafbc29

Browse files
authored
fix(ci): use dynamic bun cache path for cross-platform support (anomalyco#17120)
1 parent 7b0def4 commit fafbc29

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

.github/actions/setup-bun/action.yml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,6 @@ description: "Setup Bun with caching and install dependencies"
33
runs:
44
using: "composite"
55
steps:
6-
- name: Cache Bun dependencies
7-
uses: actions/cache@v4
8-
with:
9-
path: ~/.bun/install/cache
10-
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lockb') }}
11-
restore-keys: |
12-
${{ runner.os }}-bun-
13-
146
- name: Get baseline download URL
157
id: bun-url
168
shell: bash
@@ -31,6 +23,19 @@ runs:
3123
bun-version-file: ${{ !steps.bun-url.outputs.url && 'package.json' || '' }}
3224
bun-download-url: ${{ steps.bun-url.outputs.url }}
3325

26+
- name: Get cache directory
27+
id: cache
28+
shell: bash
29+
run: echo "dir=$(bun pm cache)" >> "$GITHUB_OUTPUT"
30+
31+
- name: Cache Bun dependencies
32+
uses: actions/cache@v4
33+
with:
34+
path: ${{ steps.cache.outputs.dir }}
35+
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lock') }}
36+
restore-keys: |
37+
${{ runner.os }}-bun-
38+
3439
- name: Install setuptools for distutils compatibility
3540
run: python3 -m pip install setuptools || pip install setuptools || true
3641
shell: bash

0 commit comments

Comments
 (0)