From 269d96f070c1d42fd2cd9c38d3bafbaa0d494771 Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Thu, 16 Sep 2021 07:09:01 -0500 Subject: [PATCH] fix: pass the default arguments to the functions --- src/brew/__tests__/brew.test.ts | 2 +- src/ccache/__tests__/ccache.test.ts | 2 +- src/chocolatey/__tests__/chocolatey.test.ts | 2 +- src/cmake/__tests__/cmake.test.ts | 2 +- src/conan/__tests__/conan.test.ts | 2 +- src/cppcheck/__tests__/cppcheck.test.ts | 2 +- src/default_versions.ts | 3 +++ src/doxygen/__tests__/doxygen.test.ts | 2 +- src/gcovr/__tests__/gcovr.test.ts | 2 +- src/llvm/__tests__/llvm.test.ts | 2 +- src/meson/__tests__/meson.test.ts | 2 +- src/msvc/__tests__/msvc.test.ts | 2 +- src/msvc/msvc.ts | 1 - src/ninja/__tests__/ninja.test.ts | 2 +- src/opencppcoverage/__tests__/opencppcoverage.test.ts | 2 +- src/utils/setup/setupBrewPack.ts | 2 +- src/utils/setup/setupChocoPack.ts | 2 +- src/utils/setup/setupPipPack.ts | 2 +- 18 files changed, 19 insertions(+), 17 deletions(-) diff --git a/src/brew/__tests__/brew.test.ts b/src/brew/__tests__/brew.test.ts index 079127be..651513a1 100644 --- a/src/brew/__tests__/brew.test.ts +++ b/src/brew/__tests__/brew.test.ts @@ -7,7 +7,7 @@ describe("setup-brew", () => { if (process.platform !== "darwin") { return } - await setupBrew() + await setupBrew("", "", "") const { status } = spawn("brew", ["--version"], { encoding: "utf8", diff --git a/src/ccache/__tests__/ccache.test.ts b/src/ccache/__tests__/ccache.test.ts index 315a2c80..7f8982f0 100644 --- a/src/ccache/__tests__/ccache.test.ts +++ b/src/ccache/__tests__/ccache.test.ts @@ -4,7 +4,7 @@ import { spawnSync as spawn } from "child_process" jest.setTimeout(200000) describe("setup-ccache", () => { it("should setup ccache", async () => { - await setupCcache() + await setupCcache("", "", "") const { status } = spawn("ccache", ["--version"], { encoding: "utf8", diff --git a/src/chocolatey/__tests__/chocolatey.test.ts b/src/chocolatey/__tests__/chocolatey.test.ts index aa7fe87c..0846da17 100644 --- a/src/chocolatey/__tests__/chocolatey.test.ts +++ b/src/chocolatey/__tests__/chocolatey.test.ts @@ -7,7 +7,7 @@ describe("setup-chocolatey", () => { if (process.platform !== "win32") { return } - await setupChocolatey() + await setupChocolatey("", "", "") const { status } = spawn("choco", ["--version"], { encoding: "utf8", diff --git a/src/cmake/__tests__/cmake.test.ts b/src/cmake/__tests__/cmake.test.ts index d3e76789..a68286ad 100644 --- a/src/cmake/__tests__/cmake.test.ts +++ b/src/cmake/__tests__/cmake.test.ts @@ -3,7 +3,7 @@ import { setupTmpDir, cleanupTmpDir, testBin } from "../../utils/tests/test-help jest.setTimeout(200000) async function testCmake(directory: string) { - const { binDir } = await setupCmake("3.20.2", directory) + const { binDir } = await setupCmake("3.20.2", directory, "") testBin("cmake", binDir) return binDir } diff --git a/src/conan/__tests__/conan.test.ts b/src/conan/__tests__/conan.test.ts index 7def5a79..bec97b94 100644 --- a/src/conan/__tests__/conan.test.ts +++ b/src/conan/__tests__/conan.test.ts @@ -4,7 +4,7 @@ import { spawnSync as spawn } from "child_process" jest.setTimeout(200000) describe("setup-conan", () => { it("should setup conan", async () => { - await setupConan("1.40.1") + await setupConan("1.40.1", "", "") const { status } = spawn("conan", ["--version"], { encoding: "utf8", diff --git a/src/cppcheck/__tests__/cppcheck.test.ts b/src/cppcheck/__tests__/cppcheck.test.ts index 65cbc808..0bfeedd6 100644 --- a/src/cppcheck/__tests__/cppcheck.test.ts +++ b/src/cppcheck/__tests__/cppcheck.test.ts @@ -4,7 +4,7 @@ import { spawnSync as spawn } from "child_process" jest.setTimeout(200000) describe("setup-cppcheck", () => { it("should setup cppcheck", async () => { - await setupCppcheck() + await setupCppcheck("", "", "") const { status } = spawn("cppcheck", ["--version"], { encoding: "utf8", diff --git a/src/default_versions.ts b/src/default_versions.ts index 8ebd1ea6..9e468d05 100644 --- a/src/default_versions.ts +++ b/src/default_versions.ts @@ -3,6 +3,9 @@ const DefaultVersions: Record = { llvm: "11", ninja: "1.10.2", cmake: "3.20.2", + gcovr: "5.0", + meson: "0.59.1", + python: "3.x", } /** Get the default version if passed true or undefined, otherwise return the version itself */ diff --git a/src/doxygen/__tests__/doxygen.test.ts b/src/doxygen/__tests__/doxygen.test.ts index ecc6dd7a..5fc399cb 100644 --- a/src/doxygen/__tests__/doxygen.test.ts +++ b/src/doxygen/__tests__/doxygen.test.ts @@ -4,7 +4,7 @@ import { spawnSync as spawn } from "child_process" jest.setTimeout(200000) describe("setup-doxygen", () => { it("should setup doxygen", async () => { - await setupDoxygen() + await setupDoxygen("", "", "") const { status } = spawn("doxygen", ["--version"], { encoding: "utf8", diff --git a/src/gcovr/__tests__/gcovr.test.ts b/src/gcovr/__tests__/gcovr.test.ts index 197de9c6..c6a18f26 100644 --- a/src/gcovr/__tests__/gcovr.test.ts +++ b/src/gcovr/__tests__/gcovr.test.ts @@ -4,7 +4,7 @@ import { spawnSync as spawn } from "child_process" jest.setTimeout(200000) describe("setup-gcovr", () => { it("should setup gcovr", async () => { - await setupGcovr("5.0") + await setupGcovr("5.0", "", "") const { status } = spawn("gcovr", ["--version"], { encoding: "utf8", diff --git a/src/llvm/__tests__/llvm.test.ts b/src/llvm/__tests__/llvm.test.ts index 7ea57ffc..b80dc10d 100644 --- a/src/llvm/__tests__/llvm.test.ts +++ b/src/llvm/__tests__/llvm.test.ts @@ -46,7 +46,7 @@ describe("setup-llvm", () => { }) it("should setup LLVM", async () => { - const { binDir } = await setupLLVM("12.0.0", directory) + const { binDir } = await setupLLVM("11.0.0", directory, "") expect(binDir).toBeDefined() expect(binDir).not.toHaveLength(0) diff --git a/src/meson/__tests__/meson.test.ts b/src/meson/__tests__/meson.test.ts index 7e02062e..b4bc9c04 100644 --- a/src/meson/__tests__/meson.test.ts +++ b/src/meson/__tests__/meson.test.ts @@ -4,7 +4,7 @@ import { spawnSync as spawn } from "child_process" jest.setTimeout(200000) describe("setup-meson", () => { it("should setup meson", async () => { - await setupMeson("0.59.1") + await setupMeson("0.59.1", "", "") const { status } = spawn("meson", ["--version"], { encoding: "utf8", diff --git a/src/msvc/__tests__/msvc.test.ts b/src/msvc/__tests__/msvc.test.ts index d16b9a0f..2e41a1c3 100644 --- a/src/msvc/__tests__/msvc.test.ts +++ b/src/msvc/__tests__/msvc.test.ts @@ -7,7 +7,7 @@ describe("setup-msvc", () => { if (process.platform !== "win32") { return } - await setupMSVC("2017") + await setupMSVC("2019", "", "") const { status } = spawn("cl", { encoding: "utf8", diff --git a/src/msvc/msvc.ts b/src/msvc/msvc.ts index f313ab58..2a483f04 100644 --- a/src/msvc/msvc.ts +++ b/src/msvc/msvc.ts @@ -2,7 +2,6 @@ import { setupMSVCDevCmd } from "./msvc-dev-cmd/index" import { setupChocoPack } from "../utils/setup/setupChocoPack" import { exportVariable } from "@actions/core" import { existsSync } from "fs" -import { arch as osArch } from "os" type MSVCVersion = "2015" | "2017" | "2019" | string diff --git a/src/ninja/__tests__/ninja.test.ts b/src/ninja/__tests__/ninja.test.ts index 954a44e6..46dc9799 100644 --- a/src/ninja/__tests__/ninja.test.ts +++ b/src/ninja/__tests__/ninja.test.ts @@ -3,7 +3,7 @@ import { setupTmpDir, cleanupTmpDir, testBin } from "../../utils/tests/test-help jest.setTimeout(200000) async function testNinja(directory: string) { - const { binDir } = await setupNinja("1.10.2", directory) + const { binDir } = await setupNinja("1.10.2", directory, "") testBin("ninja", binDir) return binDir } diff --git a/src/opencppcoverage/__tests__/opencppcoverage.test.ts b/src/opencppcoverage/__tests__/opencppcoverage.test.ts index ca00db92..42a1065e 100644 --- a/src/opencppcoverage/__tests__/opencppcoverage.test.ts +++ b/src/opencppcoverage/__tests__/opencppcoverage.test.ts @@ -7,7 +7,7 @@ describe("setup-OpenCppCoverage", () => { if (process.platform !== "win32") { return } - await setupOpencppcoverage() + await setupOpencppcoverage("", "", "") const { status } = spawn("OpenCppCoverage", ["--version"], { encoding: "utf8", diff --git a/src/utils/setup/setupBrewPack.ts b/src/utils/setup/setupBrewPack.ts index 4141837e..2ef79292 100644 --- a/src/utils/setup/setupBrewPack.ts +++ b/src/utils/setup/setupBrewPack.ts @@ -8,7 +8,7 @@ let hasBrew = false /** A function that installs a package using brew */ export function setupBrewPack(name: string, version?: string) { if (!hasBrew || which.sync("brew", { nothrow: true }) === null) { - setupBrew() + setupBrew("", "", "") hasBrew = true } diff --git a/src/utils/setup/setupChocoPack.ts b/src/utils/setup/setupChocoPack.ts index 82f54955..e0cef6d1 100644 --- a/src/utils/setup/setupChocoPack.ts +++ b/src/utils/setup/setupChocoPack.ts @@ -8,7 +8,7 @@ let hasChoco = false /** A function that installs a package using choco */ export async function setupChocoPack(name: string, version?: string, args: string[] = []) { if (!hasChoco || which.sync("choco", { nothrow: true }) === null) { - await setupChocolatey() + await setupChocolatey("", "", "") hasChoco = true } diff --git a/src/utils/setup/setupPipPack.ts b/src/utils/setup/setupPipPack.ts index 3df6f168..841df6a7 100644 --- a/src/utils/setup/setupPipPack.ts +++ b/src/utils/setup/setupPipPack.ts @@ -16,7 +16,7 @@ export async function setupPipPack(name: string, version?: string) { } else if (which.sync("pip", { nothrow: true }) !== null && (await isBinUptoDate("python", "3.0.0"))) { pip = "pip" } else { - await setupPython("3.x") + await setupPython("3.x", "", "") pip = "pip3" } }