1
0
Fork 0
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:
Evgenii Korolevskii 2023-02-20 13:36:57 +01:00 committed by GitHub
parent 869e769ec8
commit 7b9ef6fc5a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 98 additions and 18 deletions

View file

@ -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 = '';