mirror of
https://code.forgejo.org/actions/cache.git
synced 2025-04-16 16:01:22 +02:00
Adding examples for esy as a workflow for OCaml files
This commit is contained in:
parent
8e9c167fd7
commit
113abe8d3f
1 changed files with 28 additions and 0 deletions
28
examples.md
28
examples.md
|
@ -8,6 +8,7 @@
|
|||
- [Java - Maven](#java---maven)
|
||||
- [Node - npm](#node---npm)
|
||||
- [Node - Yarn](#node---yarn)
|
||||
- [OCaml- esy](#ocaml---esy)
|
||||
- [PHP - Composer](#php---composer)
|
||||
- [Python - pip](#python---pip)
|
||||
- [R - renv](#r---renv)
|
||||
|
@ -170,6 +171,33 @@ The yarn cache directory will depend on your operating system and version of `ya
|
|||
${{ runner.os }}-yarn-
|
||||
```
|
||||
|
||||
## OCaml - esy
|
||||
Esy allows you to export built dependencies and import pre-built dependencies.
|
||||
```yaml
|
||||
- name: Restore Cache
|
||||
id: restore-cache
|
||||
uses: actions/cache@v1.1.2
|
||||
with:
|
||||
path: _export
|
||||
key: ${{ runner.os }}-esy-${{ hashFiles('esy.lock/index.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-esy-
|
||||
- name: Esy install
|
||||
run: 'esy install'
|
||||
- name: Import Cache
|
||||
run: |
|
||||
esy import-dependencies _export
|
||||
rm -rf _export
|
||||
|
||||
...(Build job)...
|
||||
|
||||
# Re-export dependencies if anything has changed or if it is the first time
|
||||
- name: Setting dependency cache
|
||||
run: |
|
||||
esy export-dependencies
|
||||
if: steps.restore-cache.outputs.cache-hit != 'true'
|
||||
```
|
||||
|
||||
|
||||
## PHP - Composer
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue