Skip to content

Commit e6efc4a

Browse files
committed
fix: do not create nested logging groups
1 parent 936a967 commit e6efc4a

File tree

7 files changed

+12
-21
lines changed

7 files changed

+12
-21
lines changed

dist/setup_cpp.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/setup_cpp.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/utils/setup/setupAptPack.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* eslint-disable require-atomic-updates */
22
import { InstallationInfo } from "./setupBin"
33
import { execSudo } from "../exec/sudo"
4-
import { endGroup, startGroup } from "@actions/core"
4+
import { info } from "@actions/core"
55

66
let didUpdate: boolean = false
77
let didInit: boolean = false
@@ -12,7 +12,7 @@ export async function setupAptPack(
1212
version?: string,
1313
repositories: boolean | string[] = true
1414
): Promise<InstallationInfo> {
15-
startGroup(`Installing ${name} ${version ?? ""} via apt`)
15+
info(`Installing ${name} ${version ?? ""} via apt`)
1616

1717
const apt = "apt-get"
1818

@@ -58,6 +58,5 @@ export async function setupAptPack(
5858
await execSudo(apt, ["install", "--fix-broken", "-y", name])
5959
}
6060

61-
endGroup()
6261
return { binDir: "/usr/bin/" }
6362
}

src/utils/setup/setupBin.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { find, downloadTool, cacheDir } from "@actions/tool-cache"
2-
import { endGroup, info, startGroup } from "@actions/core"
2+
import { info } from "@actions/core"
33
import { addPath } from "../path/addPath"
44
import { join } from "path"
55
import { existsSync } from "fs"
@@ -45,7 +45,7 @@ export async function setupBin(
4545
setupDir: string,
4646
arch: string
4747
): Promise<InstallationInfo> {
48-
startGroup(`Installing ${name} ${version} ${arch} via direct downloading`)
48+
info(`Installing ${name} ${version} ${arch} via direct downloading`)
4949

5050
process.env.RUNNER_TEMP = process.env.RUNNER_TEMP ?? tmpdir()
5151
process.env.RUNNER_TOOL_CACHE = process.env.RUNNER_TOOL_CACHE ?? join(tmpdir(), "setup-cpp", "hostedtoolcache")
@@ -67,7 +67,6 @@ export async function setupBin(
6767
info(`${name} ${version} was found in the cache at ${binDir}.`)
6868
addPath(binDir)
6969

70-
endGroup()
7170
return { installDir, binDir }
7271
}
7372
}
@@ -95,7 +94,6 @@ export async function setupBin(
9594
const downloaded = await downloadTool(url)
9695
await extractFunction?.(downloaded, setupDir)
9796
} catch (err) {
98-
endGroup()
9997
throw new Error(`Failed to download ${name} ${version} ${arch}: ${err}`)
10098
}
10199
}
@@ -110,6 +108,5 @@ export async function setupBin(
110108
await cacheDir(setupDir, name, version)
111109
}
112110

113-
endGroup()
114111
return { installDir, binDir }
115112
}

src/utils/setup/setupBrewPack.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* eslint-disable require-atomic-updates */
2-
import { endGroup, startGroup } from "@actions/core"
2+
import { info } from "@actions/core"
33
import execa from "execa"
44
import which from "which"
55
import { setupBrew } from "../../brew/brew"
@@ -9,7 +9,7 @@ let hasBrew = false
99

1010
/** A function that installs a package using brew */
1111
export function setupBrewPack(name: string, version?: string): InstallationInfo {
12-
startGroup(`Installing ${name} ${version ?? ""} via brew`)
12+
info(`Installing ${name} ${version ?? ""} via brew`)
1313

1414
if (!hasBrew || which.sync("brew", { nothrow: true }) === null) {
1515
setupBrew("", "", process.arch)
@@ -21,6 +21,5 @@ export function setupBrewPack(name: string, version?: string): InstallationInfo
2121
stdio: "inherit",
2222
})
2323

24-
endGroup()
2524
return { binDir: "/usr/local/bin/" }
2625
}

src/utils/setup/setupChocoPack.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ import which from "which"
44
import { setupChocolatey } from "../../chocolatey/chocolatey"
55
import { InstallationInfo } from "./setupBin"
66
import execa from "execa"
7-
import { endGroup, startGroup } from "@actions/core"
7+
import { info } from "@actions/core"
88

99
let hasChoco = false
1010

1111
/** A function that installs a package using choco */
1212
export function setupChocoPack(name: string, version?: string, args: string[] = []): InstallationInfo {
13-
startGroup(`Installing ${name} ${version ?? ""} via chocolatey`)
13+
info(`Installing ${name} ${version ?? ""} via chocolatey`)
1414

1515
if (!hasChoco || which.sync("choco", { nothrow: true }) === null) {
1616
setupChocolatey("", "", process.arch)
@@ -38,6 +38,5 @@ export function setupChocoPack(name: string, version?: string, args: string[] =
3838
const binDir = `${process.env.ChocolateyInstall ?? "C:/ProgramData/chocolatey"}/bin`
3939
addPath(binDir)
4040

41-
endGroup()
4241
return { binDir }
4342
}

src/utils/setup/setupPipPack.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import { getExecOutput } from "@actions/exec"
33
import execa from "execa"
44
import which from "which"
5-
import { endGroup, info, startGroup } from "@actions/core"
5+
import { info } from "@actions/core"
66
import { addPath } from "../path/addPath"
77
import { setupPython } from "../../python/python"
88
import { isBinUptoDate } from "./version"
@@ -17,7 +17,7 @@ let tried = false
1717

1818
/** A function that installs a package using pip */
1919
export async function setupPipPack(name: string, version?: string): Promise<InstallationInfo> {
20-
startGroup(`Installing ${name} ${version ?? ""} via pip`)
20+
info(`Installing ${name} ${version ?? ""} via pip`)
2121

2222
// setup python and pip if needed
2323
if (python === undefined) {
@@ -30,11 +30,9 @@ export async function setupPipPack(name: string, version?: string): Promise<Inst
3030
await setupPython(getVersion("python", undefined), "", process.arch)
3131
// try again
3232
if (tried) {
33-
endGroup()
3433
throw new Error("Failed to install python")
3534
}
3635
tried = true
37-
endGroup()
3836
return setupPipPack(name, version)
3937
}
4038
}
@@ -70,6 +68,5 @@ export async function setupPipPack(name: string, version?: string): Promise<Inst
7068
addPath(binDir)
7169
}
7270

73-
endGroup()
7471
return { binDir }
7572
}

0 commit comments

Comments
 (0)