Skip to content
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

Drop net6.0 target and use net6.0 to run netstandard2.1 tests, #1020 #1039

Merged
merged 9 commits into from
Nov 21, 2024
25 changes: 0 additions & 25 deletions .build/azure-templates/run-tests-on-os.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,31 +132,6 @@ steps:
displayName: 'Use .NET SDK 6.0.421 (x86)'
condition: and(succeeded(), contains('${{ parameters.framework }}', 'net6.'), eq('${{ parameters.vsTestPlatform }}', 'x86'))

- task: UseDotNet@2
displayName: 'Use .NET SDK 5.0.408'
inputs:
packageType: 'sdk'
version: '5.0.408'
performMultiLevelLookup: '${{ variables.PerformMultiLevelLookup }}'
condition: and(succeeded(), contains('${{ parameters.framework }}', 'net5.'))

# Hack: .NET 8 no longer installs the x86 bits and they must be installed separately. However, it is not
# trivial to get it into the path and to get it to pass the minimum SDK version check in runbuild.ps1.
# So, we install it afterward and set the environment variable so the above SDK can delegate to it.
# This code only works on Windows.
- pwsh: |
$sdkVersion = '5.0.408'
$architecture = '${{ parameters.vsTestPlatform }}'
$installScriptPath = "${env:AGENT_TEMPDIRECTORY}/dotnet-install.ps1"
$installScriptUrl = "https://raw.githubusercontent.com/dotnet/install-scripts/main/src/dotnet-install.ps1"
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Invoke-WebRequest $installScriptUrl -OutFile $installScriptPath -TimeoutSec 60
$installPath = "${env:ProgramFiles(x86)}/dotnet"
& $installScriptPath -Version $sdkVersion -Architecture $architecture -InstallDir $installPath
Write-Host "##vso[task.setvariable variable=DOTNET_ROOT_X86;]$installPath"
displayName: 'Use .NET SDK 5.0.408 (x86)'
condition: and(succeeded(), contains('${{ parameters.framework }}', 'net5.'), eq('${{ parameters.vsTestPlatform }}', 'x86'))

#- template: 'show-all-files.yml' # Uncomment for debugging
- pwsh: |
$framework = '${{ parameters.framework }}'
Expand Down
37 changes: 12 additions & 25 deletions .github/workflows/Generate-TestWorkflows.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@

.PARAMETER TestFrameworks
A string array of Dotnet target framework monikers to run the tests on. The default is
@('net6.0', 'net5.0','net472','net48').
@('net8.0','net6.0','net472','net48').

.PARAMETER OperatingSystems
A string array of Github Actions operating system monikers to run the tests on.
The default is @('windows-latest', 'ubuntu-22.04').
The default is @('windows-latest', 'ubuntu-latest').

.PARAMETER TestPlatforms
A string array of platforms to run the tests on. Valid values are x64 and x86.
Expand All @@ -58,29 +58,23 @@
.PARAMETER DotNet6SDKVersion
The SDK version of .NET 6.x to install on the build agent to be used for building and
testing. This SDK is always installed on the build agent. The default is 6.0.x.

.PARAMETER DotNet5SDKVersion
The SDK version of .NET 5.x to install on the build agent to be used for building and
testing. This SDK is always installed on the build agent. The default is 5.0.x.
#>
param(
[string]$OutputDirectory = $PSScriptRoot,

[string]$RepoRoot = (Split-Path (Split-Path $PSScriptRoot)),

[string[]]$TestFrameworks = @('net8.0', 'net5.0','net472','net48'), # targets under test: net6.0, netstandard2.1, netstanard2.0, net462
[string[]]$TestFrameworks = @('net8.0','net6.0','net472','net48'), # targets under test: net8.0, netstandard2.1, netstandard2.0, net462

[string[]]$OperatingSystems = @('windows-latest', 'ubuntu-22.04'), # NOTE: ubuntu-24.04 breaks the .NET 5 build currently
[string[]]$OperatingSystems = @('windows-latest', 'ubuntu-latest'),

[string[]]$TestPlatforms = @('x64'),

[string[]]$Configurations = @('Release'),

[string]$DotNet8SDKVersion = '8.0.x',

[string]$DotNet6SDKVersion = '6.0.x',

[string]$DotNet5SDKVersion = '5.0.x'
[string]$DotNet6SDKVersion = '6.0.x'
)


Expand Down Expand Up @@ -157,12 +151,11 @@ function Write-TestWorkflow(
[string]$RelativeRoot,
[string]$ProjectPath,
[string[]]$Configurations = @('Release'),
[string[]]$TestFrameworks = @('net5.0', 'net48'),
[string[]]$TestFrameworks = @('net6.0', 'net48'),
[string[]]$TestPlatforms = @('x64'),
[string[]]$OperatingSystems = @('windows-latest', 'ubuntu-22.04', 'macos-latest'),
[string[]]$OperatingSystems = @('windows-latest', 'ubuntu-latest', 'macos-latest'),
[string]$DotNet8SDKVersion = $DotNet8SDKVersion,
[string]$DotNet6SDKVersion = $DotNet6SDKVersion,
[string]$DotNet5SDKVersion = $DotNet5SDKVersion) {
[string]$DotNet6SDKVersion = $DotNet6SDKVersion) {

$dependencies = New-Object System.Collections.Generic.HashSet[string]
Get-ProjectDependencies $ProjectPath $RelativeRoot $dependencies
Expand Down Expand Up @@ -248,9 +241,9 @@ jobs:
platform: $platforms
configuration: $configurations
exclude:
- os: ubuntu-22.04
- os: ubuntu-latest
framework: net48
- os: ubuntu-22.04
- os: ubuntu-latest
framework: net472
- os: macos-latest
framework: net48
Expand Down Expand Up @@ -282,12 +275,6 @@ jobs:
echo `"DOTNET_CLI_TELEMETRY_OPTOUT=1`" | Out-File -FilePath `$env:GITHUB_ENV -Encoding utf8 -Append
shell: pwsh

- name: Setup .NET 5 SDK
uses: actions/setup-dotnet@v3
with:
dotnet-version: '$DotNet5SDKVersion'
if: `${{ startswith(matrix.framework, 'net5.') }}

- name: Setup .NET 6 SDK
uses: actions/setup-dotnet@v3
with:
Expand Down Expand Up @@ -356,7 +343,7 @@ try {
Pop-Location
}

#Write-TestWorkflow -OutputDirectory $OutputDirectory -ProjectPath $projectPath -RelativeRoot $repoRoot -TestFrameworks @('net5.0') -OperatingSystems $OperatingSystems -TestPlatforms $TestPlatforms -Configurations $Configurations -DotNet8SDKVersion $DotNet8SDKVersion -DotNet6SDKVersion $DotNet6SDKVersion -DotNet5SDKVersion $DotNet5SDKVersion
#Write-TestWorkflow -OutputDirectory $OutputDirectory -ProjectPath $projectPath -RelativeRoot $repoRoot -TestFrameworks @('net6.0') -OperatingSystems $OperatingSystems -TestPlatforms $TestPlatforms -Configurations $Configurations -DotNet8SDKVersion $DotNet8SDKVersion -DotNet6SDKVersion $DotNet6SDKVersion

#Write-Host $TestProjects

Expand All @@ -383,5 +370,5 @@ foreach ($testProject in $TestProjects) {
Write-Host "Frameworks To Test for ${projectName}: $($frameworks -join ';')" -ForegroundColor Cyan

#Write-Host "Project: $projectName"
Write-TestWorkflow -OutputDirectory $OutputDirectory -ProjectPath $testProject -RelativeRoot $RepoRoot -TestFrameworks $frameworks -OperatingSystems $OperatingSystems -TestPlatforms $TestPlatforms -Configurations $Configurations -DotNet8SDKVersion $DotNet8SDKVersion -DotNet6SDKVersion $DotNet6SDKVersion -DotNet5SDKVersion $DotNet5SDKVersion
Write-TestWorkflow -OutputDirectory $OutputDirectory -ProjectPath $testProject -RelativeRoot $RepoRoot -TestFrameworks $frameworks -OperatingSystems $OperatingSystems -TestPlatforms $TestPlatforms -Configurations $Configurations -DotNet8SDKVersion $DotNet8SDKVersion -DotNet6SDKVersion $DotNet6SDKVersion
}
14 changes: 4 additions & 10 deletions .github/workflows/Lucene-Net-Tests-AllProjects.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,14 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-22.04]
framework: [net8.0, net5.0, net48, net472]
os: [windows-latest, ubuntu-latest]
framework: [net8.0, net6.0, net48, net472]
platform: [x64]
configuration: [Release]
exclude:
- os: ubuntu-22.04
- os: ubuntu-latest
framework: net48
- os: ubuntu-22.04
- os: ubuntu-latest
framework: net472
- os: macos-latest
framework: net48
Expand All @@ -100,12 +100,6 @@ jobs:
echo "DOTNET_CLI_TELEMETRY_OPTOUT=1" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
shell: pwsh

- name: Setup .NET 5 SDK
uses: actions/setup-dotnet@v3
with:
dotnet-version: '5.0.x'
if: ${{ startswith(matrix.framework, 'net5.') }}

- name: Setup .NET 6 SDK
uses: actions/setup-dotnet@v3
with:
Expand Down
14 changes: 4 additions & 10 deletions .github/workflows/Lucene-Net-Tests-Analysis-Common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-22.04]
framework: [net8.0, net5.0, net48, net472]
os: [windows-latest, ubuntu-latest]
framework: [net8.0, net6.0, net48, net472]
platform: [x64]
configuration: [Release]
exclude:
- os: ubuntu-22.04
- os: ubuntu-latest
framework: net48
- os: ubuntu-22.04
- os: ubuntu-latest
framework: net472
- os: macos-latest
framework: net48
Expand All @@ -84,12 +84,6 @@ jobs:
echo "DOTNET_CLI_TELEMETRY_OPTOUT=1" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
shell: pwsh

- name: Setup .NET 5 SDK
uses: actions/setup-dotnet@v3
with:
dotnet-version: '5.0.x'
if: ${{ startswith(matrix.framework, 'net5.') }}

- name: Setup .NET 6 SDK
uses: actions/setup-dotnet@v3
with:
Expand Down
14 changes: 4 additions & 10 deletions .github/workflows/Lucene-Net-Tests-Analysis-Kuromoji.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-22.04]
framework: [net8.0, net5.0, net48, net472]
os: [windows-latest, ubuntu-latest]
framework: [net8.0, net6.0, net48, net472]
platform: [x64]
configuration: [Release]
exclude:
- os: ubuntu-22.04
- os: ubuntu-latest
framework: net48
- os: ubuntu-22.04
- os: ubuntu-latest
framework: net472
- os: macos-latest
framework: net48
Expand All @@ -81,12 +81,6 @@ jobs:
echo "DOTNET_CLI_TELEMETRY_OPTOUT=1" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
shell: pwsh

- name: Setup .NET 5 SDK
uses: actions/setup-dotnet@v3
with:
dotnet-version: '5.0.x'
if: ${{ startswith(matrix.framework, 'net5.') }}

- name: Setup .NET 6 SDK
uses: actions/setup-dotnet@v3
with:
Expand Down
14 changes: 4 additions & 10 deletions .github/workflows/Lucene-Net-Tests-Analysis-Morfologik.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-22.04]
framework: [net8.0, net5.0, net48, net472]
os: [windows-latest, ubuntu-latest]
framework: [net8.0, net6.0, net48, net472]
platform: [x64]
configuration: [Release]
exclude:
- os: ubuntu-22.04
- os: ubuntu-latest
framework: net48
- os: ubuntu-22.04
- os: ubuntu-latest
framework: net472
- os: macos-latest
framework: net48
Expand All @@ -81,12 +81,6 @@ jobs:
echo "DOTNET_CLI_TELEMETRY_OPTOUT=1" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
shell: pwsh

- name: Setup .NET 5 SDK
uses: actions/setup-dotnet@v3
with:
dotnet-version: '5.0.x'
if: ${{ startswith(matrix.framework, 'net5.') }}

- name: Setup .NET 6 SDK
uses: actions/setup-dotnet@v3
with:
Expand Down
12 changes: 3 additions & 9 deletions .github/workflows/Lucene-Net-Tests-Analysis-OpenNLP.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-22.04]
os: [windows-latest, ubuntu-latest]
framework: [net8.0, net48]
platform: [x64]
configuration: [Release]
exclude:
- os: ubuntu-22.04
- os: ubuntu-latest
framework: net48
- os: ubuntu-22.04
- os: ubuntu-latest
framework: net472
- os: macos-latest
framework: net48
Expand All @@ -84,12 +84,6 @@ jobs:
echo "DOTNET_CLI_TELEMETRY_OPTOUT=1" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
shell: pwsh

- name: Setup .NET 5 SDK
uses: actions/setup-dotnet@v3
with:
dotnet-version: '5.0.x'
if: ${{ startswith(matrix.framework, 'net5.') }}

- name: Setup .NET 6 SDK
uses: actions/setup-dotnet@v3
with:
Expand Down
14 changes: 4 additions & 10 deletions .github/workflows/Lucene-Net-Tests-Analysis-Phonetic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-22.04]
framework: [net8.0, net5.0, net48, net472]
os: [windows-latest, ubuntu-latest]
framework: [net8.0, net6.0, net48, net472]
platform: [x64]
configuration: [Release]
exclude:
- os: ubuntu-22.04
- os: ubuntu-latest
framework: net48
- os: ubuntu-22.04
- os: ubuntu-latest
framework: net472
- os: macos-latest
framework: net48
Expand All @@ -78,12 +78,6 @@ jobs:
echo "DOTNET_CLI_TELEMETRY_OPTOUT=1" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
shell: pwsh

- name: Setup .NET 5 SDK
uses: actions/setup-dotnet@v3
with:
dotnet-version: '5.0.x'
if: ${{ startswith(matrix.framework, 'net5.') }}

- name: Setup .NET 6 SDK
uses: actions/setup-dotnet@v3
with:
Expand Down
14 changes: 4 additions & 10 deletions .github/workflows/Lucene-Net-Tests-Analysis-SmartCn.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,14 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-22.04]
framework: [net8.0, net5.0, net48, net472]
os: [windows-latest, ubuntu-latest]
framework: [net8.0, net6.0, net48, net472]
platform: [x64]
configuration: [Release]
exclude:
- os: ubuntu-22.04
- os: ubuntu-latest
framework: net48
- os: ubuntu-22.04
- os: ubuntu-latest
framework: net472
- os: macos-latest
framework: net48
Expand All @@ -82,12 +82,6 @@ jobs:
echo "DOTNET_CLI_TELEMETRY_OPTOUT=1" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
shell: pwsh

- name: Setup .NET 5 SDK
uses: actions/setup-dotnet@v3
with:
dotnet-version: '5.0.x'
if: ${{ startswith(matrix.framework, 'net5.') }}

- name: Setup .NET 6 SDK
uses: actions/setup-dotnet@v3
with:
Expand Down
14 changes: 4 additions & 10 deletions .github/workflows/Lucene-Net-Tests-Analysis-Stempel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-22.04]
framework: [net8.0, net5.0, net48, net472]
os: [windows-latest, ubuntu-latest]
framework: [net8.0, net6.0, net48, net472]
platform: [x64]
configuration: [Release]
exclude:
- os: ubuntu-22.04
- os: ubuntu-latest
framework: net48
- os: ubuntu-22.04
- os: ubuntu-latest
framework: net472
- os: macos-latest
framework: net48
Expand All @@ -79,12 +79,6 @@ jobs:
echo "DOTNET_CLI_TELEMETRY_OPTOUT=1" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
shell: pwsh

- name: Setup .NET 5 SDK
uses: actions/setup-dotnet@v3
with:
dotnet-version: '5.0.x'
if: ${{ startswith(matrix.framework, 'net5.') }}

- name: Setup .NET 6 SDK
uses: actions/setup-dotnet@v3
with:
Expand Down
Loading
Loading