Compare commits

...

4 Commits

Author SHA1 Message Date
Rusty Key
38038ad0e5
Merge 0b16518fff into 5656298164 2026-02-26 11:33:11 +00:00
Ryan Ghadimi
5656298164
Merge pull request #1722 from RyPeck/patch-1
Fix cache key in examples.md for bun.lock
2026-02-24 14:21:04 +00:00
Ryan Peck
4e380d19e1
Fix cache key in examples.md for bun.lock
Updated cache key to use 'bun.lock' instead of 'bun.lockb' for consistency.
2026-02-24 09:11:36 -05:00
Rusty Key
0b16518fff
Add opam example 2024-07-23 16:42:43 +01:00

View File

@ -25,6 +25,7 @@
- [Node - Yarn](#node---yarn)
- [Node - Yarn 2](#node---yarn-2)
- [OCaml/Reason - esy](#ocamlreason---esy)
- [OCaml/Reason - opam](#ocamlreason---opam)
- [PHP - Composer](#php---composer)
- [Python - pip](#python---pip)
- [Simple example](#simple-example)
@ -49,7 +50,7 @@
with:
path: |
~/.bun/install/cache
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lockb') }}
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lock') }}
```
### Windows
@ -59,7 +60,7 @@
with:
path: |
~\.bun
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lockb') }}
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lock') }}
```
## C# - NuGet
@ -437,6 +438,30 @@ Esy allows you to export built dependencies and import pre-built dependencies.
if: steps.restore-cache.outputs.cache-hit != 'true'
```
## OCaml/Reason - opam
This example requires you to have `opam.locked` file which you can generate with `opam lock .`.
It's worth noting that even if lock file was change, it might be optimal to restore previous cache, so `hashFiles` in the key and if statement in "Save opam cache" step are optional.
```yaml
- name: Restore opam cache
id: restore-cache
uses: actions/cache/restore@v4
with:
path: _opam
key: ${{ runner.os }}-opam-${{ hashFiles('opam.locked') }}
- name: Install dependencies
run: opam install . --locked --deps-only -y
- name: Save opam cache
if: steps.restore-cache.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: _opam
key: ${{ steps.restore-cache.outputs.cache-primary-key }}
```
## PHP - Composer
```yaml