mirror of
				https://github.com/actions/setup-node.git
				synced 2025-11-04 13:29:12 +08:00 
			
		
		
		
	Use CI friendly commands in documentation (#326)
This commit is contained in:
		
							
								
								
									
										12
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								README.md
									
									
									
									
									
								
							@@ -23,7 +23,7 @@ steps:
 | 
			
		||||
- uses: actions/setup-node@v3
 | 
			
		||||
  with:
 | 
			
		||||
    node-version: 14
 | 
			
		||||
- run: npm install
 | 
			
		||||
- run: npm ci
 | 
			
		||||
- run: npm test
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
@@ -41,6 +41,10 @@ major versions: `12`, `14`, `16`
 | 
			
		||||
more specific versions: `10.15`, `14.2.0`, `16.3.0`
 | 
			
		||||
nvm lts syntax: `lts/erbium`, `lts/fermium`, `lts/*`
 | 
			
		||||
 | 
			
		||||
### Checking in lockfiles
 | 
			
		||||
 | 
			
		||||
It's **always** recommended to commit the lockfile of your package manager for security and performance reasons. For more information consult the "Working with lockfiles" section of the [Advanced usage](docs/advanced-usage.md#working-with-lockfiles) guide.
 | 
			
		||||
 | 
			
		||||
## Caching global packages data
 | 
			
		||||
 | 
			
		||||
The action has a built-in functionality for caching and restoring dependencies. It uses [actions/cache](https://github.com/actions/cache) under the hood for caching global packages data but requires less configuration settings. Supported package managers are `npm`, `yarn`, `pnpm` (v6.10+). The `cache` input is optional, and caching is turned off by default.
 | 
			
		||||
@@ -60,7 +64,7 @@ steps:
 | 
			
		||||
  with:
 | 
			
		||||
    node-version: 14
 | 
			
		||||
    cache: 'npm'
 | 
			
		||||
- run: npm install
 | 
			
		||||
- run: npm ci
 | 
			
		||||
- run: npm test
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
@@ -74,7 +78,7 @@ steps:
 | 
			
		||||
    node-version: 14
 | 
			
		||||
    cache: 'npm'
 | 
			
		||||
    cache-dependency-path: subdir/package-lock.json
 | 
			
		||||
- run: npm install
 | 
			
		||||
- run: npm ci
 | 
			
		||||
- run: npm test
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
@@ -94,7 +98,7 @@ jobs:
 | 
			
		||||
        uses: actions/setup-node@v3
 | 
			
		||||
        with:
 | 
			
		||||
          node-version: ${{ matrix.node }}
 | 
			
		||||
      - run: npm install
 | 
			
		||||
      - run: npm ci
 | 
			
		||||
      - run: npm test
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user