mirror of
https://github.com/actions/runner-images.git
synced 2025-12-20 06:35:47 +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" {
|
||||
"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
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user