feat: support installing gnu make

This commit is contained in:
Amin Yahyaabadi 2022-01-30 14:40:11 -08:00
parent 5c0c45d42f
commit 4b0650a08c
7 changed files with 43 additions and 2 deletions

View File

@ -23,6 +23,7 @@ The package can be used locally or from CI services like GitHub Actions.
- vcpkg - vcpkg
- meson - meson
- conan - conan
- make
- ccache - ccache
- cppcheck - cppcheck
- clangtidy - clangtidy

View File

@ -30,6 +30,9 @@ inputs:
conan: conan:
description: "The conan version to install." description: "The conan version to install."
required: false required: false
make:
description: "The make version to install."
required: false
vcpkg: vcpkg:
description: "The vcpkg version to install." description: "The vcpkg version to install."
required: false required: false

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 * as core from "@actions/core" import * as core from "@actions/core"
import { setupBrew } from "./brew/brew" import { setupBrew } from "./brew/brew"
import { setupCcache } from "./ccache/ccache" import { setupCcache } from "./ccache/ccache"
import { setupMake } from "./make/make"
import { setupChocolatey } from "./chocolatey/chocolatey" import { setupChocolatey } from "./chocolatey/chocolatey"
import { setupCmake } from "./cmake/cmake" import { setupCmake } from "./cmake/cmake"
import { setupConan } from "./conan/conan" import { setupConan } from "./conan/conan"
@ -50,6 +51,7 @@ const setups = {
msvc: setupMSVC, msvc: setupMSVC,
vcvarsall: setupVCVarsall, vcvarsall: setupVCVarsall,
kcov: setupKcov, kcov: setupKcov,
make: setupMake,
} }
/** The tools that can be installed */ /** The tools that can be installed */
@ -74,6 +76,7 @@ const tools: Array<keyof typeof setups> = [
"msvc", "msvc",
"vcvarsall", "vcvarsall",
"kcov", "kcov",
"make",
] ]
/** The possible inputs to the program */ /** The possible inputs to the program */
@ -282,6 +285,7 @@ All the available tools:
--vcpkg --vcpkg
--meson --meson
--conan --conan
--make
--ccache --ccache
--cppcheck --cppcheck
--clangformat --clangformat

View File

@ -0,0 +1,12 @@
import { setupMake } from "../make"
import { testBin } from "../../utils/tests/test-helpers"
import { InstallationInfo } from "../../utils/setup/setupBin"
jest.setTimeout(300000)
describe("setup-make", () => {
it("should setup make", async () => {
const installInfo = await setupMake("", "", process.arch)
await testBin("make", ["--version"], (installInfo as InstallationInfo | undefined)?.binDir)
})
})

21
src/make/make.ts Normal file
View File

@ -0,0 +1,21 @@
import { setupAptPack } from "../utils/setup/setupAptPack"
import { setupBrewPack } from "../utils/setup/setupBrewPack"
import { setupChocoPack } from "../utils/setup/setupChocoPack"
// eslint-disable-next-line @typescript-eslint/no-unused-vars
export function setupMake(version: string, _setupDir: string, _arch: string) {
switch (process.platform) {
case "win32": {
return setupChocoPack("make", version)
}
case "darwin": {
return setupBrewPack("make", version)
}
case "linux": {
return setupAptPack("make", version)
}
default: {
throw new Error(`Unsupported platform`)
}
}
}