resolving comments

This commit is contained in:
Dmitry Shibanov 2021-11-15 13:31:32 +03:00
parent 07c09af2d5
commit 1918fc78fb
7 changed files with 42 additions and 36 deletions

View file

@ -10,21 +10,18 @@ function isPyPyVersion(versionSpec: string) {
return versionSpec.startsWith('pypy-');
}
async function cacheDepencies(pythonVersion: string) {
const cache = core.getInput('cache');
if (cache) {
if (isGhes()) {
throw new Error('Caching is not supported on GHES');
}
const cacheDependencyPath =
core.getInput('cache-dependency-path') || undefined;
const cacheDistributor = getCacheDistributor(
cache,
pythonVersion,
cacheDependencyPath
);
await cacheDistributor.restoreCache();
async function cacheDepencies(cache: string, pythonVersion: string) {
if (isGhes()) {
throw new Error('Caching is not supported on GHES');
}
const cacheDependencyPath =
core.getInput('cache-dependency-path') || undefined;
const cacheDistributor = getCacheDistributor(
cache,
pythonVersion,
cacheDependencyPath
);
await cacheDistributor.restoreCache();
}
async function run() {
@ -45,7 +42,10 @@ async function run() {
core.info(`Successfully setup ${installed.impl} (${pythonVersion})`);
}
await cacheDepencies(pythonVersion);
const cache = core.getInput('cache');
if (cache) {
await cacheDepencies(cache, pythonVersion);
}
}
const matchersPath = path.join(__dirname, '../..', '.github');
core.info(`##[add-matcher]${path.join(matchersPath, 'python.json')}`);