mirror of https://github.com/aminya/setup-cpp
fix: use system python installation on non-ci
This commit is contained in:
parent
7e5fac5146
commit
d7f2e680b4
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -67,7 +67,7 @@ const inputs: Array<Inputs> = ["compiler", "architecture", ...tools]
|
||||||
|
|
||||||
/** The main entry function */
|
/** The main entry function */
|
||||||
export async function main(args: string[]): Promise<number> {
|
export async function main(args: string[]): Promise<number> {
|
||||||
const isCI = Boolean(process.env.CI)
|
const isCI = process.env.CI === undefined || process.env.CI === "" || process.env.CI === "false"
|
||||||
|
|
||||||
if (!isCI) {
|
if (!isCI) {
|
||||||
process.env.ACTIONS_ALLOW_UNSECURE_COMMANDS = "true"
|
process.env.ACTIONS_ALLOW_UNSECURE_COMMANDS = "true"
|
||||||
|
|
|
@ -14,6 +14,10 @@ function isPyPyVersion(versionSpec: string) {
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function setupPython(version: string, setupCppDir: string, arch: string) {
|
export async function setupPython(version: string, setupCppDir: string, arch: string) {
|
||||||
|
if (process.env.CI === undefined || process.env.CI === "" || process.env.CI === "false") {
|
||||||
|
return setupPythonViaSystem(version, setupCppDir, arch)
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (isPyPyVersion(version)) {
|
if (isPyPyVersion(version)) {
|
||||||
const installed = await finderPyPy.findPyPyVersion(version, arch)
|
const installed = await finderPyPy.findPyPyVersion(version, arch)
|
||||||
|
@ -28,11 +32,11 @@ export async function setupPython(version: string, setupCppDir: string, arch: st
|
||||||
core.info(`##[add-matcher]${path.join(matchersPath, "python.json")}`)
|
core.info(`##[add-matcher]${path.join(matchersPath, "python.json")}`)
|
||||||
return undefined
|
return undefined
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
return setupPythonFallback(version, setupCppDir, arch)
|
return setupPythonViaSystem(version, setupCppDir, arch)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function setupPythonFallback(version: string, setupCppDir: string, arch: string) {
|
export async function setupPythonViaSystem(version: string, setupCppDir: string, arch: string) {
|
||||||
switch (process.platform) {
|
switch (process.platform) {
|
||||||
case "win32": {
|
case "win32": {
|
||||||
// Get an unique output directory name from the URL.
|
// Get an unique output directory name from the URL.
|
||||||
|
|
Loading…
Reference in New Issue