mirror of
				https://github.com/actions/cache.git
				synced 2025-11-04 07:38:37 +08:00 
			
		
		
		
	pip: include setup.py when calculating cache key
setup.py is used in Python packages instead of requirements.txt file See https://github.com/macbre/index-digest/pull/190 for a working example
This commit is contained in:
		
							parent
							
								
									8819edf476
								
							
						
					
					
						commit
						a97f6cee0f
					
				
							
								
								
									
										12
									
								
								examples.md
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								examples.md
									
									
									
									
									
								
							| 
						 | 
					@ -309,7 +309,7 @@ Locations:
 | 
				
			||||||
- uses: actions/cache@v2
 | 
					- uses: actions/cache@v2
 | 
				
			||||||
  with:
 | 
					  with:
 | 
				
			||||||
    path: ~/.cache/pip
 | 
					    path: ~/.cache/pip
 | 
				
			||||||
    key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
 | 
					    key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt', '**/setup.py') }}
 | 
				
			||||||
    restore-keys: |
 | 
					    restore-keys: |
 | 
				
			||||||
      ${{ runner.os }}-pip-
 | 
					      ${{ runner.os }}-pip-
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
| 
						 | 
					@ -323,7 +323,7 @@ Replace `~/.cache/pip` with the correct `path` if not using Ubuntu.
 | 
				
			||||||
  if: startsWith(runner.os, 'Linux')
 | 
					  if: startsWith(runner.os, 'Linux')
 | 
				
			||||||
  with:
 | 
					  with:
 | 
				
			||||||
    path: ~/.cache/pip
 | 
					    path: ~/.cache/pip
 | 
				
			||||||
    key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
 | 
					    key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt', '**/setup.py') }}
 | 
				
			||||||
    restore-keys: |
 | 
					    restore-keys: |
 | 
				
			||||||
      ${{ runner.os }}-pip-
 | 
					      ${{ runner.os }}-pip-
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -331,7 +331,7 @@ Replace `~/.cache/pip` with the correct `path` if not using Ubuntu.
 | 
				
			||||||
  if: startsWith(runner.os, 'macOS')
 | 
					  if: startsWith(runner.os, 'macOS')
 | 
				
			||||||
  with:
 | 
					  with:
 | 
				
			||||||
    path: ~/Library/Caches/pip
 | 
					    path: ~/Library/Caches/pip
 | 
				
			||||||
    key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
 | 
					    key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt', '**/setup.py') }}
 | 
				
			||||||
    restore-keys: |
 | 
					    restore-keys: |
 | 
				
			||||||
      ${{ runner.os }}-pip-
 | 
					      ${{ runner.os }}-pip-
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -339,7 +339,7 @@ Replace `~/.cache/pip` with the correct `path` if not using Ubuntu.
 | 
				
			||||||
  if: startsWith(runner.os, 'Windows')
 | 
					  if: startsWith(runner.os, 'Windows')
 | 
				
			||||||
  with:
 | 
					  with:
 | 
				
			||||||
    path: ~\AppData\Local\pip\Cache
 | 
					    path: ~\AppData\Local\pip\Cache
 | 
				
			||||||
    key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
 | 
					    key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt', '**/setup.py') }}
 | 
				
			||||||
    restore-keys: |
 | 
					    restore-keys: |
 | 
				
			||||||
      ${{ runner.os }}-pip-
 | 
					      ${{ runner.os }}-pip-
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
| 
						 | 
					@ -357,7 +357,7 @@ Replace `~/.cache/pip` with the correct `path` if not using Ubuntu.
 | 
				
			||||||
  uses: actions/cache@v2
 | 
					  uses: actions/cache@v2
 | 
				
			||||||
  with:
 | 
					  with:
 | 
				
			||||||
    path: ${{ steps.pip-cache.outputs.dir }}
 | 
					    path: ${{ steps.pip-cache.outputs.dir }}
 | 
				
			||||||
    key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
 | 
					    key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt', '**/setup.py') }}
 | 
				
			||||||
    restore-keys: |
 | 
					    restore-keys: |
 | 
				
			||||||
      ${{ runner.os }}-pip-
 | 
					      ${{ runner.os }}-pip-
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
| 
						 | 
					@ -374,7 +374,7 @@ Replace `~/.cache/pip` with the correct `path` if not using Ubuntu.
 | 
				
			||||||
- uses: actions/cache@v2
 | 
					- uses: actions/cache@v2
 | 
				
			||||||
  with:
 | 
					  with:
 | 
				
			||||||
    path: ${{ steps.pip-cache.outputs.dir }}
 | 
					    path: ${{ steps.pip-cache.outputs.dir }}
 | 
				
			||||||
    key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
 | 
					    key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt', '**/setup.py') }}
 | 
				
			||||||
    restore-keys: |
 | 
					    restore-keys: |
 | 
				
			||||||
      ${{ runner.os }}-pip-
 | 
					      ${{ runner.os }}-pip-
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user