Skip to content

Commit 26bd7cd

Browse files
committed
fix: allow partial options for setup tools
1 parent 6f1d3cd commit 26bd7cd

File tree

51 files changed

+148
-178
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+148
-178
lines changed

dist/legacy/setup-cpp.js

Lines changed: 33 additions & 33 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.mjs

Lines changed: 33 additions & 37 deletions
Large diffs are not rendered by default.

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

packages/setup-apt/src/nala.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { qualifiedNeededAptPackage } from "./qualify-install.js"
1111

1212
let binDir: string | undefined
1313

14-
export async function setupNala(version?: string) {
14+
export async function setupNala({ version }: Partial<Pick<SetupOptions, "version">> = {}) {
1515
if (!hasAptGet()) {
1616
return undefined
1717
}
@@ -94,3 +94,7 @@ export function bashWithNala(script: string) {
9494
}
9595
return script
9696
}
97+
function isUbuntu() {
98+
throw new Error("Function not implemented.")
99+
}
100+

src/actions-input.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { getInput } from "@actions/core"
2+
3+
/** Get an object from github actions */
4+
5+
export function maybeGetInput(key: string) {
6+
const value = getInput(key.toLowerCase())
7+
if (value !== "false" && value !== "") {
8+
return value
9+
}
10+
return undefined // skip installation
11+
}

src/bazel/__tests__/bazel.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ describe("setup-bazel", () => {
1111
return
1212
}
1313
it("should setup bazel", async () => {
14-
const installInfo = await setupBazel({ version: "", setupDir: "", arch: process.arch })
14+
const installInfo = await setupBazel()
1515

1616
await testBin("bazel", ["--version"], (installInfo as InstallationInfo | undefined)?.binDir)
1717
})

src/bazel/bazel.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { isArch } from "../utils/env/isArch.js"
99
import { setupChocoPack } from "../utils/setup/setupChocoPack.js"
1010
import { setupDnfPack } from "../utils/setup/setupDnfPack.js"
1111

12-
export async function setupBazel({ version }: SetupOptions) {
12+
export async function setupBazel({ version }: Partial<Pick<SetupOptions, "version">> = {}) {
1313
switch (process.platform) {
1414
case "win32": {
1515
// install bazelisk because it contains both

src/ccache/__tests__/ccache.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { setupCcache } from "../ccache.js"
55
jest.setTimeout(300000)
66
describe("setup-ccache", () => {
77
it("should setup ccache", async () => {
8-
const installInfo = await setupCcache({ version: "", setupDir: "", arch: process.arch })
8+
const installInfo = await setupCcache()
99

1010
await testBin("ccache", ["--version"], (installInfo as InstallationInfo | undefined)?.binDir)
1111
})

src/ccache/ccache.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { setupChocoPack } from "../utils/setup/setupChocoPack.js"
88
import { setupDnfPack } from "../utils/setup/setupDnfPack.js"
99
import { setupPacmanPack } from "../utils/setup/setupPacmanPack.js"
1010

11-
export async function setupCcache({ version }: SetupOptions) {
11+
export async function setupCcache({ version }: Partial<Pick<SetupOptions, "version">> = {}) {
1212
switch (process.platform) {
1313
case "win32": {
1414
return setupChocoPack("ccache", version)

0 commit comments

Comments
 (0)