Adding support for more PyPy versions and installing them on-flight (#168)

* add support to install pypy

* resolved comments, update readme, add e2e tests.

* resolve throw error

* Add pypy unit tests to cover code

* add tests

* Update test-pypy.yml

* Update test-python.yml

* Update test-python.yml

* Update README.md

* fixing tests

* change order

Co-authored-by: Maxim Lobanov <v-malob@microsoft.com>

* add pypy tests and fix issue with pypy-3-nightly

Co-authored-by: Maxim Lobanov <v-malob@microsoft.com>
This commit is contained in:
Dmitry Shibanov
2020-12-17 18:03:54 +03:00
committed by GitHub
parent 2831efe49a
commit 8c5ea631b2
14 changed files with 1896 additions and 34 deletions

View File

@ -1,15 +1,29 @@
import * as core from '@actions/core';
import * as finder from './find-python';
import * as finderPyPy from './find-pypy';
import * as path from 'path';
import * as os from 'os';
function isPyPyVersion(versionSpec: string) {
return versionSpec.startsWith('pypy-');
}
async function run() {
try {
let version = core.getInput('python-version');
if (version) {
const arch: string = core.getInput('architecture') || os.arch();
const installed = await finder.findPythonVersion(version, arch);
core.info(`Successfully setup ${installed.impl} (${installed.version})`);
if (isPyPyVersion(version)) {
const installed = await finderPyPy.findPyPyVersion(version, arch);
core.info(
`Successfully setup PyPy ${installed.resolvedPyPyVersion} with Python (${installed.resolvedPythonVersion})`
);
} else {
const installed = await finder.findPythonVersion(version, arch);
core.info(
`Successfully setup ${installed.impl} (${installed.version})`
);
}
}
const matchersPath = path.join(__dirname, '..', '.github');
core.info(`##[add-matcher]${path.join(matchersPath, 'python.json')}`);