mirror of https://github.com/aminya/setup-cpp
test: pass the install directory for powershell
This commit is contained in:
parent
20c025d4d7
commit
c2afe421b0
|
@ -84,7 +84,7 @@ jobs:
|
|||
- windows-2022
|
||||
- ubuntu-24.04
|
||||
- macos-13
|
||||
- macos-12
|
||||
# - macos-12
|
||||
node:
|
||||
- 22
|
||||
pnpm:
|
||||
|
|
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
|
@ -1,18 +1,28 @@
|
|||
import { GITHUB_ACTIONS } from "ci-info"
|
||||
import { testBin } from "../../utils/tests/test-helpers.js"
|
||||
import { cleanupTmpDir, setupTmpDir, testBin } from "../../utils/tests/test-helpers.js"
|
||||
import { getVersion } from "../../versions/versions.js"
|
||||
import { setupPowershell } from "../powershell.js"
|
||||
|
||||
jest.setTimeout(300000)
|
||||
describe("setup-powershell", () => {
|
||||
let directory: string
|
||||
beforeEach(async () => {
|
||||
directory = await setupTmpDir("powershell")
|
||||
process.env.CACHE_TOOLS = "true"
|
||||
})
|
||||
|
||||
it("should setup powershell", async () => {
|
||||
if (process.platform === "win32" && GITHUB_ACTIONS) {
|
||||
// results in errors
|
||||
return
|
||||
}
|
||||
|
||||
const installInfo = await setupPowershell(getVersion("powershell", undefined), "", process.arch)
|
||||
const installInfo = await setupPowershell(getVersion("powershell", undefined), directory, process.arch)
|
||||
|
||||
await testBin("pwsh", ["--version"], installInfo.binDir)
|
||||
})
|
||||
|
||||
afterEach(async () => {
|
||||
await cleanupTmpDir("ninja")
|
||||
}, 100000)
|
||||
})
|
||||
|
|
|
@ -137,7 +137,7 @@ async function tryDownload(name: string, version: string, url: string) {
|
|||
info(`Download ${name} ${version}`)
|
||||
// try to download the package 4 times with 2 seconds delay
|
||||
const downloaded = await retry(
|
||||
async () => {
|
||||
() => {
|
||||
const downloadedFilePath = join(process.env.RUNNER_TEMP ?? tmpdir(), `${Date.now()}-${basename(url)}`)
|
||||
|
||||
return downloadTool(url, downloadedFilePath)
|
||||
|
|
Loading…
Reference in New Issue