mirror of
				https://github.com/actions/cache.git
				synced 2025-11-04 03:04:01 +00:00 
			
		
		
		
	Merge branch 'main' into restore-key-logging
This commit is contained in:
		
						commit
						a1fcb467bf
					
				
							
								
								
									
										21
									
								
								examples.md
									
									
									
									
									
								
							
							
						
						
									
										21
									
								
								examples.md
									
									
									
									
									
								
							@ -100,7 +100,9 @@ steps:
 | 
				
			|||||||
```yaml
 | 
					```yaml
 | 
				
			||||||
- uses: actions/cache@v2
 | 
					- uses: actions/cache@v2
 | 
				
			||||||
  with:
 | 
					  with:
 | 
				
			||||||
    path: deps
 | 
					    path: |
 | 
				
			||||||
 | 
					      deps
 | 
				
			||||||
 | 
					      _build
 | 
				
			||||||
    key: ${{ runner.os }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
 | 
					    key: ${{ runner.os }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
 | 
				
			||||||
    restore-keys: |
 | 
					    restore-keys: |
 | 
				
			||||||
      ${{ runner.os }}-mix-
 | 
					      ${{ runner.os }}-mix-
 | 
				
			||||||
@ -389,23 +391,6 @@ jobs:
 | 
				
			|||||||
      ${{ runner.os }}-pip-
 | 
					      ${{ runner.os }}-pip-
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
### Using a script to get cache location
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
> Note: This uses an internal pip API and may not always work
 | 
					 | 
				
			||||||
```yaml
 | 
					 | 
				
			||||||
- name: Get pip cache dir
 | 
					 | 
				
			||||||
  id: pip-cache
 | 
					 | 
				
			||||||
  run: |
 | 
					 | 
				
			||||||
    python -c "from pip._internal.locations import USER_CACHE_DIR; print('::set-output name=dir::' + USER_CACHE_DIR)"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
- uses: actions/cache@v2
 | 
					 | 
				
			||||||
  with:
 | 
					 | 
				
			||||||
    path: ${{ steps.pip-cache.outputs.dir }}
 | 
					 | 
				
			||||||
    key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
 | 
					 | 
				
			||||||
    restore-keys: |
 | 
					 | 
				
			||||||
      ${{ runner.os }}-pip-
 | 
					 | 
				
			||||||
```
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
## Python - pipenv
 | 
					## Python - pipenv
 | 
				
			||||||
 | 
					
 | 
				
			||||||
```yaml
 | 
					```yaml
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user