mirror of
				https://github.com/actions/cache.git
				synced 2025-10-31 11:48:38 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			34 lines
		
	
	
		
			719 B
		
	
	
	
		
			YAML
		
	
	
	
	
	
			
		
		
	
	
			34 lines
		
	
	
		
			719 B
		
	
	
	
		
			YAML
		
	
	
	
	
	
| name: Cache
 | |
| 
 | |
| on:
 | |
|   pull_request:
 | |
|     branches:
 | |
|       - master
 | |
| 
 | |
| jobs:
 | |
|   # Build and unit test
 | |
|   build:
 | |
|     runs-on: self-hosted
 | |
|     steps:
 | |
|     - name: Checkout
 | |
|       uses: actions/checkout@v2
 | |
|     - name: Setup Node.js
 | |
|       uses: actions/setup-node@v1
 | |
|       with:
 | |
|         node-version: '12.x'
 | |
|     - run: npm install
 | |
|     - run: npm run build
 | |
|     - name: Restore npm cache
 | |
|       uses: ./
 | |
|       with:
 | |
|         path: |
 | |
|           node_modules
 | |
|           dist
 | |
|           ~/Desktop/cache-me          
 | |
|         key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
 | |
|     - name: Prettier Format Check
 | |
|       run: npm run format-check
 | |
|     - name: ESLint Check
 | |
|       run: npm run lint
 | |
|     - name: Build & Test
 | |
|       run: npm run test | 
