Skip to content

Commit db99a90

Browse files
committed
Harden Bun compile runtime cache restore
1 parent 84794b8 commit db99a90

1 file changed

Lines changed: 13 additions & 3 deletions

File tree

  • .github/actions/setup-bun-compile-runtime

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

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,13 @@ runs:
1414
shell: bash
1515
run: echo "version=$(bun --version)" >> "$GITHUB_OUTPUT"
1616

17-
- name: Cache Bun compile runtime
18-
uses: actions/cache@v5
17+
- name: Restore Bun compile runtime cache
18+
id: compile-runtime-cache
19+
uses: actions/cache/restore@v5
20+
continue-on-error: true
1921
with:
2022
path: ${{ runner.temp }}/bun-compile-runtimes/${{ inputs.target }}-v${{ steps.bun-version.outputs.version }}
21-
key: ${{ runner.os }}-bun-compile-runtime-${{ inputs.target }}-v${{ steps.bun-version.outputs.version }}
23+
key: ${{ runner.os }}-bun-compile-runtime-v2-${{ inputs.target }}-v${{ steps.bun-version.outputs.version }}
2224

2325
- name: Prepare Bun compile runtime
2426
shell: pwsh
@@ -49,3 +51,11 @@ runs:
4951
}
5052
5153
"BUN_COMPILE_EXECUTABLE_PATH=$runtimePath" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
54+
55+
- name: Save Bun compile runtime cache
56+
if: steps.compile-runtime-cache.outputs.cache-hit != 'true'
57+
uses: actions/cache/save@v5
58+
continue-on-error: true
59+
with:
60+
path: ${{ runner.temp }}/bun-compile-runtimes/${{ inputs.target }}-v${{ steps.bun-version.outputs.version }}
61+
key: ${{ runner.os }}-bun-compile-runtime-v2-${{ inputs.target }}-v${{ steps.bun-version.outputs.version }}

0 commit comments

Comments
 (0)