Compare commits

...

4 Commits

Author SHA1 Message Date
Tommy G 99bf0affff
Merge 8d70dfb799 into 8469c94c6a 2024-10-09 10:47:51 +02:00
Jan T. Sott 8469c94c6a
Add Bun example (#1456)
* Add Bun example

* Fix Bun Windows example
2024-10-08 19:53:09 +00:00
Tommy G 8d70dfb799
Merge branch 'main' into main 2023-07-18 08:30:27 +10:00
Tommy G d53778de5f
Include .crates.toml in Rust example
Using the existing example, cargo install will error out after restoring a cache:
```
cargo install cargo-tarpaulin
    Updating crates.io index
error: binary `cargo-tarpaulin` already exists in destination
Add --force to overwrite
Error: Process completed with exit code 101.
```

`--force` is undesirable because it will recompile the binary.  Cargo is scared of the existing binary because it doesn't have enough information about it.  Including `~/.cargo/.crates.toml` coaxes it into being okay with the situation.
2023-05-04 16:33:36 +10:00
2 changed files with 23 additions and 0 deletions

View File

@ -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: See [Examples](examples.md) for a list of `actions/cache` implementations for use with:
* [Bun](./examples.md#bun)
* [C# - NuGet](./examples.md#c---nuget) * [C# - NuGet](./examples.md#c---nuget)
* [Clojure - Lein Deps](./examples.md#clojure---lein-deps) * [Clojure - Lein Deps](./examples.md#clojure---lein-deps)
* [D - DUB](./examples.md#d---dub) * [D - DUB](./examples.md#d---dub)

View File

@ -1,5 +1,6 @@
# Examples # Examples
- [Bun](#bun)
- [C# - NuGet](#c---nuget) - [C# - NuGet](#c---nuget)
- [Clojure - Lein Deps](#clojure---lein-deps) - [Clojure - Lein Deps](#clojure---lein-deps)
- [D - DUB](#d---dub) - [D - DUB](#d---dub)
@ -41,6 +42,26 @@
- [Swift - Mint](#swift---mint) - [Swift - Mint](#swift---mint)
- [* - Bazel](#---bazel) - [* - Bazel](#---bazel)
## Bun
```yaml
- uses: actions/cache@v4
with:
path: |
~/.bun/install/cache
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 ## C# - NuGet
Using [NuGet lock files](https://docs.microsoft.com/nuget/consume-packages/package-references-in-project-files#locking-dependencies): Using [NuGet lock files](https://docs.microsoft.com/nuget/consume-packages/package-references-in-project-files#locking-dependencies):
@ -592,6 +613,7 @@ whenever possible:
- uses: actions/cache@v4 - uses: actions/cache@v4
with: with:
path: | path: |
~/.cargo/.crates.toml
~/.cargo/bin/ ~/.cargo/bin/
~/.cargo/registry/index/ ~/.cargo/registry/index/
~/.cargo/registry/cache/ ~/.cargo/registry/cache/