mirror of https://github.com/aminya/setup-cpp
feat: add support for cmakelang, cmake-lint, cmake-format
This commit is contained in:
parent
d7f5466d92
commit
67a1d8d27d
|
@ -17,7 +17,7 @@ Setting up a **cross-platform** environment for building and testing C++/C proje
|
||||||
| category | tools |
|
| category | tools |
|
||||||
| --------------------- | --------------------------------------------------------------------------- |
|
| --------------------- | --------------------------------------------------------------------------- |
|
||||||
| compiler and analyzer | llvm, gcc, msvc, apple-clang, vcvarsall, cppcheck, clang-tidy, clang-format |
|
| compiler and analyzer | llvm, gcc, msvc, apple-clang, vcvarsall, cppcheck, clang-tidy, clang-format |
|
||||||
| build system | cmake, ninja, meson, make, task, bazel |
|
| build system | cmake, ninja, meson, make, task, bazel, cmakelang, cmake-format, cmake-lint |
|
||||||
| package manager | vcpkg, conan, choco, brew, nala |
|
| package manager | vcpkg, conan, choco, brew, nala |
|
||||||
| cache | ccache, sccache |
|
| cache | ccache, sccache |
|
||||||
| documentation | doxygen, graphviz |
|
| documentation | doxygen, graphviz |
|
||||||
|
|
15
action.yml
15
action.yml
|
@ -70,6 +70,21 @@ inputs:
|
||||||
cmake:
|
cmake:
|
||||||
description: "Wether to install cmake (true/false) or the specific version to install."
|
description: "Wether to install cmake (true/false) or the specific version to install."
|
||||||
required: false
|
required: false
|
||||||
|
cmakelang:
|
||||||
|
description: "Wether to install cmakelang (true/false) or the specific version to install."
|
||||||
|
required: false
|
||||||
|
cmake-lint:
|
||||||
|
description: "Wether to install cmake-lint (true/false) or the specific version to install."
|
||||||
|
required: false
|
||||||
|
cmakelint:
|
||||||
|
description: "Wether to install cmake-lint (true/false) or the specific version to install."
|
||||||
|
required: false
|
||||||
|
cmake-format:
|
||||||
|
description: "Wether to install cmake-format (true/false) or the specific version to install."
|
||||||
|
required: false
|
||||||
|
cmakeformat:
|
||||||
|
description: "Wether to install cmake-format (true/false) or the specific version to install."
|
||||||
|
required: false
|
||||||
ninja:
|
ninja:
|
||||||
description: "Wether to install ninja (true/false) or the specific version to install."
|
description: "Wether to install ninja (true/false) or the specific version to install."
|
||||||
required: false
|
required: false
|
||||||
|
|
|
@ -28,6 +28,7 @@ words:
|
||||||
- choco
|
- choco
|
||||||
- clangd
|
- clangd
|
||||||
- cmake
|
- cmake
|
||||||
|
- cmakeformat
|
||||||
- cobertura
|
- cobertura
|
||||||
- copr
|
- copr
|
||||||
- CPATH
|
- CPATH
|
||||||
|
|
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
|
@ -35,7 +35,9 @@ All the available tools:
|
||||||
"compiler and analyzer": {
|
"compiler and analyzer": {
|
||||||
tools: "--llvm, --gcc, --msvc, --apple-clang, --vcvarsall, --cppcheck, --clang-tidy, --clang-format",
|
tools: "--llvm, --gcc, --msvc, --apple-clang, --vcvarsall, --cppcheck, --clang-tidy, --clang-format",
|
||||||
},
|
},
|
||||||
"build system": { tools: "--cmake, --ninja, --meson, --make, --task, --bazel" },
|
"build system": {
|
||||||
|
tools: "--cmake, --ninja, --meson, --make, --task, --bazel, --cmakelang, --cmake-lint, --cmake-format",
|
||||||
|
},
|
||||||
"package manager": { tools: "--vcpkg, --conan, --choco, --brew, --nala" },
|
"package manager": { tools: "--vcpkg, --conan, --choco, --brew, --nala" },
|
||||||
cache: { tools: "--ccache, --sccache" },
|
cache: { tools: "--ccache, --sccache" },
|
||||||
documentation: { tools: "--doxygen, --graphviz" },
|
documentation: { tools: "--doxygen, --graphviz" },
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
import { ubuntuVersion } from "../../utils/env/ubuntu_version.js"
|
||||||
|
import { testBin } from "../../utils/tests/test-helpers.js"
|
||||||
|
import { getVersion } from "../../versions/versions.js"
|
||||||
|
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)
|
||||||
|
await testBin("cmake-lint", ["--version"], installInfo.binDir)
|
||||||
|
await testBin("cmake-format", ["--version"], installInfo.binDir)
|
||||||
|
})
|
||||||
|
})
|
|
@ -0,0 +1,6 @@
|
||||||
|
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) {
|
||||||
|
return setupPipPack("cmakelang[YAML]", version)
|
||||||
|
}
|
22
src/tool.ts
22
src/tool.ts
|
@ -3,6 +3,7 @@ import { setupBazel } from "./bazel/bazel.js"
|
||||||
import { setupCcache } from "./ccache/ccache.js"
|
import { setupCcache } from "./ccache/ccache.js"
|
||||||
import { setupChocolatey } from "./chocolatey/chocolatey.js"
|
import { setupChocolatey } from "./chocolatey/chocolatey.js"
|
||||||
import { setupCmake } from "./cmake/cmake.js"
|
import { setupCmake } from "./cmake/cmake.js"
|
||||||
|
import { setupCmakelang } from "./cmakelang/cmakelang.js"
|
||||||
import { setupConan } from "./conan/conan.js"
|
import { setupConan } from "./conan/conan.js"
|
||||||
import { setupCppcheck } from "./cppcheck/cppcheck.js"
|
import { setupCppcheck } from "./cppcheck/cppcheck.js"
|
||||||
import { setupDoxygen } from "./doxygen/doxygen.js"
|
import { setupDoxygen } from "./doxygen/doxygen.js"
|
||||||
|
@ -42,19 +43,32 @@ export const appleClangSetups = {
|
||||||
"apple-llvm": setupAppleClang,
|
"apple-llvm": setupAppleClang,
|
||||||
} as const
|
} as const
|
||||||
|
|
||||||
|
const cmakeLangSetups = {
|
||||||
|
cmakelang: setupCmakelang,
|
||||||
|
"cmake-lint": setupCmakelang,
|
||||||
|
"cmake-format": setupCmakelang,
|
||||||
|
cmakelint: setupCmakelang,
|
||||||
|
cmakeformat: setupCmakelang,
|
||||||
|
} as const
|
||||||
|
|
||||||
export const llvmTools = ["llvm", "clang", "clang++", "clang-tidy", "clang-format", "clangtidy", "clangformat"]
|
export const llvmTools = ["llvm", "clang", "clang++", "clang-tidy", "clang-format", "clangtidy", "clangformat"]
|
||||||
|
|
||||||
/** The setup functions */
|
/** The setup functions */
|
||||||
export const setups = {
|
export const setups = {
|
||||||
|
nala: setupNala,
|
||||||
|
brew: setupBrew,
|
||||||
|
choco: setupChocolatey,
|
||||||
|
python: setupPython,
|
||||||
|
powershell: setupPowershell,
|
||||||
|
pwsh: setupPowershell,
|
||||||
...llvmSetups,
|
...llvmSetups,
|
||||||
...gccSetups,
|
...gccSetups,
|
||||||
...mingwSetups,
|
...mingwSetups,
|
||||||
...msvcSetups,
|
...msvcSetups,
|
||||||
...appleClangSetups,
|
...appleClangSetups,
|
||||||
nala: setupNala,
|
...cmakeLangSetups,
|
||||||
cmake: setupCmake,
|
cmake: setupCmake,
|
||||||
ninja: setupNinja,
|
ninja: setupNinja,
|
||||||
python: setupPython,
|
|
||||||
vcpkg: setupVcpkg,
|
vcpkg: setupVcpkg,
|
||||||
bazel: setupBazel,
|
bazel: setupBazel,
|
||||||
conan: setupConan,
|
conan: setupConan,
|
||||||
|
@ -62,10 +76,6 @@ export const setups = {
|
||||||
gcovr: setupGcovr,
|
gcovr: setupGcovr,
|
||||||
opencppcoverage: setupOpencppcoverage,
|
opencppcoverage: setupOpencppcoverage,
|
||||||
OpenCppCoverage: setupOpencppcoverage,
|
OpenCppCoverage: setupOpencppcoverage,
|
||||||
choco: setupChocolatey,
|
|
||||||
brew: setupBrew,
|
|
||||||
powershell: setupPowershell,
|
|
||||||
pwsh: setupPowershell,
|
|
||||||
ccache: setupCcache,
|
ccache: setupCcache,
|
||||||
sccache: setupSccache,
|
sccache: setupSccache,
|
||||||
doxygen: setupDoxygen,
|
doxygen: setupDoxygen,
|
||||||
|
|
Loading…
Reference in New Issue