mirror of
https://code.forgejo.org/actions/setup-python
synced 2025-06-14 23:14:09 +02:00
Include Python version in pip cache key (#303)
This commit is contained in:
parent
156361d073
commit
ba33a692f1
4 changed files with 13 additions and 13 deletions
|
@ -8,7 +8,10 @@ import os from 'os';
|
|||
import CacheDistributor from './cache-distributor';
|
||||
|
||||
class PipCache extends CacheDistributor {
|
||||
constructor(cacheDependencyPath: string = '**/requirements.txt') {
|
||||
constructor(
|
||||
private pythonVersion: string,
|
||||
cacheDependencyPath: string = '**/requirements.txt'
|
||||
) {
|
||||
super('pip', cacheDependencyPath);
|
||||
}
|
||||
|
||||
|
@ -36,8 +39,8 @@ class PipCache extends CacheDistributor {
|
|||
|
||||
protected async computeKeys() {
|
||||
const hash = await glob.hashFiles(this.cacheDependencyPath);
|
||||
const primaryKey = `${this.CACHE_KEY_PREFIX}-${process.env['RUNNER_OS']}-${this.packageManager}-${hash}`;
|
||||
const restoreKey = `${this.CACHE_KEY_PREFIX}-${process.env['RUNNER_OS']}-${this.packageManager}`;
|
||||
const primaryKey = `${this.CACHE_KEY_PREFIX}-${process.env['RUNNER_OS']}-python-${this.pythonVersion}-${this.packageManager}-${hash}`;
|
||||
const restoreKey = `${this.CACHE_KEY_PREFIX}-${process.env['RUNNER_OS']}-python-${this.pythonVersion}-${this.packageManager}`;
|
||||
|
||||
return {
|
||||
primaryKey,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue