mirror of
https://github.com/actions/runner-images.git
synced 2025-12-14 22:05:17 +00:00
44 lines
1.8 KiB
PowerShell
44 lines
1.8 KiB
PowerShell
Describe "Rust" {
|
|
BeforeAll {
|
|
$env:RUSTUP_HOME = "C:\Users\Default\.rustup"
|
|
$env:CARGO_HOME = "C:\Users\Default\.cargo"
|
|
$env:Path += ";$env:CARGO_HOME\bin"
|
|
}
|
|
|
|
if (Test-IsWin25) {
|
|
$rustTools = @(
|
|
@{ToolName = "rustup"; binPath = "C:\Users\Default\.cargo\bin\rustup.exe"}
|
|
@{ToolName = "rustc"; binPath = "C:\Users\Default\.cargo\bin\rustc.exe"}
|
|
@{ToolName = "cargo"; binPath = "C:\Users\Default\.cargo\bin\cargo.exe"}
|
|
)
|
|
} else {
|
|
$rustTools = @(
|
|
@{ToolName = "rustup"; binPath = "C:\Users\Default\.cargo\bin\rustup.exe"}
|
|
@{ToolName = "rustc"; binPath = "C:\Users\Default\.cargo\bin\rustc.exe"}
|
|
@{ToolName = "bindgen.exe"; binPath = "C:\Users\Default\.cargo\bin\bindgen.exe"}
|
|
@{ToolName = "cbindgen.exe"; binPath = "C:\Users\Default\.cargo\bin\cbindgen.exe"}
|
|
@{ToolName = "cargo"; binPath = "C:\Users\Default\.cargo\bin\cargo.exe"}
|
|
@{ToolName = "cargo audit"; binPath = "C:\Users\Default\.cargo\bin\cargo-audit.exe"}
|
|
@{ToolName = "cargo outdated"; binPath = "C:\Users\Default\.cargo\bin\cargo-outdated.exe"}
|
|
)
|
|
}
|
|
|
|
$rustEnvNotExists = @(
|
|
@{envVar = "RUSTUP_HOME"}
|
|
@{envVar = "CARGO_HOME"}
|
|
)
|
|
|
|
It "C:\Users\Default\.rustup and C:\Users\Default\.cargo folders exist" {
|
|
"C:\Users\Default\.rustup", "C:\Users\Default\.cargo" | Should -Exist
|
|
}
|
|
|
|
It "<envVar> environment variable does not exist" -TestCases $rustEnvNotExists {
|
|
[Environment]::GetEnvironmentVariables("Machine").ContainsKey($envVar) | Should -BeFalse
|
|
}
|
|
|
|
It "<ToolName> is installed to the '<binPath>' folder" -TestCases $rustTools {
|
|
"$ToolName --version" | Should -ReturnZeroExitCode
|
|
$binPath | Should -Exist
|
|
}
|
|
}
|