Skip to content

Commit

Permalink
Remove build and test jobs for linux/macOS and patch UTs (#655)
Browse files Browse the repository at this point in the history
* Remove build and test for linux and macos

* Update Microsoft.Build pkg and UTs
  • Loading branch information
mruxmohan4 authored Feb 12, 2025
1 parent 7b1ac24 commit d5519a7
Show file tree
Hide file tree
Showing 3 changed files with 110 additions and 128 deletions.
2 changes: 1 addition & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<Project>
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<MicrosoftBuildPackageVersion>17.12.6</MicrosoftBuildPackageVersion>
<MicrosoftBuildPackageVersion>17.14.0-preview-24624-01</MicrosoftBuildPackageVersion>
<MicrosoftBuildPackageVersion Condition="'$(TargetFramework)' == 'net8.0'">17.11.4</MicrosoftBuildPackageVersion>
<SystemConfigurationConfigurationManagerPackageVersion>9.0.0</SystemConfigurationConfigurationManagerPackageVersion>
<MicrosoftExtensionsFileSystemGlobbingPackageVersion>8.0.0</MicrosoftExtensionsFileSystemGlobbingPackageVersion>
Expand Down
234 changes: 108 additions & 126 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,126 +1,108 @@
resources:
- repo: self

variables:
ArtifactsDirectoryName: 'artifacts'
BuildConfiguration: 'Debug'
BuildPlatform: 'Any CPU'
MSBuildArgs: '"/Property:Platform=$(BuildPlatform);Configuration=$(BuildConfiguration)"'
SignType: 'Test'
# Not using "--channel 10.0 --quality daily", see https://github.com/microsoft/slngen/issues/456
DotNet10InstallArgs: '-version 10.0.100-alpha.1.25074.9'

trigger:
batch: 'true'
branches:
include:
- 'main'
- 'rel/*'
paths:
exclude:
- '*.md'
pr:
branches:
include:
- 'main'
- 'rel/*'
paths:
exclude:
- '*.md'

jobs:
- job: BuildAndTest
strategy:
matrix:
Windows:
vmImage: windows-latest
osName: Windows
Linux:
vmImage: ubuntu-latest
osName: Linux
MacOS:
vmImage: macOS-latest
osName: MacOS
displayName: 'Build and Test'
pool:
vmImage: $(vmImage)
steps:
- task: UseDotNet@2
displayName: 'Install .NET 8.x'
inputs:
version: '8.x'

- task: UseDotNet@2
displayName: 'Install .NET 9.x'
inputs:
version: '9.x'

- script: |
powershell -NoProfile -ExecutionPolicy unrestricted -Command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; &([scriptblock]::Create((Invoke-WebRequest -UseBasicParsing 'https://dot.net/v1/dotnet-install.ps1'))) $(DotNet10InstallArgs) -InstallDir C:\hostedtoolcache\windows\dotnet"
dotnet --info
displayName: 'Install .NET 10.x (Windows)'
condition: eq(variables.osName, 'Windows')
- script: |
curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin $(DotNet10InstallArgs) --install-dir /opt/hostedtoolcache/dotnet
dotnet --info
displayName: 'Install .NET 10.x (Linux)'
condition: eq(variables.osName, 'Linux')
- script: |
curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin $(DotNet10InstallArgs) --install-dir /Users/runner/hostedtoolcache/dotnet
dotnet --info
displayName: 'Install .NET 10.x (MacOS)'
condition: eq(variables.osName, 'MacOS')
- task: VSBuild@1
displayName: 'Build (Visual Studio)'
inputs:
msbuildArgs: '$(MSBuildArgs) "/BinaryLogger:$(ArtifactsDirectoryName)/build.binlog"'
condition: eq(variables.osName, 'Windows')

- task: DotNetCoreCLI@2
displayName: 'Build (dotnet)'
inputs:
command: 'build'
arguments: '$(MSBuildArgs) "/BinaryLogger:$(ArtifactsDirectoryName)/build.binlog"'
condition: ne(variables.osName, 'Windows')

- task: DotNetCoreCLI@2
displayName: 'Run Unit Tests (.NET Framework v4.7.2)'
inputs:
command: 'test'
arguments: '--no-restore --no-build --framework net472 /noautorsp $(MSBuildArgs) "/BinaryLogger:$(ArtifactsDirectoryName)/test-net472.binlog"'
testRunTitle: '$(osName) .NET Framework v4.7.2'
condition: and(succeededOrFailed(), eq(variables.osName, 'Windows'))

- task: DotNetCoreCLI@2
displayName: 'Run Unit Tests (.NET 8)'
inputs:
command: 'test'
arguments: '--no-restore --no-build --framework net8.0 /noautorsp $(MSBuildArgs) "/BinaryLogger:$(ArtifactsDirectoryName)/test-net8.0.binlog"'
testRunTitle: '$(osName) .NET 8.0'
condition: succeededOrFailed()

- task: DotNetCoreCLI@2
displayName: 'Run Unit Tests (.NET 9)'
inputs:
command: 'test'
arguments: '--no-restore --no-build --framework net9.0 /noautorsp $(MSBuildArgs) "/BinaryLogger:$(ArtifactsDirectoryName)/test-net9.0.binlog"'
testRunTitle: '$(osName) .NET 9.0'
condition: succeededOrFailed()

- task: DotNetCoreCLI@2
displayName: 'Run Unit Tests (.NET 10)'
inputs:
command: 'test'
arguments: '--no-restore --no-build --framework net10.0 /noautorsp $(MSBuildArgs) "/BinaryLogger:$(ArtifactsDirectoryName)/test-net10.0.binlog"'
testRunTitle: '$(osName) .NET 10.0'
condition: succeededOrFailed()

- task: PublishBuildArtifacts@1
displayName: 'Publish Artifacts'
inputs:
PathtoPublish: '$(ArtifactsDirectoryName)'
ArtifactName: $(ArtifactsDirectoryName)-$(osName)
condition: always()
resources:
- repo: self

variables:
ArtifactsDirectoryName: 'artifacts'
BuildConfiguration: 'Debug'
BuildPlatform: 'Any CPU'
MSBuildArgs: '"/Property:Platform=$(BuildPlatform);Configuration=$(BuildConfiguration)"'
SignType: 'Test'
# Not using "--channel 10.0 --quality daily", see https://github.com/microsoft/slngen/issues/456
DotNet10InstallArgs: '-version 10.0.100-alpha.1.24571.14'

trigger:
batch: 'true'
branches:
include:
- 'main'
- 'rel/*'
paths:
exclude:
- '*.md'
pr:
branches:
include:
- 'main'
- 'rel/*'
paths:
exclude:
- '*.md'

jobs:
- job: BuildAndTest
strategy:
matrix:
Windows:
vmImage: windows-latest
osName: Windows
displayName: 'Build and Test'
pool:
vmImage: $(vmImage)
steps:
- task: UseDotNet@2
displayName: 'Install .NET 8.x'
inputs:
version: '8.x'

- task: UseDotNet@2
displayName: 'Install .NET 9.x'
inputs:
version: '9.x'

- script: |
powershell -NoProfile -ExecutionPolicy unrestricted -Command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; &([scriptblock]::Create((Invoke-WebRequest -UseBasicParsing 'https://dot.net/v1/dotnet-install.ps1'))) $(DotNet10InstallArgs) -InstallDir C:\hostedtoolcache\windows\dotnet"
dotnet --info
displayName: 'Install .NET 10.x (Windows)'
condition: eq(variables.osName, 'Windows')
- task: VSBuild@1
displayName: 'Build (Visual Studio)'
inputs:
msbuildArgs: '$(MSBuildArgs) "/BinaryLogger:$(ArtifactsDirectoryName)/build.binlog"'
condition: eq(variables.osName, 'Windows')

- task: DotNetCoreCLI@2
displayName: 'Build (dotnet)'
inputs:
command: 'build'
arguments: '$(MSBuildArgs) "/BinaryLogger:$(ArtifactsDirectoryName)/build.binlog"'
condition: ne(variables.osName, 'Windows')

- task: DotNetCoreCLI@2
displayName: 'Run Unit Tests (.NET Framework v4.7.2)'
inputs:
command: 'test'
arguments: '--no-restore --no-build --framework net472 /noautorsp $(MSBuildArgs) "/BinaryLogger:$(ArtifactsDirectoryName)/test-net472.binlog"'
testRunTitle: '$(osName) .NET Framework v4.7.2'
condition: and(succeededOrFailed(), eq(variables.osName, 'Windows'))

- task: DotNetCoreCLI@2
displayName: 'Run Unit Tests (.NET 8)'
inputs:
command: 'test'
arguments: '--no-restore --no-build --framework net8.0 /noautorsp $(MSBuildArgs) "/BinaryLogger:$(ArtifactsDirectoryName)/test-net8.0.binlog"'
testRunTitle: '$(osName) .NET 8.0'
condition: succeededOrFailed()

- task: DotNetCoreCLI@2
displayName: 'Run Unit Tests (.NET 9)'
inputs:
command: 'test'
arguments: '--no-restore --no-build --framework net9.0 /noautorsp $(MSBuildArgs) "/BinaryLogger:$(ArtifactsDirectoryName)/test-net9.0.binlog"'
testRunTitle: '$(osName) .NET 9.0'
condition: succeededOrFailed()

- task: DotNetCoreCLI@2
displayName: 'Run Unit Tests (.NET 10)'
inputs:
command: 'test'
arguments: '--no-restore --no-build --framework net10.0 /noautorsp $(MSBuildArgs) "/BinaryLogger:$(ArtifactsDirectoryName)/test-net10.0.binlog"'
testRunTitle: '$(osName) .NET 10.0'
condition: succeededOrFailed()

- task: PublishBuildArtifacts@1
displayName: 'Publish Artifacts'
inputs:
PathtoPublish: '$(ArtifactsDirectoryName)'
ArtifactName: $(ArtifactsDirectoryName)-$(osName)
condition: always()
Original file line number Diff line number Diff line change
Expand Up @@ -1538,7 +1538,7 @@ private string GetProjectGuid(Project project)

private ProjectInSolution GetSolutionFolderByName(SolutionFile solutionFile, string name)
{
#if NET10_0_OR_GREATER
#if NET9_0_OR_GREATER
// In MSBuild 17.13 and above, solution folders are stored in a private property and not included in ProjectsInOrder
PropertyInfo solutionFoldersByGuidProperty = typeof(SolutionFile).GetProperty("SolutionFoldersByGuid", BindingFlags.Instance | BindingFlags.NonPublic);

Expand Down

0 comments on commit d5519a7

Please sign in to comment.