-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Add CI Test Run using Latest JDK #31003
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
10582ff
49ff15c
eda4099
ed722c4
71ec979
a81e41f
9c78840
4db637f
0ab213f
aa32761
1f8cf2f
a8b9456
b73ad6b
c204416
0142fa6
683dd5b
7327b7d
e25964d
6b7567f
7d5fc36
753c241
bb0eca2
49e87e0
1950e3f
0a7dc80
979f271
d03b376
9c9bb83
9cb275d
78dc5f5
0eac84d
4650f90
bc1b1f0
4be2dac
bd4a401
c5c2827
a412183
195e8b9
80a648e
f8c82fd
24ff6c4
3069f7f
8f96251
32f8ef1
1fdda59
fb044e0
dce9246
c06afef
a4455c8
a990ac6
4fd2c4e
0243b1b
5d6f955
c5ece2f
61b5755
29a0537
a76a7c3
7c1b76d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -50,6 +50,16 @@ | |
| "TestFromSource": false, | ||
| "TestGoals": "surefire:test", | ||
| "TestOptions": "" | ||
| }, | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll have to look, but I wonder if there are some opportunities to consolidate the matrix again. |
||
| { | ||
| "Agent": { | ||
| "ubuntu-20.04": { "OSVmImage": "MMSUbuntu20.04", "Pool": "azsdk-pool-mms-ubuntu-2004-general" } | ||
| }, | ||
| "JavaTestVersion": "1.19", | ||
|
alzimmermsft marked this conversation as resolved.
|
||
| "AZURE_TEST_HTTP_CLIENTS": "netty", | ||
| "TestFromSource": false, | ||
| "TestGoals": "surefire:test", | ||
| "TestOptions": "" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You could roll this into the above include if you think it would be simpler by just adding 1.18 to the JavaTestVersion value (since all other values are the same). |
||
| } | ||
| ] | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| steps: | ||
| # Non-standard JDK versions are only supported in Linux. | ||
| # Make the assumption here Linux is being used, if it's not it's a configuration issue that needs to be fixed there. | ||
| - task: Cache@2 | ||
| inputs: | ||
| key: 'jdk | "$(JavaTestVersion)" | "$(CacheSalt)" | "$(Agent.OS)"' | ||
| path: $(Agent.BuildDirectory)/jdk-$(LatestJdkFeatureVersion) | ||
| displayName: 'Cache Latest JDK' | ||
| condition: eq(variables['LatestJdkVersion'], variables['JavaTestVersion']) | ||
|
|
||
| - task: PowerShell@2 | ||
| displayName: 'Install Latest JDK' | ||
| inputs: | ||
| pwsh: true | ||
| arguments: > | ||
| -JdkFeatureVersion $(LatestJdkFeatureVersion) | ||
| workingDirectory: $(Agent.BuildDirectory) | ||
| filePath: eng/scripts/Install-Latest-JDK.ps1 | ||
| condition: eq(variables['LatestJdkVersion'], variables['JavaTestVersion']) | ||
|
|
||
| - pwsh: | | ||
| Write-Host "Java 8 JDK: $Env:JAVA_HOME_8_X64" | ||
| Write-Host "Java 11 JDK: $Env:JAVA_HOME_11_X64" | ||
| Write-Host "Java 17 JDK: $Env:JAVA_HOME_17_X64" | ||
| Write-Host "Latest JDK: $Env:JAVA_HOME_$(LatestJdkFeatureVersion)_X64" | ||
| displayName: 'Verify Latest JDK Install' | ||
| condition: eq(variables['LatestJdkVersion'], variables['JavaTestVersion']) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| [CmdletBinding()] | ||
| param( | ||
| [Parameter(Mandatory=$true)] | ||
| [string]$JdkFeatureVersion | ||
| ) | ||
|
|
||
| # Query Adoptium for the list of installs for the JDK feature version. | ||
| $adoptiumApiUrl = "https://api.adoptium.net" | ||
| $os | ||
|
|
||
| if ($IsWindows) { | ||
| $os = "windows" | ||
| } elseif ($IsMacOS) { | ||
| $os = "mac" | ||
| } else { | ||
| $os = "linux" | ||
| } | ||
|
|
||
| $getInstalls = "$adoptiumApiUrl/v3/assets/latest/$JdkFeatureVersion/hotspot?architecture=x64&image_type=jdk&os=$os&vendor=eclipse" | ||
| $jdkUnzipName = "jdk-$JdkFeatureVersion" | ||
|
|
||
| Write-Host "Downloading latest JDK to" (Get-Location) | ||
|
|
||
| if (!(Test-Path -Path $jdkUnzipName -PathType container)) { | ||
| # Query Adoptium for the list of installs for the JDK feature version. | ||
| Write-Host "Inkvoking web request to '$getInstalls' to find JDK $JdkFeatureVersion installs available on $os." | ||
| $installsAvailable = Invoke-WebRequest -URI $getInstalls | ConvertFrom-Json | ||
| $jdkLink = $installsAvailable.binary.package.link | ||
| $jdkZipName = $jdkLink.split("/")[-1] | ||
|
|
||
| Write-Host "Downloading install from '$jdkLink' to '$jdkZipName'." | ||
| Invoke-WebRequest -URI $jdkLink -OutFile $jdkZipName | ||
|
|
||
| if ($IsWindows) { | ||
| Expand-Archive -Path $jdkZipName -Destination "jdk-temp" | ||
| Move-Item -Path (Join-Path -Path "jdk-temp" -ChildPath (Get-ChildItem "jdk-temp")[0].Name) -Destination $jdkUnzipName | ||
| } else { | ||
| New-Item -Path "jdk-temp" -ItemType "directory" | ||
| tar -xvf $jdkZipName -C "jdk-temp" | ||
| Move-Item -Path (Join-Path -Path "jdk-temp" -ChildPath (Get-ChildItem "jdk-temp")[0].Name) -Destination $jdkUnzipName | ||
| } | ||
|
|
||
| } | ||
|
|
||
| $javaHome = (Convert-Path $jdkUnzipName) | ||
| Write-Host "Latest JDK: $javaHome" | ||
|
|
||
| Write-Host "Current JAVA_HOME: $Env:JAVA_HOME" | ||
| Write-Host "##vso[task.setvariable variable=JAVA_HOME;]$javaHome" | ||
| Write-Host "Updated JAVA_HOME: $Env:JAVA_HOME" | ||
|
|
||
| $jdkFeatureVersionJavaHome = "JAVA_HOME_" + $JdkFeatureVersion + "_X64" | ||
| Write-Host "##vso[task.setvariable variable=$jdkFeatureVersionJavaHome;]$javaHome" |
Uh oh!
There was an error while loading. Please reload this page.