mirror of
https://github.com/actions/runner-images-sangeeth.git
synced 2025-12-29 21:07:59 +08:00
[windows] Improve MSYS2 installation (#3652)
This commit is contained in:
@@ -1,6 +1,3 @@
|
||||
$toolsetContent = (Get-ToolsetContent).MsysPackages
|
||||
$archs = $toolsetContent.mingw.arch
|
||||
|
||||
BeforeAll {
|
||||
$msys2Dir = "C:\msys64\usr\bin"
|
||||
$originalPath = $env:PATH
|
||||
@@ -34,31 +31,23 @@ Describe "MSYS2 packages" {
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($arch in $archs) {
|
||||
Describe "$arch arch packages" {
|
||||
$archPackages = $toolsetContent.mingw | Where-Object { $_.arch -eq $arch }
|
||||
$tools = $archPackages.runtime_packages.name
|
||||
|
||||
if ($arch -eq "mingw-w64-i686")
|
||||
{
|
||||
$ExecDir = "C:\msys64\mingw32\bin"
|
||||
}
|
||||
else
|
||||
{
|
||||
$ExecDir = "C:\msys64\mingw64\bin"
|
||||
}
|
||||
$mingwTypes = (Get-ToolsetContent).MsysPackages.mingw
|
||||
foreach ($mingwType in $mingwTypes) {
|
||||
Describe "$($mingwType.arch) packages" {
|
||||
$tools = $mingwType.runtime_packages
|
||||
$execDir = Join-Path "C:\msys64" $mingwType.exec_dir | Join-Path -ChildPath "bin"
|
||||
|
||||
foreach ($tool in $tools) {
|
||||
Context "$tool package"{
|
||||
$executables = ($archPackages.runtime_packages | Where-Object { $_.name -eq $tool }).executables | ForEach-Object {
|
||||
Context "$($tool.name) package"{
|
||||
$executables = $tool.executables | ForEach-Object {
|
||||
@{
|
||||
ExecName = $_
|
||||
ExecDir = $ExecDir
|
||||
ExecDir = $execDir
|
||||
}
|
||||
}
|
||||
|
||||
BeforeEach {
|
||||
$env:PATH = "$ExecDir;$env:PATH"
|
||||
$env:PATH = "$execDir;$env:PATH"
|
||||
}
|
||||
|
||||
It "<ExecName> is installed in <ExecDir>" -TestCases $executables {
|
||||
|
||||
Reference in New Issue
Block a user