mirror of
https://code.forgejo.org/actions/setup-python
synced 2025-06-14 06:54:10 +02:00
Add another pip default dependency file for cache hash (#604)
This commit is contained in:
parent
869e769ec8
commit
7b9ef6fc5a
7 changed files with 98 additions and 18 deletions
|
@ -8,8 +8,11 @@ import os from 'os';
|
|||
|
||||
import CacheDistributor from './cache-distributor';
|
||||
import {getLinuxInfo, IS_LINUX, IS_WINDOWS} from '../utils';
|
||||
import {CACHE_DEPENDENCY_BACKUP_PATH} from './constants';
|
||||
|
||||
class PipCache extends CacheDistributor {
|
||||
private cacheDependencyBackupPath: string = CACHE_DEPENDENCY_BACKUP_PATH;
|
||||
|
||||
constructor(
|
||||
private pythonVersion: string,
|
||||
cacheDependencyPath: string = '**/requirements.txt'
|
||||
|
@ -56,7 +59,9 @@ class PipCache extends CacheDistributor {
|
|||
}
|
||||
|
||||
protected async computeKeys() {
|
||||
const hash = await glob.hashFiles(this.cacheDependencyPath);
|
||||
const hash =
|
||||
(await glob.hashFiles(this.cacheDependencyPath)) ||
|
||||
(await glob.hashFiles(this.cacheDependencyBackupPath));
|
||||
let primaryKey = '';
|
||||
let restoreKey = '';
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue