mirror of
https://code.forgejo.org/actions/setup-python
synced 2025-06-13 14:34:11 +02:00
Add OS info to the error message (#559)
This commit is contained in:
parent
76bbdfadd7
commit
2c3dd9e7e2
5 changed files with 125 additions and 42 deletions
|
@ -7,7 +7,7 @@ import * as path from 'path';
|
|||
import os from 'os';
|
||||
|
||||
import CacheDistributor from './cache-distributor';
|
||||
import {getLinuxOSReleaseInfo, IS_LINUX, IS_WINDOWS} from '../utils';
|
||||
import {getLinuxInfo, IS_LINUX, IS_WINDOWS} from '../utils';
|
||||
|
||||
class PipCache extends CacheDistributor {
|
||||
constructor(
|
||||
|
@ -61,9 +61,9 @@ class PipCache extends CacheDistributor {
|
|||
let restoreKey = '';
|
||||
|
||||
if (IS_LINUX) {
|
||||
const osRelease = await getLinuxOSReleaseInfo();
|
||||
primaryKey = `${this.CACHE_KEY_PREFIX}-${process.env['RUNNER_OS']}-${osRelease}-python-${this.pythonVersion}-${this.packageManager}-${hash}`;
|
||||
restoreKey = `${this.CACHE_KEY_PREFIX}-${process.env['RUNNER_OS']}-${osRelease}-python-${this.pythonVersion}-${this.packageManager}`;
|
||||
const osInfo = await getLinuxInfo();
|
||||
primaryKey = `${this.CACHE_KEY_PREFIX}-${process.env['RUNNER_OS']}-${osInfo.osVersion}-${osInfo.osName}-python-${this.pythonVersion}-${this.packageManager}-${hash}`;
|
||||
restoreKey = `${this.CACHE_KEY_PREFIX}-${process.env['RUNNER_OS']}-${osInfo.osVersion}-${osInfo.osName}-python-${this.pythonVersion}-${this.packageManager}`;
|
||||
} else {
|
||||
primaryKey = `${this.CACHE_KEY_PREFIX}-${process.env['RUNNER_OS']}-python-${this.pythonVersion}-${this.packageManager}-${hash}`;
|
||||
restoreKey = `${this.CACHE_KEY_PREFIX}-${process.env['RUNNER_OS']}-python-${this.pythonVersion}-${this.packageManager}`;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue