8000 Add Bun example by idleberg · Pull Request #1456 · actions/cache · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add Bun example #1456

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ Every programming language and framework has its own way of caching.

See [Examples](examples.md) for a list of `actions/cache` implementations for use with:

* [Bun](./examples.md#bun)
* [C# - NuGet](./examples.md#c---nuget)
* [Clojure - Lein Deps](./examples.md#clojure---lein-deps)
* [D - DUB](./examples.md#d---dub)
Expand Down
21 changes: 21 additions & 0 deletions examples.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Examples

- [Bun](#bun)
- [C# - NuGet](#c---nuget)
- [Clojure - Lein Deps](#clojure---lein-deps)
- [D - DUB](#d---dub)
Expand Down Expand Up @@ -41,6 +42,26 @@
- [Swift - Mint](#swift---mint)
- [* - Bazel](#---bazel)

## Bun

```yaml
- uses: actions/cache@v4
with:
path: |
~/.bun/install/cache
Comment on lines +50 to +51

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not add node_modules to the list of paths, @idleberg @joshmgross?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@PaulRBerg node_modules with Bun is just hardlinks to the aforementioned ~/.bun/install/cache like PNPM to use less space on disk.

However Bun is usually faster than the cache system, so I wouldn't recommend using it: oven-sh/setup-bun#14 (comment)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

haha interesting, thanks for your answer!

key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lockb') }}
```

### Windows

```yaml
- uses: actions/cache@v4
with:
path: |
~\.bun
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lockb') }}
```

## C# - NuGet

Using [NuGet lock files](https://docs.microsoft.com/nuget/consume-packages/package-references-in-project-files#locking-dependencies):
Expand Down
Loading
0