Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions .terserrc.mjs

This file was deleted.

19 changes: 19 additions & 0 deletions dist/legacy/assets/actions_python-B0U177DM.js

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions dist/legacy/assets/actions_python-cP6XyATB.js

This file was deleted.

7 changes: 7 additions & 0 deletions dist/legacy/assets/index-CyGoLSfE.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/legacy/assets/index-CyGoLSfE.js.map

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions dist/legacy/assets/index-DQhYd68F.js

This file was deleted.

1 change: 0 additions & 1 deletion dist/legacy/assets/index-DQhYd68F.js.map

This file was deleted.

2 changes: 0 additions & 2 deletions dist/legacy/assets/proxy-agent-CJlHwNWW.js

This file was deleted.

1 change: 0 additions & 1 deletion dist/legacy/assets/proxy-agent-CJlHwNWW.js.map

This file was deleted.

56 changes: 56 additions & 0 deletions dist/legacy/assets/proxy-agent-DrLNheMy.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/legacy/assets/proxy-agent-DrLNheMy.js.map

Large diffs are not rendered by default.

80 changes: 79 additions & 1 deletion dist/legacy/setup-cpp.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/legacy/setup-cpp.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/legacy/versions.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"ninja":"1.12.1","cmake":"3.31.7","task":"3.43.3","powershell":"7.5.1","pip":">=22.2.0","python":">=3.7.9","meson":{"linux":{"ubuntu":{"20":"1.8.1","18":"0.61.4","else":"0.61.4"},"else":"1.8.1"},"else":"1.8.1"},"kcov":{"linux":{"ubuntu":{"22":"42-binary","20":"40-binary","14":"40","else":"42"},"else":"42"},"else":"42"},"doxygen":{"linux":{"archlinux":"1.13.2-2","ubuntu":{"22":"1.14.0","18":"1.10.0","else":"1.10.0"},"else":"1.14.0"},"else":"1.14.0"},"gcc":{"win32":"15.1.0posix-12.0.0-ucrt-r1","else":""},"mingw":{"win32":"15.1.0posix-12.0.0-ucrt-r1","else":""},"gcovr":{"linux":{"ubuntu":{"20":"","18":"5.0","else":"5.0"},"else":""},"else":""},"nala":{"linux":{"ubuntu":{"22":"","21":"legacy","else":"legacy"},"else":""},"else":""},"llvm":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"20.1.4"}}},"linux":{"alpine":{"else":{"else":"19.1.7"}},"else":"20.1.6"},"else":"20.1.6"},"clang":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"20.1.4"}}},"linux":{"alpine":{"else":{"else":"19.1.7"}},"else":"20.1.6"},"else":"20.1.6"},"clang++":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"20.1.4"}}},"linux":{"alpine":{"else":{"else":"19.1.7"}},"else":"20.1.6"},"else":"20.1.6"},"clang-tidy":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"20.1.4"}}},"linux":{"alpine":{"else":{"else":"19.1.7"}},"else":"20.1.6"},"else":"20.1.6"},"clangtidy":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"20.1.4"}}},"linux":{"alpine":{"else":{"else":"19.1.7"}},"else":"20.1.6"},"else":"20.1.6"},"clang-format":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"20.1.4"}}},"linux":{"alpine":{"else":{"else":"19.1.7"}},"else":"20.1.6"},"else":"20.1.6"},"clangformat":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"20.1.4"}}},"linux":{"alpine":{"else":{"else":"19.1.7"}},"else":"20.1.6"},"else":"20.1.6"}}
{"ninja":"1.12.1","cmake":"3.31.7","task":"3.43.3","powershell":"7.5.1","pip":">=22.2.0","python":">=3.7.9","meson":{"linux":{"ubuntu":{"20":"1.8.1","18":"0.61.4","else":"0.61.4"},"else":"1.8.1"},"else":"1.8.1"},"kcov":{"linux":{"ubuntu":{"22":"42-binary","20":"40-binary","14":"40","else":"42"},"else":"42"},"else":"42"},"doxygen":{"linux":{"archlinux":"1.13.2-2","ubuntu":{"22":"1.14.0","18":"1.10.0","else":"1.10.0"},"else":"1.14.0"},"else":"1.14.0"},"tar":{"win32":"1.13-1","else":""},"gcc":{"win32":"15.1.0posix-12.0.0-ucrt-r1","else":""},"mingw":{"win32":"15.1.0posix-12.0.0-ucrt-r1","else":""},"gcovr":{"linux":{"ubuntu":{"20":"","18":"5.0","else":"5.0"},"else":""},"else":""},"nala":{"linux":{"ubuntu":{"22":"","21":"legacy","else":"legacy"},"else":""},"else":""},"llvm":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"20.1.4"}}},"linux":{"alpine":{"else":{"else":"19.1.7"}},"else":"20.1.6"},"else":"20.1.6"},"clang":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"20.1.4"}}},"linux":{"alpine":{"else":{"else":"19.1.7"}},"else":"20.1.6"},"else":"20.1.6"},"clang++":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"20.1.4"}}},"linux":{"alpine":{"else":{"else":"19.1.7"}},"else":"20.1.6"},"else":"20.1.6"},"clang-tidy":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"20.1.4"}}},"linux":{"alpine":{"else":{"else":"19.1.7"}},"else":"20.1.6"},"else":"20.1.6"},"clangtidy":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"20.1.4"}}},"linux":{"alpine":{"else":{"else":"19.1.7"}},"else":"20.1.6"},"else":"20.1.6"},"clang-format":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"20.1.4"}}},"linux":{"alpine":{"else":{"else":"19.1.7"}},"else":"20.1.6"},"else":"20.1.6"},"clangformat":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"20.1.4"}}},"linux":{"alpine":{"else":{"else":"19.1.7"}},"else":"20.1.6"},"else":"20.1.6"}}
2 changes: 0 additions & 2 deletions dist/modern/assets/actions_python-Bt6qyET-.mjs

This file was deleted.

19 changes: 19 additions & 0 deletions dist/modern/assets/actions_python-Yx_U9Uwm.mjs

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions dist/modern/assets/index-B-SdbTWZ.mjs

This file was deleted.

1 change: 0 additions & 1 deletion dist/modern/assets/index-B-SdbTWZ.mjs.map

This file was deleted.

7 changes: 7 additions & 0 deletions dist/modern/assets/index-CkjZCcSz.mjs

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/modern/assets/index-CkjZCcSz.mjs.map

Large diffs are not rendered by default.

50 changes: 50 additions & 0 deletions dist/modern/assets/proxy-agent-DbKVJOmt.mjs

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/modern/assets/proxy-agent-DbKVJOmt.mjs.map

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions dist/modern/assets/proxy-agent-NZ7dghMl.mjs

This file was deleted.

1 change: 0 additions & 1 deletion dist/modern/assets/proxy-agent-NZ7dghMl.mjs.map

This file was deleted.

80 changes: 79 additions & 1 deletion dist/modern/setup-cpp.mjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/modern/setup-cpp.mjs.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/modern/versions.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"ninja":"1.12.1","cmake":"3.31.7","task":"3.43.3","powershell":"7.5.1","pip":">=22.2.0","python":">=3.7.9","meson":{"linux":{"ubuntu":{"20":"1.8.1","18":"0.61.4","else":"0.61.4"},"else":"1.8.1"},"else":"1.8.1"},"kcov":{"linux":{"ubuntu":{"22":"42-binary","20":"40-binary","14":"40","else":"42"},"else":"42"},"else":"42"},"doxygen":{"linux":{"archlinux":"1.13.2-2","ubuntu":{"22":"1.14.0","18":"1.10.0","else":"1.10.0"},"else":"1.14.0"},"else":"1.14.0"},"gcc":{"win32":"15.1.0posix-12.0.0-ucrt-r1","else":""},"mingw":{"win32":"15.1.0posix-12.0.0-ucrt-r1","else":""},"gcovr":{"linux":{"ubuntu":{"20":"","18":"5.0","else":"5.0"},"else":""},"else":""},"nala":{"linux":{"ubuntu":{"22":"","21":"legacy","else":"legacy"},"else":""},"else":""},"llvm":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"20.1.4"}}},"linux":{"alpine":{"else":{"else":"19.1.7"}},"else":"20.1.6"},"else":"20.1.6"},"clang":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"20.1.4"}}},"linux":{"alpine":{"else":{"else":"19.1.7"}},"else":"20.1.6"},"else":"20.1.6"},"clang++":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"20.1.4"}}},"linux":{"alpine":{"else":{"else":"19.1.7"}},"else":"20.1.6"},"else":"20.1.6"},"clang-tidy":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"20.1.4"}}},"linux":{"alpine":{"else":{"else":"19.1.7"}},"else":"20.1.6"},"else":"20.1.6"},"clangtidy":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"20.1.4"}}},"linux":{"alpine":{"else":{"else":"19.1.7"}},"else":"20.1.6"},"else":"20.1.6"},"clang-format":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"20.1.4"}}},"linux":{"alpine":{"else":{"else":"19.1.7"}},"else":"20.1.6"},"else":"20.1.6"},"clangformat":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"20.1.4"}}},"linux":{"alpine":{"else":{"else":"19.1.7"}},"else":"20.1.6"},"else":"20.1.6"}}
{"ninja":"1.12.1","cmake":"3.31.7","task":"3.43.3","powershell":"7.5.1","pip":">=22.2.0","python":">=3.7.9","meson":{"linux":{"ubuntu":{"20":"1.8.1","18":"0.61.4","else":"0.61.4"},"else":"1.8.1"},"else":"1.8.1"},"kcov":{"linux":{"ubuntu":{"22":"42-binary","20":"40-binary","14":"40","else":"42"},"else":"42"},"else":"42"},"doxygen":{"linux":{"archlinux":"1.13.2-2","ubuntu":{"22":"1.14.0","18":"1.10.0","else":"1.10.0"},"else":"1.14.0"},"else":"1.14.0"},"tar":{"win32":"1.13-1","else":""},"gcc":{"win32":"15.1.0posix-12.0.0-ucrt-r1","else":""},"mingw":{"win32":"15.1.0posix-12.0.0-ucrt-r1","else":""},"gcovr":{"linux":{"ubuntu":{"20":"","18":"5.0","else":"5.0"},"else":""},"else":""},"nala":{"linux":{"ubuntu":{"22":"","21":"legacy","else":"legacy"},"else":""},"else":""},"llvm":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"20.1.4"}}},"linux":{"alpine":{"else":{"else":"19.1.7"}},"else":"20.1.6"},"else":"20.1.6"},"clang":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"20.1.4"}}},"linux":{"alpine":{"else":{"else":"19.1.7"}},"else":"20.1.6"},"else":"20.1.6"},"clang++":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"20.1.4"}}},"linux":{"alpine":{"else":{"else":"19.1.7"}},"else":"20.1.6"},"else":"20.1.6"},"clang-tidy":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"20.1.4"}}},"linux":{"alpine":{"else":{"else":"19.1.7"}},"else":"20.1.6"},"else":"20.1.6"},"clangtidy":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"20.1.4"}}},"linux":{"alpine":{"else":{"else":"19.1.7"}},"else":"20.1.6"},"else":"20.1.6"},"clang-format":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"20.1.4"}}},"linux":{"alpine":{"else":{"else":"19.1.7"}},"else":"20.1.6"},"else":"20.1.6"},"clangformat":{"darwin":{"else":{"else":{"x64":"15.0.7","else":"20.1.4"}}},"linux":{"alpine":{"else":{"else":"19.1.7"}},"else":"20.1.6"},"else":"20.1.6"}}
3 changes: 0 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,6 @@
"setup-python": "github:aminya/setup-python#9700887",
"shx": "0.4.0",
"simple-update-notifier": "^2.0.0",
"terser": "^5.39.0",
"terser-config-atomic": "^1.0.0",
"time-delta": "github:aminya/time-delta#69d91a4",
"timers-browserify": "^2.0.12",
"ts-node": "^10.9.2",
Expand Down Expand Up @@ -178,7 +176,6 @@
"setup-alpine",
"setup-brew",
"setup-python",
"simple-update-notifier",
"time-delta",
"ubuntu-version",
"untildify-user",
Expand Down
8 changes: 7 additions & 1 deletion packages/setup-apt/src/nala.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@ import { qualifiedNeededAptPackage } from "./qualify-install.js"

let binDir: string | undefined

export async function setupNala(version?: string) {
export type SetupOptions = {
version: string
setupDir: string
arch: string
}

export async function setupNala({ version }: Partial<Pick<SetupOptions, "version">> = {}) {
if (!hasAptGet()) {
return undefined
}
Expand Down
17 changes: 5 additions & 12 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions src/actions-input.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { getInput } from "@actions/core"

/** Get an object from github actions */

export function maybeGetInput(key: string) {
const value = getInput(key.toLowerCase())
if (value !== "false" && value !== "") {
return value
}
return undefined // skip installation
}
2 changes: 1 addition & 1 deletion src/bazel/__tests__/bazel.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ describe("setup-bazel", () => {
return
}
it("should setup bazel", async () => {
const installInfo = await setupBazel("", "", process.arch)
const installInfo = await setupBazel()

await testBin("bazel", ["--version"], (installInfo as InstallationInfo | undefined)?.binDir)
})
Expand Down
4 changes: 2 additions & 2 deletions src/bazel/bazel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ import { execRoot } from "admina"
import { hasApk, installApkPack } from "setup-alpine"
import { addAptKeyViaURL, hasAptGet, installAptPack } from "setup-apt"
import { installBrewPack } from "setup-brew"
import type { SetupOptions } from "../setup-options.js"
import { getDebArch } from "../utils/env/arch.js"
import { hasDnf } from "../utils/env/hasDnf.js"
import { isArch } from "../utils/env/isArch.js"
import { setupChocoPack } from "../utils/setup/setupChocoPack.js"
import { setupDnfPack } from "../utils/setup/setupDnfPack.js"

// eslint-disable-next-line @typescript-eslint/no-unused-vars
export async function setupBazel(version: string, _setupDir: string, _arch: string) {
export async function setupBazel({ version }: Partial<Pick<SetupOptions, "version">> = {}) {
switch (process.platform) {
case "win32": {
// install bazelisk because it contains both
Expand Down
2 changes: 1 addition & 1 deletion src/ccache/__tests__/ccache.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { setupCcache } from "../ccache.js"
jest.setTimeout(300000)
describe("setup-ccache", () => {
it("should setup ccache", async () => {
const installInfo = await setupCcache("", "", process.arch)
const installInfo = await setupCcache()

await testBin("ccache", ["--version"], (installInfo as InstallationInfo | undefined)?.binDir)
})
Expand Down
4 changes: 2 additions & 2 deletions src/ccache/ccache.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { hasApk, installApkPack } from "setup-alpine"
import { hasAptGet, installAptPack } from "setup-apt"
import { installBrewPack } from "setup-brew"
import type { SetupOptions } from "../setup-options.js"
import { hasDnf } from "../utils/env/hasDnf.js"
import { isArch } from "../utils/env/isArch.js"
import { setupChocoPack } from "../utils/setup/setupChocoPack.js"
import { setupDnfPack } from "../utils/setup/setupDnfPack.js"
import { setupPacmanPack } from "../utils/setup/setupPacmanPack.js"

// eslint-disable-next-line @typescript-eslint/no-unused-vars
export async function setupCcache(version: string, _setupDir: string, _arch: string) {
export async function setupCcache({ version }: Partial<Pick<SetupOptions, "version">> = {}) {
switch (process.platform) {
case "win32": {
return setupChocoPack("ccache", version)
Expand Down
2 changes: 1 addition & 1 deletion src/chocolatey/__tests__/chocolatey.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ describe("setup-chocolatey", () => {
return
}
it("should setup chocolatey", async () => {
const { binDir } = (await setupChocolatey("", "", process.arch)) as InstallationInfo
const { binDir } = (await setupChocolatey({ version: "", setupDir: "", arch: process.arch })) as InstallationInfo
await testBin("choco", ["--version"], binDir)
})
})
10 changes: 2 additions & 8 deletions src/chocolatey/chocolatey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,13 @@ import { execaSync } from "execa"
import { pathExists } from "path-exists"
import which from "which"
import { rcOptions } from "../options.js"
import type { SetupOptions } from "../setup-options.js"
import type { InstallationInfo } from "../utils/setup/setupBin.js"

/* eslint-disable require-atomic-updates */
let binDir: string | undefined

export async function setupChocolatey(
// eslint-disable-next-line @typescript-eslint/no-unused-vars
_version: string,
// eslint-disable-next-line @typescript-eslint/no-unused-vars
_setupDir: string,
// eslint-disable-next-line @typescript-eslint/no-unused-vars
_arch: string,
): Promise<InstallationInfo | undefined> {
export async function setupChocolatey(_opts?: SetupOptions): Promise<InstallationInfo | undefined> {
if (process.platform !== "win32") {
return undefined
}
Expand Down
12 changes: 10 additions & 2 deletions src/cmake/__tests__/cmake.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,20 @@ describe("setup-cmake", () => {
})

it("should setup CMake", async () => {
const { binDir } = await setupCmake(getVersion("cmake", "true"), directory, process.arch)
const { binDir } = await setupCmake({
version: getVersion("cmake", "true"),
setupDir: directory,
arch: process.arch,
})
await testBin("cmake", ["--version"], binDir)
})

it("should find CMake in the cache", async () => {
const { binDir } = await setupCmake(getVersion("cmake", "true"), directory, process.arch)
const { binDir } = await setupCmake({
version: getVersion("cmake", "true"),
setupDir: directory,
arch: process.arch,
})
await testBin("cmake", ["--version"], binDir)
if (GITHUB_ACTIONS) {
expect(binDir).toMatch(process.env.RUNNER_TOOL_CACHE ?? "hostedtoolcache")
Expand Down
3 changes: 2 additions & 1 deletion src/cmake/cmake.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { info } from "ci-log"
import { addExeExt } from "patha"
import semverLte from "semver/functions/lte"
import { hasApk, installApkPack } from "setup-alpine"
import type { SetupOptions } from "../setup-options.js"
import { arm64, x86, x86_64 } from "../utils/env/arch.js"
import { type InstallationInfo, type PackageInfo, setupBin } from "../utils/setup/setupBin.js"
import { semverCoerceIfInvalid } from "../utils/setup/version.js"
Expand Down Expand Up @@ -67,7 +68,7 @@ function getCmakePackageInfo(version: string, platform: NodeJS.Platform, arch: s
}

/** Setup cmake */
export async function setupCmake(version: string, setupDir: string, arch: string): Promise<InstallationInfo> {
export async function setupCmake({ version, setupDir, arch }: SetupOptions): Promise<InstallationInfo> {
if (await hasApk()) {
return installApkPack([
{
Expand Down
4 changes: 3 additions & 1 deletion src/cmakelang/__tests__/cmakelang.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ import { setupCmakelang } from "../cmakelang.js"
jest.setTimeout(300000)
describe("setup-cmakelang", () => {
it("should setup cmakelang", async () => {
const installInfo = await setupCmakelang(getVersion("cmakelang", "true", await ubuntuVersion()), "", process.arch)
const installInfo = await setupCmakelang({
version: getVersion("cmakelang", "true", await ubuntuVersion()),
})
await testBin("cmake-lint", ["--version"], installInfo.binDir)
await testBin("cmake-format", ["--version"], installInfo.binDir)
})
Expand Down
4 changes: 2 additions & 2 deletions src/cmakelang/cmakelang.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { SetupOptions } from "../setup-options.js"
import { setupPipPack } from "../utils/setup/setupPipPack.js"

// eslint-disable-next-line @typescript-eslint/no-unused-vars
export function setupCmakelang(version: string | undefined, _setupDir: string, _arch: string) {
export function setupCmakelang({ version }: Partial<Pick<SetupOptions, "version">> = {}) {
return setupPipPack("cmakelang[YAML]", version)
}
22 changes: 11 additions & 11 deletions src/compilers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import semverValid from "semver/functions/valid"
import { setupGcc } from "./gcc/gcc.js"
import { setupMingw } from "./gcc/mingw.js"
import { activateGcovGCC, activateGcovLLVM } from "./gcovr/gcovr.js"
import { getSuccessMessage } from "./installTool.js"
import { setupAppleClang } from "./llvm/apple-clang.js"
import { setupLLVM } from "./llvm/llvm.js"
import { setupMSVC } from "./msvc/msvc.js"
import { getSuccessMessage } from "./options.js"
import { appleClangSetups, gccSetups, llvmSetups, mingwSetups, msvcSetups } from "./tool.js"
import type { InstallationInfo } from "./utils/setup/setupBin.js"
import { getVersion } from "./versions/versions.js"
Expand Down Expand Up @@ -74,26 +74,26 @@ export async function installCompiler(
// install the compiler. We allow some aliases for the compiler name
startGroup(`Installing ${compiler} ${version ?? ""}`)
if (compiler in llvmSetups) {
installationInfo = await setupLLVM(
getVersion("llvm", version, osVersion),
join(setupCppDir, "llvm"),
installationInfo = await setupLLVM({
version: getVersion("llvm", version, osVersion),
setupDir: join(setupCppDir, "llvm"),
arch,
)
})
await activateGcovLLVM()
} else if (compiler in gccSetups) {
const gccVersion = getVersion("gcc", version, osVersion)
installationInfo = await setupGcc(gccVersion, join(setupCppDir, "gcc"), arch)
installationInfo = await setupGcc({ version: gccVersion, setupDir: join(setupCppDir, "gcc"), arch })
await activateGcovGCC(gccVersion)
} else if (compiler in mingwSetups) {
const gccVersion = getVersion("mingw", version, osVersion)
installationInfo = await setupMingw(gccVersion, join(setupCppDir, "gcc"), arch)
installationInfo = await setupMingw({ version: gccVersion, setupDir: join(setupCppDir, "gcc"), arch })
await activateGcovGCC(gccVersion)
} else if (compiler in msvcSetups) {
installationInfo = await setupMSVC(
getVersion("msvc", version, osVersion),
join(setupCppDir, "msvc"),
installationInfo = await setupMSVC({
version: getVersion("msvc", version, osVersion),
setupDir: join(setupCppDir, "msvc"),
arch,
)
})
} else if (compiler in appleClangSetups) {
await setupAppleClang()
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/conan/__tests__/conan.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { setupConan } from "../conan.js"
jest.setTimeout(300000)
describe("setup-conan", () => {
it("should setup conan", async () => {
const installInfo = await setupConan(getVersion("conan", "true"), "", process.arch)
const installInfo = await setupConan({ version: getVersion("conan", "true") })

await testBin("conan", ["--version"], installInfo.binDir)
})
Expand Down
4 changes: 2 additions & 2 deletions src/conan/conan.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { SetupOptions } from "../setup-options.js"
import { setupPipPack } from "../utils/setup/setupPipPack.js"

// eslint-disable-next-line @typescript-eslint/no-unused-vars
export function setupConan(version: string | undefined, _setupDir: string, _arch: string) {
export function setupConan({ version }: Partial<Pick<SetupOptions, "version">> = {}) {
return setupPipPack("conan", version)
}
Loading