mirror of https://github.com/aminya/setup-cpp
feat: add meson installation
This commit is contained in:
parent
0c07dec72e
commit
5f6e3a7053
|
@ -17,9 +17,9 @@ The package will be usable from any environment (locally, GitHub Actions, etc).
|
|||
- [x] setup ninja
|
||||
- [x] setup llvm
|
||||
- [x] setup conan
|
||||
- [ ] setup gcc/mingw
|
||||
- [x] setup meson
|
||||
- [ ] setup msvc
|
||||
- [ ] setup meson
|
||||
- [ ] setup gcc/mingw
|
||||
- [ ] setup vcpkg
|
||||
- [ ] setup gcovr
|
||||
- [ ] setup OpenCppCoverage
|
||||
|
|
|
@ -18,7 +18,10 @@ inputs:
|
|||
default: "1.10.2"
|
||||
required: false
|
||||
conan:
|
||||
description: "The concan version to install."
|
||||
description: "The conan version to install."
|
||||
required: false
|
||||
meson:
|
||||
description: "The meson version to install."
|
||||
required: false
|
||||
|
||||
runs:
|
||||
|
|
|
@ -2,6 +2,7 @@ import * as core from "@actions/core"
|
|||
import { setupCmake } from "./cmake/cmake"
|
||||
import { setupConan } from "./conan/conan"
|
||||
import { setupLLVM } from "./llvm/llvm"
|
||||
import { setupMeson } from "./meson/meson"
|
||||
import { setupNinja } from "./ninja/ninja"
|
||||
|
||||
function maybeGetInput(key: string) {
|
||||
|
@ -33,6 +34,12 @@ export async function main(): Promise<number> {
|
|||
await setupConan(conanVersion)
|
||||
}
|
||||
|
||||
// setup meson
|
||||
const mesonVersion = maybeGetInput("meson")
|
||||
if (mesonVersion !== undefined) {
|
||||
await setupMeson(mesonVersion)
|
||||
}
|
||||
|
||||
// setup llvm
|
||||
const llvmVersion = maybeGetInput("llvm")
|
||||
if (llvmVersion !== undefined) {
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
import { setupMeson } from "../meson"
|
||||
import { spawnSync as spawn } from "child_process"
|
||||
|
||||
jest.setTimeout(100000)
|
||||
|
||||
describe("setup-meson", () => {
|
||||
it("should setup meson", async () => {
|
||||
await setupMeson("0.59.1")
|
||||
|
||||
const { status } = spawn("meson", ["--version"], {
|
||||
encoding: "utf8",
|
||||
})
|
||||
expect(status).toBe(0)
|
||||
})
|
||||
})
|
|
@ -0,0 +1,15 @@
|
|||
import { setupPip } from "../utils/setup/setupPip"
|
||||
import { addPath, startGroup, endGroup } from "@actions/core"
|
||||
|
||||
export async function setupMeson(version?: string) {
|
||||
await setupPip("meson", version)
|
||||
|
||||
if (process.platform === "linux") {
|
||||
try {
|
||||
startGroup(`Add /home/runner/.local/bin to PATH`)
|
||||
addPath("/home/runner/.local/bin/")
|
||||
} finally {
|
||||
endGroup()
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue