Skip to content

Commit 2761801

Browse files
committed
feat(dependencies-cache): add support for Vitest
Signed-off-by: Emilien Escalle <[email protected]>
1 parent 5098771 commit 2761801

File tree

4 files changed

+21
-7
lines changed

4 files changed

+21
-7
lines changed

actions/build/action.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ runs:
7979
nx
8080
gatsby
8181
storybook
82+
astro
83+
docusaurus
8284
8385
- id: get-package-manager
8486
if: inputs.container == 'true'

actions/dependencies-cache/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ Action to setup dependencies cache managment.
3131
- NX (`node_modules/.cache/nx`)
3232
- Prettier (`node_modules/.cache/prettier`)
3333
- Docusaurus (`.docusaurus`, `node_modules/.cache/webpack`)
34+
- Vitest (`node_modules/.vitest`)
3435
- Astro (`node_modules/.astro`)
3536
- Gatsby (`.cache`, `public`)
3637
- Storybook (`node_modules/.cache/storybook`)

actions/dependencies-cache/action.yml

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@ description: |
44
55
### Supported caches
66
7-
- NX (`node_modules/.cache/nx`)
8-
- Prettier (`node_modules/.cache/prettier`)
9-
- Docusaurus (`.docusaurus`, `node_modules/.cache/webpack`)
10-
- Astro (`node_modules/.astro`)
11-
- Gatsby (`.cache`, `public`)
12-
- Storybook (`node_modules/.cache/storybook`)
13-
- Jest (auto-detected `cacheDirectory`)
7+
- NX (`node_modules/.cache/nx`): `nx`
8+
- Prettier (`node_modules/.cache/prettier`): `prettier`
9+
- Docusaurus (`.docusaurus`, `node_modules/.cache/webpack`): `docusaurus`
10+
- Vitest (`node_modules/.vite/vitest`): `vitest`
11+
- Astro (`node_modules/.astro`): `astro`
12+
- Gatsby (`.cache`, `public`): `gatsby`
13+
- Storybook (`node_modules/.cache/storybook`): `storybook`
14+
- Jest (auto-detected `cacheDirectory`): `jest`
1415
1516
author: hoverkraft
1617
branding:
@@ -77,6 +78,15 @@ runs:
7778
restore-keys: |
7879
${{ runner.os }}-cache-docusaurus-
7980
81+
- name: ♻️ Vitest cache
82+
if: fromJson(steps.has-installed-dependencies.outputs.installed-dependencies).vitest == true
83+
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
84+
with:
85+
path: ${{ inputs.working-directory }}/node_modules/.vite/vitest
86+
key: ${{ runner.os }}-cache-vitest-${{ github.sha }}
87+
restore-keys: |
88+
${{ runner.os }}-cache-vitest-
89+
8090
- name: ♻️ Astro cache
8191
if: fromJson(steps.has-installed-dependencies.outputs.installed-dependencies).astro == true
8292
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0

actions/test/action.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ runs:
6868
dependencies-cache: |
6969
nx
7070
jest
71+
vitest
7172
7273
- id: get-package-manager
7374
if: inputs.container == 'true'

0 commit comments

Comments
 (0)