mirror of
				https://gitea.com/actions/setup-node.git
				synced 2025-10-29 15:52:42 +08:00 
			
		
		
		
	Add pnpm caching support
This commit is contained in:
		
							
								
								
									
										19
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										19
									
								
								README.md
									
									
									
									
									
								
							| @@ -7,7 +7,7 @@ | ||||
| This action provides the following functionality for GitHub Actions users: | ||||
|  | ||||
| - Optionally downloading and caching distribution of the requested Node.js version, and adding it to the PATH | ||||
| - Optionally caching npm/yarn dependencies | ||||
| - Optionally caching npm/pnpm/yarn dependencies | ||||
| - Registering problem matchers for error output | ||||
| - Configuring authentication for GPR or npm | ||||
|  | ||||
| @@ -41,7 +41,7 @@ nvm lts syntax: `lts/erbium`, `lts/fermium`, `lts/*` | ||||
|  | ||||
| ### Caching packages dependencies | ||||
|  | ||||
| The action has a built-in functionality for caching and restoring npm/yarn dependencies. Supported package managers are `npm`, `yarn`. The `cache` input is optional, and caching is turned off by default. | ||||
| 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. | ||||
|  | ||||
| **Caching npm dependencies:** | ||||
| ```yaml | ||||
| @@ -55,6 +55,21 @@ steps: | ||||
| - run: npm test | ||||
| ``` | ||||
|  | ||||
| **Caching pnpm dependencies:** | ||||
| ```yaml | ||||
| steps: | ||||
| - uses: actions/checkout@v2 | ||||
| - uses: pnpm/action-setup@v2 | ||||
|   with: | ||||
|     version: 6.9.0 | ||||
| - uses: actions/setup-node@v2 | ||||
|   with: | ||||
|     node-version: '14' | ||||
|     cache: 'pnpm' | ||||
| - run: pnpm install | ||||
| - run: pnpm test | ||||
| ``` | ||||
|  | ||||
| **Caching yarn dependencies:** | ||||
| ```yaml | ||||
| steps: | ||||
|   | ||||
		Reference in New Issue
	
	Block a user