Skip to content

Commit a18ed2e

Browse files
authored
Merge pull request #194 from aminya/update [skip ci]
2 parents 2d1ee7f + 8d969d8 commit a18ed2e

File tree

17 files changed

+96
-78
lines changed

17 files changed

+96
-78
lines changed

.eslintrc.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"ignorePatterns": ["dist/", "node_modules/", "dev/cpp_vcpkg_project"],
44
"rules": {
55
"no-unused-vars": "off",
6+
"no-empty-function": "off",
67
"@typescript-eslint/no-unused-vars": [
78
"warn",
89
{

dist/actions/setup-cpp.js

Lines changed: 15 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/actions/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.

dist/legacy/setup-cpp.js

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/legacy/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.

dist/modern/setup-cpp.js

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/modern/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.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
"test.lint": "run-p --aggregate-output --continue-on-error lint.cspell test.lint.eslint test.lint.prettier lint.tsc",
5555
"test.lint.eslint": "eslint **/*.{ts,tsx,js,jsx,cjs,mjs,json,yaml} --no-error-on-unmatched-pattern --cache --cache-location ./.cache/eslint/",
5656
"test.lint.prettier": "prettier . --check",
57-
"test": "jest",
57+
"test": "jest --runInBand --forceExit --coverage",
5858
"build.docker_tests": "node ./dev/docker/__tests__/generate-docker-tests.mjs",
5959
"build.docker.arch": "pnpm build.docker_tests && docker build -f ./dev/docker/__tests__/arch.dockerfile -t setup-cpp:arch .",
6060
"build.docker.fedora": "pnpm build.docker_tests && docker build -f ./dev/docker/__tests__/fedora.dockerfile -t setup-cpp:fedora .",

src/__tests__/main.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,18 +55,18 @@ describe("getVersion", () => {
5555
it("gcovr", () => {
5656
expect(getVersion("gcovr", "5.0")).toBe("5.0")
5757
if (process.platform === "linux") {
58-
expect(getVersion("gcovr", "true", [22, 4])).toBe("5.2")
59-
expect(getVersion("gcovr", "true", [20, 4])).toBe("5.2")
60-
expect(getVersion("gcovr", "true", [18, 4])).toBe("5.0")
58+
expect(getVersion("gcovr", "true", [22, 4])).toBe(DefaultLinuxVersion.gcovr![22])
59+
expect(getVersion("gcovr", "true", [20, 4])).toBe(DefaultLinuxVersion.gcovr![20])
60+
expect(getVersion("gcovr", "true", [18, 4])).toBe(DefaultLinuxVersion.gcovr![18])
6161
}
6262
})
6363

6464
it("llvm", () => {
6565
expect(getVersion("llvm", "13.0.0")).toBe("13.0.0")
6666
if (process.platform === "linux") {
67-
expect(getVersion("llvm", "true", [20, 4])).toBe(DefaultLinuxVersion["llvm"]![20])
68-
expect(getVersion("llvm", "true", [18, 4])).toBe(DefaultLinuxVersion["llvm"]![18])
69-
expect(getVersion("llvm", "true", [16, 4])).toBe(DefaultLinuxVersion["llvm"]![16])
67+
expect(getVersion("llvm", "true", [20, 4])).toBe(DefaultLinuxVersion.llvm![20])
68+
expect(getVersion("llvm", "true", [18, 4])).toBe(DefaultLinuxVersion.llvm![18])
69+
expect(getVersion("llvm", "true", [16, 4])).toBe(DefaultLinuxVersion.llvm![16])
7070
}
7171
})
7272
})

src/brew/__tests__/brew.test.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@ import { testBin } from "../../utils/tests/test-helpers"
33

44
jest.setTimeout(300000)
55
describe("setup-brew", () => {
6+
if (process.platform === "win32") {
7+
it.skip("should setup brew", () => {})
8+
return
9+
}
610
it("should setup brew", async () => {
7-
if (process.platform !== "darwin") {
8-
return
9-
}
1011
const installInfo = await setupBrew("", "", process.arch)
1112
await testBin("brew", ["--version"], installInfo?.binDir)
1213
})

src/chocolatey/__tests__/chocolatey.test.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@ import { setupChocolatey } from "../chocolatey"
44

55
jest.setTimeout(300000)
66
describe("setup-chocolatey", () => {
7+
if (process.platform !== "win32") {
8+
it.skip("should setup chocolatey", () => {})
9+
return
10+
}
711
it("should setup chocolatey", async () => {
8-
if (process.platform !== "win32") {
9-
return
10-
}
1112
const { binDir } = (await setupChocolatey("", "", process.arch)) as InstallationInfo
1213
await testBin("choco", ["--version"], binDir)
1314
})

src/gcc/gcc.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ interface MingwInfo {
2626

2727
// https://github.com/brechtsanders/winlibs_mingw/releases
2828
const GccToMingwInfo = {
29-
"13": { releaseName: "13.1.0posix-16.0.3-11.0.0-ucrt-r1", fileSuffix: "13.1.0-mingw-w64ucrt-11.0.0-r1" },
29+
"13": { releaseName: "13.2.0-16.0.6-11.0.0-ucrt-r1", fileSuffix: "13.2.0-mingw-w64ucrt-11.0.0-r1" },
30+
"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" },
31+
"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" },
32+
"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" },
3033
"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" },
3134
"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" },
3235
"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 = {
4447
"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" },
4548
"11.2.0-ucrt": { releaseName: "11.2.0-9.0.0-ucrt-r5", fileSuffix: "11.2.0-mingw-w64ucrt-9.0.0-r5" },
4649
"11.2.0-msvcrt": { releaseName: "11.2.0-9.0.0-msvcrt-r5", fileSuffix: "11.2.0-mingw-w64msvcrt-9.0.0-r5" },
47-
"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" },
50+
"10": { releaseName: "10.5.0-11.0.1-msvcrt-r1", fileSuffix: "10.5.0-mingw-w64msvcrt-11.0.1-r1" },
51+
"10.5.0-msvcrt": { releaseName: "10.5.0-11.0.1-msvcrt-r1", fileSuffix: "10.5.0-mingw-w64msvcrt-11.0.1-r1" },
4852
"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" },
4953
"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" },
5054
"9": { releaseName: "9.4.0-9.0.0-r1", fileSuffix: "9.4.0-mingw-w64-9.0.0-r1" },

src/macos-sdk/__tests__/macos-sdk.test.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@ import { setupMacOSSDK } from "../macos-sdk"
22

33
jest.setTimeout(300000)
44
describe("setup-macos-sdk", () => {
5+
if (process.platform !== "darwin") {
6+
it.skip("should setup macos-sdk", () => {})
7+
return
8+
}
59
it("should setup macos-sdk", async () => {
6-
if (process.platform === "darwin") {
7-
process.env.SDKROOT = undefined
8-
await setupMacOSSDK()
9-
expect(process.env.SDKROOT).toBeTruthy()
10-
expect(typeof process.env.SDKROOT).toBe("string")
11-
}
10+
process.env.SDKROOT = undefined
11+
await setupMacOSSDK()
12+
expect(process.env.SDKROOT).toBeTruthy()
13+
expect(typeof process.env.SDKROOT).toBe("string")
1214
})
1315
})

src/msvc/__tests__/msvc.test.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,12 @@ import { warning } from "ci-log"
55

66
jest.setTimeout(300000)
77
describe("setup-msvc", () => {
8-
const isWindows = process.platform === "win32"
9-
8+
if (process.platform !== "win32") {
9+
it.skip("should setup msvc", () => {})
10+
return
11+
}
1012
it("should setup the pre-installed msvc", async () => {
1113
try {
12-
if (!isWindows) {
13-
return
14-
}
1514
await setupMSVC("", "", process.arch)
1615
console.log(which.sync("cl"))
1716
} catch (err) {
@@ -22,10 +21,11 @@ describe("setup-msvc", () => {
2221
})
2322

2423
for (const version of [2022, 2019, 2017, 2015]) {
24+
if (runnerWindowsVersion() !== undefined && runnerWindowsVersion()! > version) {
25+
it.skip(`should setup msvc ${version}`, () => {})
26+
return
27+
}
2528
it(`should setup msvc ${version}`, async () => {
26-
if (!isWindows || (runnerWindowsVersion() !== undefined && runnerWindowsVersion()! > version)) {
27-
return
28-
}
2929
try {
3030
await setupMSVC(`${version}`, "", process.arch)
3131
console.log(which.sync("cl"))

src/nala/__tests__/nala.test.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,22 @@
11
import { setupNala } from "../nala"
22
import { testBin } from "../../utils/tests/test-helpers"
33
import { isUbuntu } from "../../utils/env/isUbuntu"
4+
import { execRootSync } from "admina"
45

56
jest.setTimeout(300000)
67
describe("setup-nala", () => {
8+
if (!isUbuntu()) {
9+
test.skip("should setup nala", () => {})
10+
return
11+
}
712
it("should setup nala", async () => {
8-
if (!isUbuntu()) {
9-
return
10-
}
1113
const installInfo = await setupNala("", "", process.arch)
1214
await testBin("nala", ["--version"], installInfo?.binDir)
1315
})
16+
17+
afterAll(() => {
18+
// remove nala to run the rest of the tests with apt-get
19+
execRootSync("apt-get", ["remove", "-y", "nala"])
20+
execRootSync("apt-get", ["remove", "-y", "nala-legacy"])
21+
})
1422
})

src/opencppcoverage/__tests__/opencppcoverage.test.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@ import { testBin } from "../../utils/tests/test-helpers"
33

44
jest.setTimeout(300000)
55
describe("setup-OpenCppCoverage", () => {
6+
if (process.platform !== "win32") {
7+
it.skip("should setup OpenCppCoverage", () => {})
8+
return
9+
}
610
it("should setup OpenCppCoverage", async () => {
7-
if (process.platform !== "win32") {
8-
return
9-
}
1011
const installationInfo = await setupOpencppcoverage("", "", process.arch)
1112

1213
await testBin("OpenCppCoverage", null, installationInfo?.binDir) // OpenCppCoverage exits with non-zero even with --help

src/versions/default_versions.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ export const DefaultVersions: Record<string, string | undefined> = {
2222
clangtidy: getLLVMDefault(),
2323
clangformat: getLLVMDefault(),
2424
ninja: "1.11.1", // https://github.com/ninja-build/ninja/releases
25-
cmake: "3.26.4", // https://github.com/Kitware/CMake/releases
26-
gcovr: "5.2", // https://pypi.org/project/gcovr/
27-
conan: "1.60.0", // https://github.com/conan-io/conan/releases
28-
meson: "1.0.2", // https://github.com/mesonbuild/meson/releases
29-
kcov: "41", // https://github.com/SimonKagstrom/kcov/releases
30-
task: "3.25.0", // https://github.com/go-task/task/releases
31-
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/
32-
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
25+
cmake: "3.27.4", // https://github.com/Kitware/CMake/releases
26+
gcovr: "6.0", // https://pypi.org/project/gcovr/
27+
conan: "1.60.2", // https://github.com/conan-io/conan/releases
28+
meson: "1.2.1", // https://github.com/mesonbuild/meson/releases
29+
kcov: "42", // https://github.com/SimonKagstrom/kcov/releases
30+
task: "3.29.1", // https://github.com/go-task/task/releases
31+
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/
32+
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
3333
//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/
3434
}
3535

@@ -75,8 +75,8 @@ export const DefaultLinuxVersion: Record<string, Record<number, string> | undefi
7575
14: "13.0.0-ubuntu-16.04",
7676
},
7777
gcovr: {
78-
22: "5.2",
79-
20: "5.2",
78+
22: "6.0",
79+
20: "6.0",
8080
18: "5.0",
8181
},
8282
meson: {
@@ -92,7 +92,7 @@ export const DefaultLinuxVersion: Record<string, Record<number, string> | undefi
9292
14: "legacy",
9393
},
9494
kcov: {
95-
22: "40",
95+
22: "42-binary",
9696
20: "40-binary", // https://github.com/SimonKagstrom/kcov/releases
9797
18: "40",
9898
16: "40",

0 commit comments

Comments
 (0)