mirror of
https://github.com/actions/setup-python.git
synced 2025-07-05 00:53:46 +00:00
add backup
This commit is contained in:
parent
a04a8ba00a
commit
8644d4cc22
2 changed files with 10 additions and 4 deletions
|
@ -10,6 +10,9 @@ import CacheDistributor from './cache-distributor';
|
|||
import {getLinuxInfo, IS_LINUX, IS_WINDOWS} from '../utils';
|
||||
|
||||
class PipCache extends CacheDistributor {
|
||||
|
||||
private readonly cacheDependencyBackupPath: string = '**/pyproject.toml';
|
||||
|
||||
constructor(
|
||||
private pythonVersion: string,
|
||||
cacheDependencyPath: string = '**/requirements.txt'
|
||||
|
@ -56,8 +59,9 @@ class PipCache extends CacheDistributor {
|
|||
}
|
||||
|
||||
protected async computeKeys() {
|
||||
const hash = await glob.hashFiles(this.cacheDependencyPath);
|
||||
core.info(`Cache key hash: ${hash}, path: ${this.cacheDependencyPath}`);
|
||||
const hash = await glob.hashFiles(this.cacheDependencyPath)
|
||||
|| await glob.hashFiles(this.cacheDependencyBackupPath);
|
||||
core.info(`Cache key hash: ${hash}`);
|
||||
let primaryKey = '';
|
||||
let restoreKey = '';
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue