add check-latest for pypy

This commit is contained in:
Dmitry Shibanov 2022-05-06 09:50:12 +02:00
parent 58a8109aea
commit 8723b8aa5a
8 changed files with 165 additions and 31 deletions

View file

@ -34,17 +34,18 @@ async function run() {
}
try {
const version = core.getInput('python-version');
const checkLatest = core.getBooleanInput('check-latest');
if (version) {
let pythonVersion: string;
const arch: string = core.getInput('architecture') || os.arch();
if (isPyPyVersion(version)) {
const installed = await finderPyPy.findPyPyVersion(version, arch);
const installed = await finderPyPy.findPyPyVersion(version, arch, checkLatest);
pythonVersion = `${installed.resolvedPyPyVersion}-${installed.resolvedPythonVersion}`;
core.info(
`Successfully set up PyPy ${installed.resolvedPyPyVersion} with Python (${installed.resolvedPythonVersion})`
);
} else {
const installed = await finder.useCpythonVersion(version, arch);
const installed = await finder.useCpythonVersion(version, arch, checkLatest);
pythonVersion = installed.version;
core.info(`Successfully set up ${installed.impl} (${pythonVersion})`);
}