mirror of https://github.com/aminya/setup-cpp
fix: configurable runner tool cache + disabled by default
Runner tool cache can fill up the disk space (e.g. for LLVM), so it is disabled by default
This commit is contained in:
parent
76b3fd37b4
commit
e2c1dd3622
|
@ -3,6 +3,9 @@ description: "Install all the tools required for building and testing C++/C proj
|
|||
author: "Amin Yahyaabadi"
|
||||
|
||||
inputs:
|
||||
cache-tools:
|
||||
description: "If should cache the installed tools? (Default: false)"
|
||||
required: false
|
||||
compiler:
|
||||
description: "The compiler to use and its optional version separated by - e.g. llvm-13.0.0"
|
||||
required: false
|
||||
|
|
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
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -9,6 +9,7 @@ describe("setup-cmake", () => {
|
|||
let directory: string
|
||||
beforeAll(async () => {
|
||||
directory = await setupTmpDir("cmake")
|
||||
process.env.CACHE_TOOLS = "true"
|
||||
})
|
||||
|
||||
it("should setup CMake", async () => {
|
||||
|
|
|
@ -14,6 +14,7 @@ describe("setup-ninja", () => {
|
|||
let directory: string
|
||||
beforeEach(async () => {
|
||||
directory = await setupTmpDir("ninja")
|
||||
process.env.CACHE_TOOLS = "true"
|
||||
})
|
||||
|
||||
it("should setup Ninja", async () => {
|
||||
|
|
|
@ -8,6 +8,7 @@ describe("setup-task", () => {
|
|||
let directory: string
|
||||
beforeAll(async () => {
|
||||
directory = await setupTmpDir("task")
|
||||
process.env.CACHE_TOOLS = "true"
|
||||
})
|
||||
|
||||
it("should setup task", async () => {
|
||||
|
|
|
@ -7,6 +7,7 @@ import { tmpdir } from "os"
|
|||
import { GITHUB_ACTIONS } from "ci-info"
|
||||
import { pathExists } from "path-exists"
|
||||
import retry from "retry-as-promised"
|
||||
import { maybeGetInput } from "../../cli-options"
|
||||
import { hasDnf } from "../env/hasDnf"
|
||||
import { isArch } from "../env/isArch"
|
||||
import { isUbuntu } from "../env/isUbuntu"
|
||||
|
@ -132,8 +133,10 @@ export async function setupBin(
|
|||
|
||||
// check if inside Github Actions. If so, cache the installation
|
||||
if (GITHUB_ACTIONS && typeof process.env.RUNNER_TOOL_CACHE === "string") {
|
||||
if (maybeGetInput("cache-tools") === "true" || process.env.CACHE_TOOLS === "true") {
|
||||
await cacheDir(setupDir, name, version)
|
||||
}
|
||||
}
|
||||
|
||||
return { installDir, binDir }
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue