fix: add .local/bin to path inside setupPip

This commit is contained in:
Amin Yahyaabadi 2021-09-14 14:52:17 -05:00
parent 9d9f62c579
commit 3defe39318
4 changed files with 10 additions and 30 deletions

View File

@ -1,15 +1,5 @@
import { setupPip } from "../utils/setup/setupPip" import { setupPip } from "../utils/setup/setupPip"
import { addPath, startGroup, endGroup } from "@actions/core"
export async function setupConan(version?: string) { export async function setupConan(version?: string) {
await setupPip("conan", version) await setupPip("conan", version)
if (process.platform === "linux") {
try {
startGroup(`Add /home/runner/.local/bin to PATH`)
addPath("/home/runner/.local/bin/")
} finally {
endGroup()
}
}
} }

View File

@ -1,15 +1,5 @@
import { setupPip } from "../utils/setup/setupPip" import { setupPip } from "../utils/setup/setupPip"
import { addPath, startGroup, endGroup } from "@actions/core"
export async function setupGcovr(version?: string) { export async function setupGcovr(version?: string) {
await setupPip("gcovr", version) await setupPip("gcovr", version)
if (process.platform === "linux") {
try {
startGroup(`Add /home/runner/.local/bin to PATH`)
addPath("/home/runner/.local/bin/")
} finally {
endGroup()
}
}
} }

View File

@ -1,15 +1,5 @@
import { setupPip } from "../utils/setup/setupPip" import { setupPip } from "../utils/setup/setupPip"
import { addPath, startGroup, endGroup } from "@actions/core"
export async function setupMeson(version?: string) { export async function setupMeson(version?: string) {
await setupPip("meson", version) await setupPip("meson", version)
if (process.platform === "linux") {
try {
startGroup(`Add /home/runner/.local/bin to PATH`)
addPath("/home/runner/.local/bin/")
} finally {
endGroup()
}
}
} }

View File

@ -1,5 +1,6 @@
import { exec } from "@actions/exec" import { exec } from "@actions/exec"
import which from "which" import which from "which"
import { addPath, startGroup, endGroup } from "@actions/core"
/** A function that installs a package using pip */ /** A function that installs a package using pip */
export async function setupPip(name: string, version?: string) { export async function setupPip(name: string, version?: string) {
@ -10,4 +11,13 @@ export async function setupPip(name: string, version?: string) {
if (exit !== 0) { if (exit !== 0) {
throw new Error(`Failed to install ${name} ${version}`) throw new Error(`Failed to install ${name} ${version}`)
} }
if (process.platform === "linux") {
try {
startGroup(`Add /home/runner/.local/bin to PATH`)
addPath("/home/runner/.local/bin/")
} finally {
endGroup()
}
}
} }