mirror of
https://github.com/actions/runner-images-sangeeth.git
synced 2025-12-20 06:29:50 +00:00
[Windows] Pin PostgreSQL version installed in the toolset (#4492)
This commit is contained in:
@@ -6,8 +6,12 @@ $pgPwd = "root"
|
|||||||
Set-SystemVariable -SystemVariable PGUSER -Value $pgUser
|
Set-SystemVariable -SystemVariable PGUSER -Value $pgUser
|
||||||
Set-SystemVariable -SystemVariable PGPASSWORD -Value $pgPwd
|
Set-SystemVariable -SystemVariable PGPASSWORD -Value $pgPwd
|
||||||
|
|
||||||
|
# Define latest available version to install based on version specified in the toolset
|
||||||
|
$toolsetVersion = (Get-ToolsetContent).postgresql.version
|
||||||
|
$latestChocoPackage = Get-LatestChocoPackageVersion -TargetVersion $toolsetVersion -PackageName "postgresql"
|
||||||
|
|
||||||
# Install latest PostgreSQL
|
# Install latest PostgreSQL
|
||||||
Choco-Install -PackageName postgresql -ArgumentList "--params", "'/Password:$pgPwd /NoPath'", "--params-global"
|
Choco-Install -PackageName postgresql -ArgumentList "--params", "'/Password:$pgPwd /NoPath'", "--params-global", "--version=$latestChocoPackage"
|
||||||
|
|
||||||
# Get Path to pg_ctl.exe
|
# Get Path to pg_ctl.exe
|
||||||
$pgPath = (Get-CimInstance Win32_Service -Filter "Name LIKE 'postgresql-%'").PathName
|
$pgPath = (Get-CimInstance Win32_Service -Filter "Name LIKE 'postgresql-%'").PathName
|
||||||
|
|||||||
@@ -51,6 +51,16 @@ Describe "PostgreSQL" {
|
|||||||
$StartType | Should -Be "Disabled"
|
$StartType | Should -Be "Disabled"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Context "PostgreSQL version" {
|
||||||
|
It "PostgreSQL version should correspond to the version in the toolset" {
|
||||||
|
$toolsetVersion = (Get-ToolsetContent).postgresql.version
|
||||||
|
# Client version
|
||||||
|
(&$Env:PGBIN\psql --version).split()[-1] | Should -BeLike "$toolsetVersion*"
|
||||||
|
# Server version
|
||||||
|
(&$Env:PGBIN\pg_config --version).split()[-1] | Should -BeLike "$toolsetVersion*"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Describe "MySQL" {
|
Describe "MySQL" {
|
||||||
|
|||||||
@@ -432,5 +432,8 @@
|
|||||||
},
|
},
|
||||||
"llvm": {
|
"llvm": {
|
||||||
"version": "13"
|
"version": "13"
|
||||||
|
},
|
||||||
|
"postgresql": {
|
||||||
|
"version": "14"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -464,5 +464,8 @@
|
|||||||
},
|
},
|
||||||
"llvm": {
|
"llvm": {
|
||||||
"version": "13"
|
"version": "13"
|
||||||
|
},
|
||||||
|
"postgresql": {
|
||||||
|
"version": "14"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -313,5 +313,8 @@
|
|||||||
},
|
},
|
||||||
"php": {
|
"php": {
|
||||||
"version": "8.0"
|
"version": "8.0"
|
||||||
|
},
|
||||||
|
"postgresql": {
|
||||||
|
"version": "14"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user