1
0
Fork 0
mirror of https://code.forgejo.org/actions/cache.git synced 2025-04-19 19:46:17 +02:00

Add how-to handle Jest cache

This commit is contained in:
Emilien Escalle 2021-02-24 11:38:58 +01:00 committed by Emilien Escalle
parent 6bbe742add
commit eff961eb07

View file

@ -19,6 +19,7 @@
- [Node - Lerna](#node---lerna) - [Node - Lerna](#node---lerna)
- [Node - Yarn](#node---yarn) - [Node - Yarn](#node---yarn)
- [Node - Yarn 2](#node---yarn-2) - [Node - Yarn 2](#node---yarn-2)
- [Node - Jest](#node---jest)
- [OCaml/Reason - esy](#ocamlreason---esy) - [OCaml/Reason - esy](#ocamlreason---esy)
- [PHP - Composer](#php---composer) - [PHP - Composer](#php---composer)
- [Python - pip](#python---pip) - [Python - pip](#python---pip)
@ -295,6 +296,24 @@ The yarn 2 cache directory will depend on your config. See https://yarnpkg.com/c
${{ runner.os }}-yarn- ${{ runner.os }}-yarn-
``` ```
## Node - Jest
The Jest cache directory will depend on your config. See https://jestjs.io/docs/cli#--cache for more info.
```yaml
- name: Get Jest cache directory path
id: jest-cache-dir-path
run: |
JEST_CACHE_DIR=$(yarn jest --showConfig | grep -o '"cacheDirectory": "[^"]*' | grep -o '[^"]*$')
echo "::set-output name=dir::$JEST_CACHE_DIR"
- uses: actions/cache@v2
with:
path: ${{ steps.jest-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-jest-${{ github.sha }}
restore-keys: |
${{ runner.os }}-jest-
```
## OCaml/Reason - esy ## OCaml/Reason - esy
Esy allows you to export built dependencies and import pre-built dependencies. Esy allows you to export built dependencies and import pre-built dependencies.