mirror of
https://github.com/actions/setup-python.git
synced 2025-04-24 07:22:14 +00:00
add backup
This commit is contained in:
parent
a04a8ba00a
commit
8644d4cc22
2 changed files with 10 additions and 4 deletions
6
dist/setup/index.js
vendored
6
dist/setup/index.js
vendored
|
@ -65908,6 +65908,7 @@ class PipCache extends cache_distributor_1.default {
|
||||||
constructor(pythonVersion, cacheDependencyPath = '**/requirements.txt') {
|
constructor(pythonVersion, cacheDependencyPath = '**/requirements.txt') {
|
||||||
super('pip', cacheDependencyPath);
|
super('pip', cacheDependencyPath);
|
||||||
this.pythonVersion = pythonVersion;
|
this.pythonVersion = pythonVersion;
|
||||||
|
this.cacheDependencyBackupPath = '**/pyproject.toml';
|
||||||
}
|
}
|
||||||
getCacheGlobalDirectories() {
|
getCacheGlobalDirectories() {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
@ -65943,8 +65944,9 @@ class PipCache extends cache_distributor_1.default {
|
||||||
}
|
}
|
||||||
computeKeys() {
|
computeKeys() {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
const hash = yield glob.hashFiles(this.cacheDependencyPath);
|
const hash = (yield glob.hashFiles(this.cacheDependencyPath))
|
||||||
core.info(`Cache key hash: ${hash}, path: ${this.cacheDependencyPath}`);
|
|| (yield glob.hashFiles(this.cacheDependencyBackupPath));
|
||||||
|
core.info(`Cache key hash: ${hash}`);
|
||||||
let primaryKey = '';
|
let primaryKey = '';
|
||||||
let restoreKey = '';
|
let restoreKey = '';
|
||||||
if (utils_1.IS_LINUX) {
|
if (utils_1.IS_LINUX) {
|
||||||
|
|
|
@ -10,6 +10,9 @@ import CacheDistributor from './cache-distributor';
|
||||||
import {getLinuxInfo, IS_LINUX, IS_WINDOWS} from '../utils';
|
import {getLinuxInfo, IS_LINUX, IS_WINDOWS} from '../utils';
|
||||||
|
|
||||||
class PipCache extends CacheDistributor {
|
class PipCache extends CacheDistributor {
|
||||||
|
|
||||||
|
private readonly cacheDependencyBackupPath: string = '**/pyproject.toml';
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private pythonVersion: string,
|
private pythonVersion: string,
|
||||||
cacheDependencyPath: string = '**/requirements.txt'
|
cacheDependencyPath: string = '**/requirements.txt'
|
||||||
|
@ -56,8 +59,9 @@ class PipCache extends CacheDistributor {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected async computeKeys() {
|
protected async computeKeys() {
|
||||||
const hash = await glob.hashFiles(this.cacheDependencyPath);
|
const hash = await glob.hashFiles(this.cacheDependencyPath)
|
||||||
core.info(`Cache key hash: ${hash}, path: ${this.cacheDependencyPath}`);
|
|| await glob.hashFiles(this.cacheDependencyBackupPath);
|
||||||
|
core.info(`Cache key hash: ${hash}`);
|
||||||
let primaryKey = '';
|
let primaryKey = '';
|
||||||
let restoreKey = '';
|
let restoreKey = '';
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue