Merge pull request #49 from aminya/defaults [skip ci]

This commit is contained in:
Amin Yahyaabadi 2022-04-16 02:27:02 -07:00 committed by GitHub
commit fd6d2a6ea9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 44 additions and 30 deletions

2
dist/setup_cpp.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,7 @@
import { setupCmake } from "../cmake" import { setupCmake } from "../cmake"
import { setupTmpDir, cleanupTmpDir, testBin } from "../../utils/tests/test-helpers" import { setupTmpDir, cleanupTmpDir, testBin } from "../../utils/tests/test-helpers"
import { isGitHubCI } from "../../utils/env/isci" import { isGitHubCI } from "../../utils/env/isci"
import { getVersion } from "../../default_versions"
jest.setTimeout(300000) jest.setTimeout(300000)
@ -11,12 +12,12 @@ describe("setup-cmake", () => {
}) })
it("should setup CMake", async () => { it("should setup CMake", async () => {
const { binDir } = await setupCmake("3.20.2", directory, process.arch) const { binDir } = await setupCmake(getVersion("cmake", "true"), directory, process.arch)
await testBin("cmake", ["--version"], binDir) await testBin("cmake", ["--version"], binDir)
}) })
it("should find CMake in the cache", async () => { it("should find CMake in the cache", async () => {
const { binDir } = await setupCmake("3.20.2", directory, process.arch) const { binDir } = await setupCmake(getVersion("cmake", "true"), directory, process.arch)
await testBin("cmake", ["--version"], binDir) await testBin("cmake", ["--version"], binDir)
if (isGitHubCI()) { if (isGitHubCI()) {
expect(binDir).toMatch(process.env.RUNNER_TOOL_CACHE ?? "hostedtoolcache") expect(binDir).toMatch(process.env.RUNNER_TOOL_CACHE ?? "hostedtoolcache")

View File

@ -1,10 +1,11 @@
import { setupConan } from "../conan" import { setupConan } from "../conan"
import { testBin } from "../../utils/tests/test-helpers" import { testBin } from "../../utils/tests/test-helpers"
import { getVersion } from "../../default_versions"
jest.setTimeout(300000) jest.setTimeout(300000)
describe("setup-conan", () => { describe("setup-conan", () => {
it("should setup conan", async () => { it("should setup conan", async () => {
const installInfo = await setupConan("", "", process.arch) const installInfo = await setupConan(getVersion("conan", "true"), "", process.arch)
await testBin("conan", ["--version"], installInfo.binDir) await testBin("conan", ["--version"], installInfo.binDir)
}) })

View File

@ -1,17 +1,17 @@
const DefaultVersions: Record<string, string> = { const DefaultVersions: Record<string, string> = {
llvm: "13.0.0", // https://github.com/llvm/llvm-project/releases llvm: "14.0.0", // https://github.com/llvm/llvm-project/releases
clangtidy: "13.0.0", clangtidy: "14.0.0",
clangformat: "13.0.0", clangformat: "14.0.0",
ninja: "1.10.2", // https://github.com/ninja-build/ninja/releases ninja: "1.10.2", // https://github.com/ninja-build/ninja/releases
cmake: "3.22.2", // https://github.com/Kitware/CMake/releases cmake: "3.23.1", // https://github.com/Kitware/CMake/releases
gcovr: "5.0", // https://pypi.org/project/gcovr/ gcovr: "5.0", // https://pypi.org/project/gcovr/
conan: "1.45.0", // https://github.com/conan-io/conan/releases conan: "1.47.0", // https://github.com/conan-io/conan/releases
meson: "0.61.2", // https://github.com/mesonbuild/meson/releases meson: "0.61.4", // https://github.com/mesonbuild/meson/releases
python: "3.8.10", python: "3.8.10",
kcov: "39", // https://github.com/SimonKagstrom/kcov/releases kcov: "40", // https://github.com/SimonKagstrom/kcov/releases
task: "3.11.0", // https://github.com/go-task/task/releases task: "3.12.0", // https://github.com/go-task/task/releases
doxygen: "1.9.1", // https://packages.ubuntu.com/search?suite=all&arch=any&searchon=names&keywords=doxygen doxygen: "1.9.1", // https://packages.ubuntu.com/search?suite=all&arch=any&searchon=names&keywords=doxygen
gcc: process.platform === "win32" ? "11.2.0.07112021" : "11", gcc: process.platform === "win32" ? "11.2.0.07112021" : "11", // https://community.chocolatey.org/packages/mingw#versionhistory and // https://packages.ubuntu.com/search?suite=all&arch=any&searchon=names&keywords=gcc
} }
/** Get the default version if passed true or undefined, otherwise return the version itself */ /** Get the default version if passed true or undefined, otherwise return the version itself */

View File

@ -1,10 +1,11 @@
import { setupGcovr } from "../gcovr" import { setupGcovr } from "../gcovr"
import { testBin } from "../../utils/tests/test-helpers" import { testBin } from "../../utils/tests/test-helpers"
import { getVersion } from "../../default_versions"
jest.setTimeout(300000) jest.setTimeout(300000)
describe("setup-gcovr", () => { describe("setup-gcovr", () => {
it("should setup gcovr", async () => { it("should setup gcovr", async () => {
const installInfo = await setupGcovr("", "", process.arch) const installInfo = await setupGcovr(getVersion("gcovr", "true"), "", process.arch)
await testBin("gcovr", ["--version"], installInfo.binDir) await testBin("gcovr", ["--version"], installInfo.binDir)
}) })
}) })

View File

@ -10,14 +10,18 @@ describe("setup-Kcov", () => {
return return
} }
let directory: string it("should setup Kcov v40", async () => {
beforeAll(async () => { const directory = await setupTmpDir("kcov-v40")
directory = await setupTmpDir("kcov-v39") const { binDir } = (await setupKcov("40", directory, "")) as InstallationInfo
await testBin("kcov", ["--version"], binDir)
await cleanupTmpDir("kcov-v40")
}) })
it("should setup Kcov v39", async () => { it("should setup Kcov v39", async () => {
const directory = await setupTmpDir("kcov-v39")
const { binDir } = (await setupKcov("39", directory, "")) as InstallationInfo const { binDir } = (await setupKcov("39", directory, "")) as InstallationInfo
await testBin("kcov", ["--version"], binDir) await testBin("kcov", ["--version"], binDir)
await cleanupTmpDir("kcov-v39")
}) })
// it("should find Kcov in the cache", async () => { // it("should find Kcov in the cache", async () => {
@ -44,8 +48,4 @@ describe("setup-Kcov", () => {
console.warn(err) console.warn(err)
} }
}) })
afterAll(async () => {
await cleanupTmpDir("kcov-v38")
})
}) })

View File

@ -7,6 +7,7 @@ import execa from "execa"
import path from "path" import path from "path"
import { addBinExtension } from "../../utils/extension/extension" import { addBinExtension } from "../../utils/extension/extension"
import { chmodSync } from "fs" import { chmodSync } from "fs"
import { getVersion } from "../../default_versions"
jest.setTimeout(400000) jest.setTimeout(400000)
async function testUrl(version: string) { async function testUrl(version: string) {
@ -26,6 +27,7 @@ describe("setup-llvm", () => {
it("Finds valid LLVM URLs", async () => { it("Finds valid LLVM URLs", async () => {
await Promise.all( await Promise.all(
[ [
// "14.0.1", fails on ubuntu
"14.0.0", "14.0.0",
"13.0.0", "13.0.0",
"12.0.0", "12.0.0",
@ -49,7 +51,7 @@ describe("setup-llvm", () => {
}) })
it("should setup LLVM", async () => { it("should setup LLVM", async () => {
const { binDir } = await setupLLVM("13.0.0", directory, process.arch) const { binDir } = await setupLLVM(getVersion("llvm", "true"), directory, process.arch)
await testBin("clang++", ["--version"], binDir) await testBin("clang++", ["--version"], binDir)
expect(process.env.CC?.includes("clang")).toBeTruthy() expect(process.env.CC?.includes("clang")).toBeTruthy()
@ -66,7 +68,7 @@ describe("setup-llvm", () => {
}) })
it("should find llvm in the cache", async () => { it("should find llvm in the cache", async () => {
const { binDir } = await setupLLVM("13.0.0", directory, process.arch) const { binDir } = await setupLLVM(getVersion("llvm", "true"), directory, process.arch)
await testBin("clang++", ["--version"], binDir) await testBin("clang++", ["--version"], binDir)
if (isGitHubCI()) { if (isGitHubCI()) {
@ -83,7 +85,7 @@ describe("setup-llvm", () => {
}) })
it("should setup clang-tidy and clang-format", async () => { it("should setup clang-tidy and clang-format", async () => {
const { binDir } = await setupClangTools("13.0.0", directory, process.arch) const { binDir } = await setupClangTools(getVersion("llvm", "true"), directory, process.arch)
await testBin("clang-tidy", ["--version"], binDir) await testBin("clang-tidy", ["--version"], binDir)
await testBin("clang-format", ["--version"], binDir) await testBin("clang-format", ["--version"], binDir)
}) })

View File

@ -58,6 +58,7 @@ export const VERSIONS: Set<string> = getVersions([
"13.0.0", "13.0.0",
"13.0.1", "13.0.1",
"14.0.0", "14.0.0",
"14.0.1",
]) ])
//================================================ //================================================
@ -116,7 +117,11 @@ function getDarwinUrl(version: string): string | null {
*/ */
const UBUNTU_RC: Map<string, string> = new Map() const UBUNTU_RC: Map<string, string> = new Map()
/** The (latest) Ubuntu versions for each LLVM version. */ /**
* The (latest) Ubuntu versions for each LLVM version.
*
* https://github.com/llvm/llvm-project/releases/tag/llvmorg-14.0.1 or https://releases.llvm.org/14.0.1
*/
const UBUNTU: { [key: string]: string } = { const UBUNTU: { [key: string]: string } = {
"3.5.0": "-ubuntu-14.04", "3.5.0": "-ubuntu-14.04",
"3.5.1": "", "3.5.1": "",
@ -152,6 +157,7 @@ const UBUNTU: { [key: string]: string } = {
"13.0.0": "-ubuntu-20.04", "13.0.0": "-ubuntu-20.04",
"13.0.1": "-ubuntu-18.04", "13.0.1": "-ubuntu-18.04",
"14.0.0": "-ubuntu-18.04", "14.0.0": "-ubuntu-18.04",
// "14.0.1": "-ubuntu-18.04",
} }
/** The latest supported LLVM version for the Linux (Ubuntu) platform. */ /** The latest supported LLVM version for the Linux (Ubuntu) platform. */

View File

@ -1,10 +1,11 @@
import { setupMeson } from "../meson" import { setupMeson } from "../meson"
import { testBin } from "../../utils/tests/test-helpers" import { testBin } from "../../utils/tests/test-helpers"
import { getVersion } from "../../default_versions"
jest.setTimeout(300000) jest.setTimeout(300000)
describe("setup-meson", () => { describe("setup-meson", () => {
it("should setup meson", async () => { it("should setup meson", async () => {
const installInfo = await setupMeson("", "", process.arch) const installInfo = await setupMeson(getVersion("meson", "true"), "", process.arch)
await testBin("meson", ["--version"], installInfo.binDir) await testBin("meson", ["--version"], installInfo.binDir)
}) })

View File

@ -1,10 +1,11 @@
import { setupNinja } from "../ninja" import { setupNinja } from "../ninja"
import { setupTmpDir, cleanupTmpDir, testBin } from "../../utils/tests/test-helpers" import { setupTmpDir, cleanupTmpDir, testBin } from "../../utils/tests/test-helpers"
import { isGitHubCI } from "../../utils/env/isci" import { isGitHubCI } from "../../utils/env/isci"
import { getVersion } from "../../default_versions"
jest.setTimeout(300000) jest.setTimeout(300000)
async function testNinja(directory: string) { async function testNinja(directory: string) {
const { binDir } = await setupNinja("1.10.2", directory, process.arch) const { binDir } = await setupNinja(getVersion("ninja", "true"), directory, process.arch)
await testBin("ninja", ["--version"], binDir) await testBin("ninja", ["--version"], binDir)
return binDir return binDir
} }

View File

@ -1,6 +1,7 @@
import { setupTask } from "../task" import { setupTask } from "../task"
import { cleanupTmpDir, setupTmpDir, testBin } from "../../utils/tests/test-helpers" import { cleanupTmpDir, setupTmpDir, testBin } from "../../utils/tests/test-helpers"
import { isGitHubCI } from "../../utils/env/isci" import { isGitHubCI } from "../../utils/env/isci"
import { getVersion } from "../../default_versions"
jest.setTimeout(300000) jest.setTimeout(300000)
describe("setup-task", () => { describe("setup-task", () => {
@ -10,13 +11,13 @@ describe("setup-task", () => {
}) })
it("should setup task", async () => { it("should setup task", async () => {
const { binDir } = await setupTask("3.10.0", directory, process.arch) const { binDir } = await setupTask(getVersion("task", "true"), directory, process.arch)
await testBin("task", ["--version"], binDir) await testBin("task", ["--version"], binDir)
}) })
it("should find task in the cache", async () => { it("should find task in the cache", async () => {
const { binDir } = await setupTask("3.10.0", directory, process.arch) const { binDir } = await setupTask(getVersion("task", "true"), directory, process.arch)
if (isGitHubCI()) { if (isGitHubCI()) {
expect(binDir).toMatch(process.env.RUNNER_TOOL_CACHE ?? "hostedtoolcache") expect(binDir).toMatch(process.env.RUNNER_TOOL_CACHE ?? "hostedtoolcache")
} }