Skip to content

Commit 936a967

Browse files
committed
fix: create logging groups around the tools
1 parent 969a124 commit 936a967

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
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/main.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import { setupVCVarsall } from "./vcvarsall/vcvarsall"
3030
import { setupKcov } from "./kcov/kcov"
3131
import { addEnv } from "./utils/env/addEnv"
3232
import { setupSevenZip } from "./sevenzip/sevenzip"
33+
import { endGroup, startGroup } from "@actions/core"
3334

3435
/** The setup functions */
3536
const setups = {
@@ -125,22 +126,23 @@ export async function main(args: string[]): Promise<number> {
125126
// loop over the tools and run their setup function
126127
for (const tool of tools) {
127128
// get the version or "true" or undefined for this tool from the options
128-
const value = opts[tool]
129+
const version = opts[tool]
129130

130131
// skip if undefined
131-
if (value !== undefined) {
132+
if (version !== undefined) {
132133
// running the setup function for this tool
134+
startGroup(`Installing ${tool} ${version}`)
133135
try {
134136
let installationInfo: InstallationInfo | undefined | void
135137
if (tool === "vcvarsall") {
136138
// eslint-disable-next-line no-await-in-loop
137-
setupVCVarsall(getVersion(tool, value), undefined, arch, undefined, undefined, false, false)
139+
setupVCVarsall(getVersion(tool, version), undefined, arch, undefined, undefined, false, false)
138140
} else {
139141
// get the setup function
140142
const setupFunction = setups[tool]
141143

142144
// eslint-disable-next-line no-await-in-loop
143-
installationInfo = await setupFunction(getVersion(tool, value), join(setupCppDir, tool), arch)
145+
installationInfo = await setupFunction(getVersion(tool, version), join(setupCppDir, tool), arch)
144146
}
145147
// preparing a report string
146148
successMessages.push(getSuccessMessage(tool, installationInfo))
@@ -149,6 +151,7 @@ export async function main(args: string[]): Promise<number> {
149151
error(e as string | Error)
150152
errorMessages.push(`${tool} failed to install`)
151153
}
154+
endGroup()
152155
}
153156
}
154157

@@ -159,6 +162,7 @@ export async function main(args: string[]): Promise<number> {
159162
const { compiler, version } = getCompilerInfo(maybeCompiler)
160163

161164
// install the compiler. We allow some aliases for the compiler name
165+
startGroup(`Installing ${compiler} ${version ?? ""}`)
162166
switch (compiler) {
163167
case "llvm":
164168
case "clang":
@@ -198,10 +202,12 @@ export async function main(args: string[]): Promise<number> {
198202
errorMessages.push(`Unsupported compiler ${compiler}`)
199203
}
200204
}
205+
endGroup()
201206
}
202207
} catch (e) {
203208
error(e as string | Error)
204209
errorMessages.push(`Failed to install the ${maybeCompiler}`)
210+
endGroup()
205211
}
206212

207213
if (successMessages.length === 0 && errorMessages.length === 0) {

0 commit comments

Comments
 (0)