Merge pull request #194 from aminya/update [skip ci]

This commit is contained in:
Amin Yahyaabadi 2023-09-05 12:29:49 -07:00 committed by GitHub
commit a18ed2e34d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 96 additions and 78 deletions

View File

@ -3,6 +3,7 @@
"ignorePatterns": ["dist/", "node_modules/", "dev/cpp_vcpkg_project"],
"rules": {
"no-unused-vars": "off",
"no-empty-function": "off",
"@typescript-eslint/no-unused-vars": [
"warn",
{

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -54,7 +54,7 @@
"test.lint": "run-p --aggregate-output --continue-on-error lint.cspell test.lint.eslint test.lint.prettier lint.tsc",
"test.lint.eslint": "eslint **/*.{ts,tsx,js,jsx,cjs,mjs,json,yaml} --no-error-on-unmatched-pattern --cache --cache-location ./.cache/eslint/",
"test.lint.prettier": "prettier . --check",
"test": "jest",
"test": "jest --runInBand --forceExit --coverage",
"build.docker_tests": "node ./dev/docker/__tests__/generate-docker-tests.mjs",
"build.docker.arch": "pnpm build.docker_tests && docker build -f ./dev/docker/__tests__/arch.dockerfile -t setup-cpp:arch .",
"build.docker.fedora": "pnpm build.docker_tests && docker build -f ./dev/docker/__tests__/fedora.dockerfile -t setup-cpp:fedora .",

View File

@ -55,18 +55,18 @@ describe("getVersion", () => {
it("gcovr", () => {
expect(getVersion("gcovr", "5.0")).toBe("5.0")
if (process.platform === "linux") {
expect(getVersion("gcovr", "true", [22, 4])).toBe("5.2")
expect(getVersion("gcovr", "true", [20, 4])).toBe("5.2")
expect(getVersion("gcovr", "true", [18, 4])).toBe("5.0")
expect(getVersion("gcovr", "true", [22, 4])).toBe(DefaultLinuxVersion.gcovr![22])
expect(getVersion("gcovr", "true", [20, 4])).toBe(DefaultLinuxVersion.gcovr![20])
expect(getVersion("gcovr", "true", [18, 4])).toBe(DefaultLinuxVersion.gcovr![18])
}
})
it("llvm", () => {
expect(getVersion("llvm", "13.0.0")).toBe("13.0.0")
if (process.platform === "linux") {
expect(getVersion("llvm", "true", [20, 4])).toBe(DefaultLinuxVersion["llvm"]![20])
expect(getVersion("llvm", "true", [18, 4])).toBe(DefaultLinuxVersion["llvm"]![18])
expect(getVersion("llvm", "true", [16, 4])).toBe(DefaultLinuxVersion["llvm"]![16])
expect(getVersion("llvm", "true", [20, 4])).toBe(DefaultLinuxVersion.llvm![20])
expect(getVersion("llvm", "true", [18, 4])).toBe(DefaultLinuxVersion.llvm![18])
expect(getVersion("llvm", "true", [16, 4])).toBe(DefaultLinuxVersion.llvm![16])
}
})
})

View File

@ -3,10 +3,11 @@ import { testBin } from "../../utils/tests/test-helpers"
jest.setTimeout(300000)
describe("setup-brew", () => {
if (process.platform === "win32") {
it.skip("should setup brew", () => {})
return
}
it("should setup brew", async () => {
if (process.platform !== "darwin") {
return
}
const installInfo = await setupBrew("", "", process.arch)
await testBin("brew", ["--version"], installInfo?.binDir)
})

View File

@ -4,10 +4,11 @@ import { setupChocolatey } from "../chocolatey"
jest.setTimeout(300000)
describe("setup-chocolatey", () => {
if (process.platform !== "win32") {
it.skip("should setup chocolatey", () => {})
return
}
it("should setup chocolatey", async () => {
if (process.platform !== "win32") {
return
}
const { binDir } = (await setupChocolatey("", "", process.arch)) as InstallationInfo
await testBin("choco", ["--version"], binDir)
})

View File

@ -26,7 +26,10 @@ interface MingwInfo {
// https://github.com/brechtsanders/winlibs_mingw/releases
const GccToMingwInfo = {
"13": { releaseName: "13.1.0posix-16.0.3-11.0.0-ucrt-r1", fileSuffix: "13.1.0-mingw-w64ucrt-11.0.0-r1" },
"13": { releaseName: "13.2.0-16.0.6-11.0.0-ucrt-r1", fileSuffix: "13.2.0-mingw-w64ucrt-11.0.0-r1" },
"13.2-ucrt": { releaseName: "13.2.0-16.0.6-11.0.0-ucrt-r1", fileSuffix: "13.2.0-mingw-w64ucrt-11.0.0-r1" },
"13.2-ucrt-mcf": { releaseName: "13.2.0mcf-16.0.6-11.0.1-ucrt-r2", fileSuffix: "13.2.0-mingw-w64ucrt-11.0.1-r2" },
"13.2-msvcrt": { releaseName: "13.2.0-16.0.6-11.0.1-msvcrt-r1", fileSuffix: "13.2.0-mingw-w64msvcrt-11.0.1-r1" },
"13.1-ucrt": { releaseName: "13.1.0posix-16.0.3-11.0.0-ucrt-r1", fileSuffix: "13.1.0-mingw-w64ucrt-11.0.0-r1" },
"13.1-msvcrt": { releaseName: "13.1.0posix-16.0.3-11.0.0-msvcrt-r1", fileSuffix: "13.1.0-mingw-w64msvcrt-11.0.0-r1" },
"12": { releaseName: "12.3.0-16.0.4-11.0.0-ucrt-r1", fileSuffix: "12.3.0-mingw-w64ucrt-11.0.0-r1" },
@ -44,7 +47,8 @@ const GccToMingwInfo = {
"11.3.0-msvcrt": { releaseName: "11.3.0-14.0.3-10.0.0-msvcrt-r3", fileSuffix: "11.3.0-mingw-w64msvcrt-10.0.0-r3" },
"11.2.0-ucrt": { releaseName: "11.2.0-9.0.0-ucrt-r5", fileSuffix: "11.2.0-mingw-w64ucrt-9.0.0-r5" },
"11.2.0-msvcrt": { releaseName: "11.2.0-9.0.0-msvcrt-r5", fileSuffix: "11.2.0-mingw-w64msvcrt-9.0.0-r5" },
"10": { releaseName: "10.3.0-12.0.0-9.0.0-r2", fileSuffix: "10.3.0-llvm-12.0.0-mingw-w64-9.0.0-r2" },
"10": { releaseName: "10.5.0-11.0.1-msvcrt-r1", fileSuffix: "10.5.0-mingw-w64msvcrt-11.0.1-r1" },
"10.5.0-msvcrt": { releaseName: "10.5.0-11.0.1-msvcrt-r1", fileSuffix: "10.5.0-mingw-w64msvcrt-11.0.1-r1" },
"10.3.0": { releaseName: "10.3.0-12.0.0-9.0.0-r2", fileSuffix: "10.3.0-llvm-12.0.0-mingw-w64-9.0.0-r2" },
"10.2.0": { releaseName: "10.2.0-7.0.0-r4", fileSuffix: "10.2.0-llvm-10.0.1-mingw-w64-7.0.0-r4" },
"9": { releaseName: "9.4.0-9.0.0-r1", fileSuffix: "9.4.0-mingw-w64-9.0.0-r1" },

View File

@ -2,12 +2,14 @@ import { setupMacOSSDK } from "../macos-sdk"
jest.setTimeout(300000)
describe("setup-macos-sdk", () => {
if (process.platform !== "darwin") {
it.skip("should setup macos-sdk", () => {})
return
}
it("should setup macos-sdk", async () => {
if (process.platform === "darwin") {
process.env.SDKROOT = undefined
await setupMacOSSDK()
expect(process.env.SDKROOT).toBeTruthy()
expect(typeof process.env.SDKROOT).toBe("string")
}
process.env.SDKROOT = undefined
await setupMacOSSDK()
expect(process.env.SDKROOT).toBeTruthy()
expect(typeof process.env.SDKROOT).toBe("string")
})
})

View File

@ -5,13 +5,12 @@ import { warning } from "ci-log"
jest.setTimeout(300000)
describe("setup-msvc", () => {
const isWindows = process.platform === "win32"
if (process.platform !== "win32") {
it.skip("should setup msvc", () => {})
return
}
it("should setup the pre-installed msvc", async () => {
try {
if (!isWindows) {
return
}
await setupMSVC("", "", process.arch)
console.log(which.sync("cl"))
} catch (err) {
@ -22,10 +21,11 @@ describe("setup-msvc", () => {
})
for (const version of [2022, 2019, 2017, 2015]) {
if (runnerWindowsVersion() !== undefined && runnerWindowsVersion()! > version) {
it.skip(`should setup msvc ${version}`, () => {})
return
}
it(`should setup msvc ${version}`, async () => {
if (!isWindows || (runnerWindowsVersion() !== undefined && runnerWindowsVersion()! > version)) {
return
}
try {
await setupMSVC(`${version}`, "", process.arch)
console.log(which.sync("cl"))

View File

@ -1,14 +1,22 @@
import { setupNala } from "../nala"
import { testBin } from "../../utils/tests/test-helpers"
import { isUbuntu } from "../../utils/env/isUbuntu"
import { execRootSync } from "admina"
jest.setTimeout(300000)
describe("setup-nala", () => {
if (!isUbuntu()) {
test.skip("should setup nala", () => {})
return
}
it("should setup nala", async () => {
if (!isUbuntu()) {
return
}
const installInfo = await setupNala("", "", process.arch)
await testBin("nala", ["--version"], installInfo?.binDir)
})
afterAll(() => {
// remove nala to run the rest of the tests with apt-get
execRootSync("apt-get", ["remove", "-y", "nala"])
execRootSync("apt-get", ["remove", "-y", "nala-legacy"])
})
})

View File

@ -3,10 +3,11 @@ import { testBin } from "../../utils/tests/test-helpers"
jest.setTimeout(300000)
describe("setup-OpenCppCoverage", () => {
if (process.platform !== "win32") {
it.skip("should setup OpenCppCoverage", () => {})
return
}
it("should setup OpenCppCoverage", async () => {
if (process.platform !== "win32") {
return
}
const installationInfo = await setupOpencppcoverage("", "", process.arch)
await testBin("OpenCppCoverage", null, installationInfo?.binDir) // OpenCppCoverage exits with non-zero even with --help

View File

@ -22,14 +22,14 @@ export const DefaultVersions: Record<string, string | undefined> = {
clangtidy: getLLVMDefault(),
clangformat: getLLVMDefault(),
ninja: "1.11.1", // https://github.com/ninja-build/ninja/releases
cmake: "3.26.4", // https://github.com/Kitware/CMake/releases
gcovr: "5.2", // https://pypi.org/project/gcovr/
conan: "1.60.0", // https://github.com/conan-io/conan/releases
meson: "1.0.2", // https://github.com/mesonbuild/meson/releases
kcov: "41", // https://github.com/SimonKagstrom/kcov/releases
task: "3.25.0", // https://github.com/go-task/task/releases
doxygen: isArch() ? "1.9.6-1" : "1.9.7", // https://www.doxygen.nl/download.html // https://packages.ubuntu.com/search?suite=all&arch=any&searchon=names&keywords=doxygen // https://formulae.brew.sh/formula/doxygen // https://archlinux.org/packages/extra/x86_64/doxygen/
gcc: isArch() ? "13.1.1-1" : "13", // https://github.com/brechtsanders/winlibs_mingw/releases and // https://packages.ubuntu.com/search?suite=all&arch=any&searchon=names&keywords=gcc
cmake: "3.27.4", // https://github.com/Kitware/CMake/releases
gcovr: "6.0", // https://pypi.org/project/gcovr/
conan: "1.60.2", // https://github.com/conan-io/conan/releases
meson: "1.2.1", // https://github.com/mesonbuild/meson/releases
kcov: "42", // https://github.com/SimonKagstrom/kcov/releases
task: "3.29.1", // https://github.com/go-task/task/releases
doxygen: isArch() ? "1.9.8-1" : "1.9.8", // https://www.doxygen.nl/download.html // https://packages.ubuntu.com/search?suite=all&arch=any&searchon=names&keywords=doxygen // https://formulae.brew.sh/formula/doxygen // https://archlinux.org/packages/extra/x86_64/doxygen/
gcc: isArch() ? "13.2.1-3" : "13", // https://github.com/brechtsanders/winlibs_mingw/releases and // https://packages.ubuntu.com/search?suite=all&arch=any&searchon=names&keywords=gcc
//mingw: isArch() ? "12.2.0-1" : "8", // https://packages.ubuntu.com/search?suite=all&arch=any&searchon=names&keywords=mingw-w64 // https://archlinux.org/packages/extra/x86_64/mingw-w64-gcc/
}
@ -75,8 +75,8 @@ export const DefaultLinuxVersion: Record<string, Record<number, string> | undefi
14: "13.0.0-ubuntu-16.04",
},
gcovr: {
22: "5.2",
20: "5.2",
22: "6.0",
20: "6.0",
18: "5.0",
},
meson: {
@ -92,7 +92,7 @@ export const DefaultLinuxVersion: Record<string, Record<number, string> | undefi
14: "legacy",
},
kcov: {
22: "40",
22: "42-binary",
20: "40-binary", // https://github.com/SimonKagstrom/kcov/releases
18: "40",
16: "40",