Skip to content

Commit 0ae03de

Browse files
Reorder to npm, yarn, pnpm
1 parent 4bc87b8 commit 0ae03de

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

README.md

+15-15
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
This action provides the following functionality for GitHub Actions users:
88

99
- Optionally downloading and caching distribution of the requested Node.js version, and adding it to the PATH
10-
- Optionally caching npm/pnpm/yarn dependencies
10+
- Optionally caching npm/yarn/pnpm dependencies
1111
- Registering problem matchers for error output
1212
- Configuring authentication for GPR or npm
1313

@@ -41,7 +41,7 @@ nvm lts syntax: `lts/erbium`, `lts/fermium`, `lts/*`
4141

4242
### Caching packages dependencies
4343

44-
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.
4545

4646
**Caching npm dependencies:**
4747
```yaml
@@ -55,6 +55,19 @@ steps:
5555
- run: npm test
5656
```
5757

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+
5871
**Caching pnpm (v6.10+) dependencies:**
5972
```yaml
6073
# This workflow uses actions that are not certified by GitHub.
@@ -77,19 +90,6 @@ steps:
7790
- run: pnpm test
7891
```
7992

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-
9393
> At the moment, only `lock` files in the project root are supported.
9494

9595
### Matrix Testing:

action.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ inputs:
2020
description: Used to pull node distributions from node-versions. Since there's a default, this is typically not supplied by the user.
2121
default: ${{ github.token }}
2222
cache:
23-
description: 'Used to specify a package manager for caching in the default directory. Supported values: npm, pnpm, yarn'
23+
description: 'Used to specify a package manager for caching in the default directory. Supported values: npm, yarn, pnpm'
2424
# TODO: add input to control forcing to pull from cloud or dist.
2525
# escape valve for someone having issues or needing the absolute latest which isn't cached yet
2626
# Deprecated option, do not use. Will not be supported after October 1, 2019

0 commit comments

Comments
 (0)