test: run setupActionsPython directly

This commit is contained in:
Amin Yahyaabadi 2022-07-05 21:56:30 -07:00
parent ae4effdd67
commit 2c1f704299
6 changed files with 10 additions and 10 deletions

2
dist/setup_cpp.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

2
dist/setup_cpp.mjs vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -3,6 +3,7 @@ import { cleanupTmpDir, setupTmpDir, testBin } from "../../utils/tests/test-help
import { getVersion } from "../../default_versions" import { getVersion } from "../../default_versions"
import { ubuntuVersion } from "../../utils/env/ubuntu_version" import { ubuntuVersion } from "../../utils/env/ubuntu_version"
import { isGitHubCI } from "../../utils/env/isci" import { isGitHubCI } from "../../utils/env/isci"
import { info } from "../../utils/io/io"
jest.setTimeout(300000) jest.setTimeout(300000)
describe("setup-python", () => { describe("setup-python", () => {
@ -13,13 +14,11 @@ describe("setup-python", () => {
it("should setup python in GitHub Actions", async () => { it("should setup python in GitHub Actions", async () => {
if (isGitHubCI()) { if (isGitHubCI()) {
const installInfo = await setupPython( info("Installing python in GitHub Actions")
getVersion("python", "true", await ubuntuVersion()), const { setupActionsPython } = await import("../actions_python")
directory, await setupActionsPython(getVersion("python", "true", await ubuntuVersion()), directory, process.arch)
process.arch
)
await testBin("python", ["--version"], installInfo?.binDir) await testBin("python", ["--version"])
} }
}) })

View File

@ -16,6 +16,7 @@ export async function setupPython(version: string, setupDir: string, arch: strin
return setupPythonViaSystem(version, setupDir, arch) return setupPythonViaSystem(version, setupDir, arch)
} }
try { try {
info("Installing python in GitHub Actions")
const { setupActionsPython } = await import("./actions_python") const { setupActionsPython } = await import("./actions_python")
return setupActionsPython(version, setupDir, arch) return setupActionsPython(version, setupDir, arch)
} catch (err) { } catch (err) {