setup-cpp/src/python/actions_python.ts

24 lines
869 B
TypeScript
Raw Normal View History

2021-09-20 20:24:17 +08:00
import * as core from "@actions/core"
import * as finder from "setup-python/src/find-python"
import * as finderPyPy from "setup-python/src/find-pypy"
2021-11-22 06:45:35 +08:00
// import * as path from "path"
2021-09-20 20:24:17 +08:00
function isPyPyVersion(versionSpec: string) {
return versionSpec.startsWith("pypy-")
}
export async function setupActionsPython(version: string, _setupDir: string, arch: string) {
2021-09-20 20:24:17 +08:00
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})`)
}
2021-11-22 06:45:35 +08:00
// fails
// core.info(`##[add-matcher]${path.join("./.github", "python.json")}`)
2021-09-20 20:24:17 +08:00
return undefined
}