You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The action has a built-in functionality for caching and restoring npm/yarn dependencies. Supported package managers are `npm`, `pnpm`, `yarn`. The `cache` input is optional, and caching is turned off by default.
44
+
The action has a built-in functionality for caching and restoring npm/yarn dependencies. Supported package managers are `npm`, `yarn`, `pnpm`. The `cache` input is optional, and caching is turned off by default.
45
45
46
46
**Caching npm dependencies:**
47
47
```yaml
@@ -55,6 +55,19 @@ steps:
55
55
- run: npm test
56
56
```
57
57
58
+
**Caching yarn dependencies:**
59
+
```yaml
60
+
steps:
61
+
- uses: actions/checkout@v2
62
+
- uses: actions/setup-node@v2
63
+
with:
64
+
node-version: '14'
65
+
cache: 'yarn'
66
+
- run: yarn install
67
+
- run: yarn test
68
+
```
69
+
Yarn caching handles both yarn versions: 1 or 2.
70
+
58
71
**Caching pnpm (v6.10+) dependencies:**
59
72
```yaml
60
73
# This workflow uses actions that are not certified by GitHub.
@@ -77,19 +90,6 @@ steps:
77
90
- run: pnpm test
78
91
```
79
92
80
-
**Caching yarn dependencies:**
81
-
```yaml
82
-
steps:
83
-
- uses: actions/checkout@v2
84
-
- uses: actions/setup-node@v2
85
-
with:
86
-
node-version: '14'
87
-
cache: 'yarn'
88
-
- run: yarn install
89
-
- run: yarn test
90
-
```
91
-
Yarn caching handles both yarn versions: 1 or 2.
92
-
93
93
> At the moment, only `lock` files in the project root are supported.
0 commit comments