diff --git a/build/template-OneBranch-CI-libsandsamples.yaml b/build/template-OneBranch-CI-libsandsamples.yaml index 12e56a54ed..4010009edf 100644 --- a/build/template-OneBranch-CI-libsandsamples.yaml +++ b/build/template-OneBranch-CI-libsandsamples.yaml @@ -8,6 +8,55 @@ parameters: MsalSourceDir: 'microsoft-authentication-library-for-dotnet\' #Default MSAL Location steps: + +# Unit tests require .NET 3.x +- task: UseDotNet@2 + displayName: 'Use .Net Core SDK 3.x' + inputs: + version: 3.x + +# Use the latest .NET SDK +- task: UseDotNet@2 + displayName: 'Use .Net Core sdk 6.x' + inputs: + version: 6.x + +- task: DotNetCoreCLI@2 + displayName: 'dotnet workload restore for Desktop project' + inputs: + command: 'custom' + custom: 'workload' + arguments: 'restore microsoft-authentication-library-for-dotnet\src\client\Microsoft.Identity.Client.Desktop\Microsoft.Identity.Client.Desktop.csproj' + +- task: DotNetCoreCLI@2 + displayName: 'dotnet workload restore for Identity.Client' + inputs: + command: 'custom' + custom: 'workload' + arguments: 'restore microsoft-authentication-library-for-dotnet\src\client\Microsoft.Identity.Client\Microsoft.Identity.Client.csproj' + +- task: PowerShell@2 + displayName: Install MAUI + inputs: + targetType: 'inline' + script: | + dotnet workload install maui --source https://api.nuget.org/v3/index.json + dotnet workload install android --source https://api.nuget.org/v3/index.json + +- task: PowerShell@2 + displayName: Install Chocolatey + inputs: + targetType: 'inline' + script: | + Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1')) + +- task: PowerShell@2 + displayName: Install Java 11 + inputs: + targetType: 'inline' + script: | + choco install openjdk --version=11.0.2.01 -y + - task: CmdLine@2 displayName: 'Clear local NuGet cache' inputs: diff --git a/build/template-OneBranch-Tests-libsandsamples.yaml b/build/template-OneBranch-Tests-libsandsamples.yaml index fe36850b59..3326cda590 100644 --- a/build/template-OneBranch-Tests-libsandsamples.yaml +++ b/build/template-OneBranch-Tests-libsandsamples.yaml @@ -8,33 +8,15 @@ parameters: MsalSourceDir: '' #Default MSAL Location steps: -- task: CmdLine@2 - displayName: 'Clear local NuGet cache' - inputs: - script: 'nuget locals all -clear' - -- task: VSBuild@1 - displayName: 'NuGet restore ${{ parameters.Solution }}' - inputs: - solution: ${{ parameters.Solution }} - msbuildArgs: '/t:restore' - platform: ${{ parameters.BuildPlatform }} - configuration: ${{ parameters.BuildConfiguration }} -- task: JavaToolInstaller@0 - displayName: 'Use Java 11' +- task: UseDotNet@2 + displayName: 'Use the latest .NET 6' inputs: - versionSpec: 11 - jdkArchitectureOption: x64 - jdkSourceOption: PreInstalled + version: 6.x -- task: VSBuild@1 - displayName: 'Build solution ${{ parameters.Solution }}' - inputs: - solution: ${{ parameters.Solution }} - msbuildArgs: '/p:RunCodeAnalysis=false /p:MsalClientSemVer=${{ parameters.MsalClientSemVer }} /p:SourceLinkCreate=true /p:ContinousIntegrationBuild=true' - platform: ${{ parameters.BuildPlatform }} - configuration: ${{ parameters.BuildConfiguration }} +- template: template-restore-build-libsandsamples.yaml + parameters: + Solution: 'LibsAndSamples.sln' # Run All Desktop Tests - template: template-run-all-tests.yaml