setup-cpp
Version:
Install all the tools required for building and testing C++/C projects.
32 lines (26 loc) • 962 B
text/typescript
import ciInfo from "ci-info"
const { GITHUB_ACTIONS } = ciInfo
import { cleanupTmpDir, setupTmpDir, testBin } from "../../utils/tests/test-helpers.js"
import { getVersion } from "../../versions/versions.js"
import { setupTask } from "../task.js"
jest.setTimeout(300000)
describe("setup-task", () => {
let directory: string
beforeAll(async () => {
directory = await setupTmpDir("task")
process.env.CACHE_TOOLS = "true"
})
it("should setup task", async () => {
const { binDir } = await setupTask(getVersion("task", "true"), directory, process.arch)
await testBin("task", ["--version"], binDir)
})
it("should find task in the cache", async () => {
const { binDir } = await setupTask(getVersion("task", "true"), directory, process.arch)
if (GITHUB_ACTIONS) {
expect(binDir).toMatch(process.env.RUNNER_TOOL_CACHE ?? "hostedtoolcache")
}
})
afterEach(async () => {
await cleanupTmpDir("task")
}, 100000)
})