Commit 458778d
chore(ci): pin Bun and add cache + retried fallback installer (#5228)
## Summary
Enhanced the Bun setup action to improve installation reliability by
adding toolchain caching, pinning to a specific version, implementing a
fallback installation mechanism with retries, and adding version
verification.
## Key Changes
- **Pin Bun version**: Changed from `latest` to a specific version
(`1.3.13`) for reproducible builds
- **Add toolchain caching**: Implemented caching of the Bun toolchain to
`/opt/hostedtoolcache/bun` to speed up subsequent workflow runs
- **Implement fallback installation**: Added a retry-based fallback
mechanism using `nick-fields/retry@v3` that directly downloads and
installs Bun via curl if the primary setup action fails
- **Add version verification**: Added a verification step to confirm Bun
is properly installed by running `bun --version`
- **Improve error handling**: Made the primary installation step
non-blocking with `continue-on-error: true` to allow the fallback
mechanism to execute
## Implementation Details
- The fallback installation uses curl to download from
`https://bun.sh/install` with up to 5 retry attempts and 30-second wait
intervals between retries
- The Bun binary path is explicitly added to `$GITHUB_PATH` in the
fallback step to ensure it's available for subsequent steps
- All steps use the pinned `BUN_VERSION` environment variable for
consistency across the workflow
https://claude.ai/code/session_01KYCuKb2pWDBjsAZ2DagygF
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Julien Goux <hi@jgoux.dev>1 parent 6878356 commit 458778d
1 file changed
Lines changed: 29 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
8 | 19 | | |
| 20 | + | |
9 | 21 | | |
| 22 | + | |
10 | 23 | | |
11 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
12 | 40 | | |
13 | 41 | | |
14 | 42 | | |
| |||
0 commit comments