mirror of
https://github.com/actions/runner-images.git
synced 2025-12-15 14:17:22 +00:00
[Windows] Rework Kotlin installation (#4083)
This commit is contained in:
committed by
GitHub
parent
db5e4084fe
commit
ecfc9c43da
18
images/win/scripts/Installers/Install-Kotlin.ps1
Normal file
18
images/win/scripts/Installers/Install-Kotlin.ps1
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
################################################################################
|
||||||
|
## File: Install-Kotlin.ps1
|
||||||
|
## Desc: Install Kotlin
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
# Install Kotlin
|
||||||
|
$url = "https://api.github.com/repos/JetBrains/kotlin/releases/latest"
|
||||||
|
[System.String] $kotlinLatest = (Invoke-RestMethod -Uri $url).assets.browser_download_url -match "kotlin-compiler"
|
||||||
|
$kotlinInstallerPath = Start-DownloadWithRetry -Url $kotlinLatest -Name "kotlin-compiler.zip"
|
||||||
|
|
||||||
|
Write-Host "Expand Kotlin archive"
|
||||||
|
$kotlinPath = "C:\tools"
|
||||||
|
Extract-7Zip -Path $kotlinInstallerPath -DestinationPath $kotlinPath
|
||||||
|
|
||||||
|
# Add to PATH
|
||||||
|
Add-MachinePathItem "$kotlinPath\kotlinc\bin"
|
||||||
|
|
||||||
|
Invoke-PesterTests -TestFile "Tools" -TestName "Kotlin"
|
||||||
@@ -102,12 +102,4 @@ Describe "CMake" {
|
|||||||
It "cmake" {
|
It "cmake" {
|
||||||
"cmake --version" | Should -ReturnZeroExitCode
|
"cmake --version" | Should -ReturnZeroExitCode
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Describe "Kotlin" {
|
|
||||||
$kotlinPackages = @("kotlinc", "kotlinc-js", "kotlinc-jvm")
|
|
||||||
|
|
||||||
It "<toolName> is available" -TestCases ($kotlinPackages | ForEach-Object { @{ toolName = $_ } }) {
|
|
||||||
"$toolName -version" | Should -ReturnZeroExitCode
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -173,3 +173,11 @@ Describe "Pipx" {
|
|||||||
"pipx --version" | Should -ReturnZeroExitCode
|
"pipx --version" | Should -ReturnZeroExitCode
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Describe "Kotlin" {
|
||||||
|
$kotlinPackages = @("kapt", "kotlin", "kotlinc", "kotlin-dce-js", "kotlinc-js", "kotlinc-jvm")
|
||||||
|
|
||||||
|
It "<toolName> is available" -TestCases ($kotlinPackages | ForEach-Object { @{ toolName = $_ } }) {
|
||||||
|
"$toolName -version" | Should -ReturnZeroExitCode
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -401,7 +401,6 @@
|
|||||||
{ "name": "tortoisesvn" },
|
{ "name": "tortoisesvn" },
|
||||||
{ "name": "swig" },
|
{ "name": "swig" },
|
||||||
{ "name": "vswhere" },
|
{ "name": "vswhere" },
|
||||||
{ "name": "kotlinc" },
|
|
||||||
{
|
{
|
||||||
"name": "julia",
|
"name": "julia",
|
||||||
"args": [ "--ia", "/DIR=C:\\Julia" ]
|
"args": [ "--ia", "/DIR=C:\\Julia" ]
|
||||||
|
|||||||
@@ -431,7 +431,6 @@
|
|||||||
{ "name": "tortoisesvn" },
|
{ "name": "tortoisesvn" },
|
||||||
{ "name": "swig" },
|
{ "name": "swig" },
|
||||||
{ "name": "vswhere" },
|
{ "name": "vswhere" },
|
||||||
{ "name": "kotlinc" },
|
|
||||||
{
|
{
|
||||||
"name": "julia",
|
"name": "julia",
|
||||||
"args": [ "--ia", "/DIR=C:\\Julia" ]
|
"args": [ "--ia", "/DIR=C:\\Julia" ]
|
||||||
|
|||||||
@@ -255,7 +255,6 @@
|
|||||||
{ "name": "tortoisesvn" },
|
{ "name": "tortoisesvn" },
|
||||||
{ "name": "swig" },
|
{ "name": "swig" },
|
||||||
{ "name": "vswhere" },
|
{ "name": "vswhere" },
|
||||||
{ "name": "kotlinc" },
|
|
||||||
{
|
{
|
||||||
"name": "julia",
|
"name": "julia",
|
||||||
"args": [ "--ia", "/DIR=C:\\Julia" ]
|
"args": [ "--ia", "/DIR=C:\\Julia" ]
|
||||||
|
|||||||
@@ -187,6 +187,7 @@
|
|||||||
"{{ template_dir }}/scripts/Installers/Install-AliyunCli.ps1",
|
"{{ template_dir }}/scripts/Installers/Install-AliyunCli.ps1",
|
||||||
"{{ template_dir }}/scripts/Installers/Install-PostgreSQL.ps1",
|
"{{ template_dir }}/scripts/Installers/Install-PostgreSQL.ps1",
|
||||||
"{{ template_dir }}/scripts/Installers/Install-JavaTools.ps1",
|
"{{ template_dir }}/scripts/Installers/Install-JavaTools.ps1",
|
||||||
|
"{{ template_dir }}/scripts/Installers/Install-Kotlin.ps1",
|
||||||
"{{ template_dir }}/scripts/Installers/Install-Ruby.ps1",
|
"{{ template_dir }}/scripts/Installers/Install-Ruby.ps1",
|
||||||
"{{ template_dir }}/scripts/Installers/Install-PyPy.ps1",
|
"{{ template_dir }}/scripts/Installers/Install-PyPy.ps1",
|
||||||
"{{ template_dir }}/scripts/Installers/Install-Toolset.ps1",
|
"{{ template_dir }}/scripts/Installers/Install-Toolset.ps1",
|
||||||
|
|||||||
@@ -182,7 +182,8 @@
|
|||||||
"{{ template_dir }}/scripts/Installers/Install-AzureDevOpsCli.ps1",
|
"{{ template_dir }}/scripts/Installers/Install-AzureDevOpsCli.ps1",
|
||||||
"{{ template_dir }}/scripts/Installers/Install-NodeLts.ps1",
|
"{{ template_dir }}/scripts/Installers/Install-NodeLts.ps1",
|
||||||
"{{ template_dir }}/scripts/Installers/Install-CommonUtils.ps1",
|
"{{ template_dir }}/scripts/Installers/Install-CommonUtils.ps1",
|
||||||
"{{ template_dir }}/scripts/Installers/Install-JavaTools.ps1"
|
"{{ template_dir }}/scripts/Installers/Install-JavaTools.ps1",
|
||||||
|
"{{ template_dir }}/scripts/Installers/Install-Kotlin.ps1"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -166,7 +166,8 @@
|
|||||||
"{{ template_dir }}/scripts/Installers/Install-AzureDevOpsCli.ps1",
|
"{{ template_dir }}/scripts/Installers/Install-AzureDevOpsCli.ps1",
|
||||||
"{{ template_dir }}/scripts/Installers/Install-NodeLts.ps1",
|
"{{ template_dir }}/scripts/Installers/Install-NodeLts.ps1",
|
||||||
"{{ template_dir }}/scripts/Installers/Install-CommonUtils.ps1",
|
"{{ template_dir }}/scripts/Installers/Install-CommonUtils.ps1",
|
||||||
"{{ template_dir }}/scripts/Installers/Install-JavaTools.ps1"
|
"{{ template_dir }}/scripts/Installers/Install-JavaTools.ps1",
|
||||||
|
"{{ template_dir }}/scripts/Installers/Install-Kotlin.ps1"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user