diff --git a/README.md b/README.md index 80682b0ba3d..9f4a728a636 100644 --- a/README.md +++ b/README.md @@ -141,7 +141,7 @@ Just try to follow these rules, so we can spend more time fixing bugs and implem # How To Build With The Visual Studio IDE -1. Install Visual Studio 2022 17.10 Preview 3 or later. +1. Install Visual Studio 2022 17.10 Preview 4 or later. * Select "Windows 11 SDK (10.0.22621.0)" in the VS Installer. * We recommend selecting "C++ CMake tools for Windows" in the VS Installer. This will ensure that you're using supported versions of CMake and Ninja. @@ -156,7 +156,7 @@ Just try to follow these rules, so we can spend more time fixing bugs and implem # How To Build With A Native Tools Command Prompt -1. Install Visual Studio 2022 17.10 Preview 3 or later. +1. Install Visual Studio 2022 17.10 Preview 4 or later. * Select "Windows 11 SDK (10.0.22621.0)" in the VS Installer. * We recommend selecting "C++ CMake tools for Windows" in the VS Installer. This will ensure that you're using supported versions of CMake and Ninja. diff --git a/azure-devops/asan-pipeline.yml b/azure-devops/asan-pipeline.yml index f046f194053..5107cd41b4a 100644 --- a/azure-devops/asan-pipeline.yml +++ b/azure-devops/asan-pipeline.yml @@ -5,8 +5,6 @@ variables: - template: config.yml - - name: testSelection - value: '-R stlasan' # Restrict to "stlasan" test trigger: none @@ -24,13 +22,12 @@ stages: name: ${{ variables.poolName }} demands: ${{ variables.poolDemands }} jobs: - - template: native-build-test.yml + - template: build-and-test.yml parameters: - targetPlatform: x64 - vsDevCmdArch: amd64 - buildBenchmarks: false + hostArch: x64 + targetArch: x64 asanBuild: true - testSelection: ${{ variables.testSelection }} + ctestOptions: '--tests-regex stlasan' - stage: Build_And_Test_x86 displayName: 'Build and Test x86' @@ -39,12 +36,11 @@ stages: name: ${{ variables.poolName }} demands: ${{ variables.poolDemands }} jobs: - - template: native-build-test.yml + - template: build-and-test.yml parameters: - targetPlatform: x86 - vsDevCmdArch: x86 - buildBenchmarks: false + hostArch: x86 + targetArch: x86 asanBuild: true - testSelection: ${{ variables.testSelection }} + ctestOptions: '--tests-regex stlasan' # no coverage for ARM and ARM64 diff --git a/azure-devops/build-and-test.yml b/azure-devops/build-and-test.yml new file mode 100644 index 00000000000..6798be4d1b7 --- /dev/null +++ b/azure-devops/build-and-test.yml @@ -0,0 +1,65 @@ +# Copyright (c) Microsoft Corporation. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +parameters: +- name: hostArch + type: string +- name: targetArch + type: string +- name: analyzeBuild + type: boolean + default: false +- name: asanBuild + type: boolean + default: false +- name: buildBenchmarks + type: boolean + default: false +- name: ctestOptions + type: string + default: '--exclude-regex stlasan' +- name: numShards + type: number + default: 8 +- name: skipTesting + type: boolean + default: false +- name: testsBuildOnly + type: boolean + default: false +jobs: +- job: '${{ parameters.targetArch }}' + strategy: + parallel: ${{ parameters.numShards }} + timeoutInMinutes: 30 + steps: + - template: checkout-self.yml + - template: checkout-submodule.yml + parameters: + enabled: ${{ not(parameters.skipTesting) }} + path: 'llvm-project' + url: 'https://github.com/llvm/llvm-project.git' + - template: checkout-submodule.yml + parameters: + enabled: true + path: 'boost-math' + url: 'https://github.com/boostorg/math.git' + - template: checkout-submodule.yml + parameters: + enabled: ${{ parameters.buildBenchmarks }} + path: 'benchmarks/google-benchmark' + url: 'https://github.com/google/benchmark.git' + - template: cmake-configure-build.yml + parameters: + hostArch: ${{ parameters.hostArch }} + targetArch: ${{ parameters.targetArch }} + analyzeBuild: ${{ parameters.analyzeBuild }} + asanBuild: ${{ parameters.asanBuild }} + buildBenchmarks: ${{ parameters.buildBenchmarks }} + testsBuildOnly: ${{ parameters.testsBuildOnly }} + - template: run-tests.yml + parameters: + hostArch: ${{ parameters.hostArch }} + targetArch: ${{ parameters.targetArch }} + ctestOptions: ${{ parameters.ctestOptions }} + skipTesting: ${{ parameters.skipTesting }} diff --git a/azure-devops/checkout-self.yml b/azure-devops/checkout-self.yml new file mode 100644 index 00000000000..7fac477f5b8 --- /dev/null +++ b/azure-devops/checkout-self.yml @@ -0,0 +1,16 @@ +# Copyright (c) Microsoft Corporation. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +steps: +- script: | + if exist "$(tmpDir)" (rmdir /S /Q $(tmpDir)) + mkdir $(tmpDir) + displayName: 'Setup TMP Directory' +- checkout: self + clean: true + submodules: false + fetchDepth: 1 + fetchTags: false +- script: | + git clean --quiet -x -d -f -f + displayName: 'Clean after checkout' diff --git a/azure-devops/checkout-sources.yml b/azure-devops/checkout-sources.yml deleted file mode 100644 index 76c9214700a..00000000000 --- a/azure-devops/checkout-sources.yml +++ /dev/null @@ -1,100 +0,0 @@ -# Copyright (c) Microsoft Corporation. -# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception - -parameters: -- name: llvmSHAVar - type: string - default: llvmSHA -- name: boostMathSHAVar - type: string - default: boostMathSHA -- name: googleBenchmarkSHAVar - type: string - default: googleBenchmarkSHA -steps: -- checkout: self - clean: true - submodules: false -- script: | - cd $(Build.SourcesDirectory) - git clean --quiet -x -d -f -f - displayName: 'Clean after checkout' -- task: PowerShell@2 - displayName: 'Get submodule SHAs' - timeoutInMinutes: 1 - inputs: - targetType: inline - script: | - cd $(Build.SourcesDirectory) - $regexSubmoduleSHA = '^[ \-+]([0-9a-f]+) .*$' - $llvmSHA = git submodule status --cached llvm-project | %{$_ -replace $regexSubmoduleSHA, '$1'} - Write-Host "##vso[task.setvariable variable=${{ parameters.llvmSHAVar }};]$llvmSHA" - $boostMathSHA = git submodule status --cached boost-math | %{$_ -replace $regexSubmoduleSHA, '$1'} - Write-Host "##vso[task.setvariable variable=${{ parameters.boostMathSHAVar }};]$boostMathSHA" - $googleBenchmarkSHA = git submodule status --cached benchmarks/google-benchmark ` - | %{$_ -replace $regexSubmoduleSHA, '$1'} - Write-Host "##vso[task.setvariable variable=${{ parameters.googleBenchmarkSHAVar }};]$googleBenchmarkSHA" -- script: | - cd $(Build.SourcesDirectory) - if not exist "llvm-project" ( - mkdir llvm-project - ) - cd llvm-project - - if not exist ".git" ( - del /S /Q * - git init - ) - - git remote get-url llvm - if errorlevel 1 ( - git remote add llvm https://github.com/llvm/llvm-project.git - ) - - git fetch --filter=tree:0 --depth=1 llvm $(${{ parameters.llvmSHAVar }}) - git sparse-checkout set --cone --sparse-index libcxx/test libcxx/utils/libcxx llvm/utils/lit - git reset --quiet --hard FETCH_HEAD - git clean --quiet -x -d -f -f - displayName: "Checkout LLVM source" -- script: | - cd $(Build.SourcesDirectory) - if not exist "boost-math" ( - mkdir boost-math - ) - cd boost-math - - if not exist ".git" ( - del /S /Q * - git init - ) - - git remote get-url boostorg - if errorlevel 1 ( - git remote add boostorg https://github.com/boostorg/math.git - ) - - git fetch --filter=tree:0 --depth=1 boostorg $(${{ parameters.boostMathSHAVar }}) - git reset --quiet --hard FETCH_HEAD - git clean --quiet -x -d -f -f - displayName: "Checkout boost-math source" -- script: | - cd $(Build.SourcesDirectory)/benchmarks - if not exist "google-benchmark" ( - mkdir google-benchmark - ) - cd google-benchmark - - if not exist ".git" ( - del /S /Q * - git init - ) - - git remote get-url googlebenchmark - if errorlevel 1 ( - git remote add googlebenchmark https://github.com/google/benchmark.git - ) - - git fetch --filter=tree:0 --depth=1 googlebenchmark $(${{ parameters.googleBenchmarkSHAVar }}) - git reset --quiet --hard FETCH_HEAD - git clean --quiet -x -d -f -f - displayName: "Checkout google benchmark source" diff --git a/azure-devops/checkout-submodule.yml b/azure-devops/checkout-submodule.yml new file mode 100644 index 00000000000..3822543e9d8 --- /dev/null +++ b/azure-devops/checkout-submodule.yml @@ -0,0 +1,31 @@ +# Copyright (c) Microsoft Corporation. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +parameters: +- name: enabled + type: boolean +- name: path + type: string +- name: url + type: string +steps: +- task: PowerShell@2 + displayName: 'Checkout ${{ parameters.path }} Submodule' + condition: and(succeeded(), ${{ parameters.enabled }}) + inputs: + targetType: inline + script: | + $submodule = '${{ parameters.path }}' + $rawStatus = git submodule status --cached $submodule + $sha = $rawStatus -replace '^[ \-+]([0-9a-f]+) .*$', '$1' + cd $submodule + git init + if ((git remote) -eq $null) { + git remote add submodule-upstream ${{ parameters.url }} + } + git fetch --filter=tree:0 --depth=1 submodule-upstream $sha + if ($submodule -eq 'llvm-project') { + git sparse-checkout set --sparse-index libcxx/test libcxx/utils/libcxx llvm/utils/lit + } + git reset --quiet --hard FETCH_HEAD + git clean --quiet -x -d -f -f diff --git a/azure-devops/cmake-configure-build.yml b/azure-devops/cmake-configure-build.yml index 441be5792ab..dec0d987f71 100644 --- a/azure-devops/cmake-configure-build.yml +++ b/azure-devops/cmake-configure-build.yml @@ -6,46 +6,36 @@ parameters: type: string - name: targetArch type: string -- name: targetPlatform - type: string -- name: buildBenchmarks +- name: analyzeBuild type: boolean - name: asanBuild type: boolean - default: false -- name: cmakeAdditionalFlags - type: string - default: '' +- name: buildBenchmarks + type: boolean +- name: testsBuildOnly + type: boolean - name: litFlags type: object default: - - '-j$(testParallelism)' - '--xunit-xml-output=$(buildOutputLocation)/test-results.xml' - '--order=lexical' - '--num-shards=$(System.TotalJobsInPhase)' - '--run-shard=$(System.JobPositionInPhase)' steps: -- task: PowerShell@2 - displayName: 'Get Test Parallelism' - timeoutInMinutes: 1 - inputs: - targetType: inline - script: | - $testParallelism = $env:NUMBER_OF_PROCESSORS - Write-Host "##vso[task.setvariable variable=testParallelism;]$testParallelism" - script: | if exist "$(buildOutputLocation)" ( rmdir /S /Q "$(buildOutputLocation)" ) call "%ProgramFiles%\Microsoft Visual Studio\2022\Preview\Common7\Tools\VsDevCmd.bat" ^ -host_arch=${{ parameters.hostArch }} -arch=${{ parameters.targetArch }} -no_logo - cmake ${{ parameters.cmakeAdditionalFlags }} -G Ninja ^ + cmake -G Ninja ^ -DCMAKE_CXX_COMPILER=cl ^ -DCMAKE_BUILD_TYPE=Release ^ -DLIT_FLAGS=${{ join(';', parameters.litFlags) }} ^ - -DSTL_USE_ANALYZE=ON ^ + -DSTL_USE_ANALYZE=${{ parameters.analyzeBuild }} ^ -DSTL_ASAN_BUILD=${{ parameters.asanBuild }} ^ + -DTESTS_BUILD_ONLY=${{ parameters.testsBuildOnly }} ^ -S $(Build.SourcesDirectory) -B "$(buildOutputLocation)" displayName: 'Configure the STL' timeoutInMinutes: 2 @@ -63,7 +53,7 @@ steps: ) call "%ProgramFiles%\Microsoft Visual Studio\2022\Preview\Common7\Tools\VsDevCmd.bat" ^ -host_arch=${{ parameters.hostArch }} -arch=${{ parameters.targetArch }} -no_logo - cmake ${{ parameters.cmakeAdditionalFlags }} -G Ninja ^ + cmake -G Ninja ^ -DCMAKE_CXX_COMPILER=cl ^ -DCMAKE_BUILD_TYPE=Release ^ -DSTL_BINARY_DIR="$(buildOutputLocation)" ^ diff --git a/azure-devops/config.yml b/azure-devops/config.yml index 63c3d01266c..f699f5d75c2 100644 --- a/azure-devops/config.yml +++ b/azure-devops/config.yml @@ -5,10 +5,10 @@ variables: - name: poolName - value: 'StlBuild-2024-04-10T1048-Pool' + value: 'StlBuild-2024-04-17T1257-Pool' readonly: true - name: poolDemands - value: 'EnableSpotVM -equals true' + value: 'EnableSpotVM -equals false' readonly: true - name: tmpDir value: 'D:\Temp' diff --git a/azure-devops/create-1es-hosted-pool.ps1 b/azure-devops/create-1es-hosted-pool.ps1 index 9aaf950bfd2..0814678ed98 100644 --- a/azure-devops/create-1es-hosted-pool.ps1 +++ b/azure-devops/create-1es-hosted-pool.ps1 @@ -14,7 +14,7 @@ $ErrorActionPreference = 'Stop' $CurrentDate = Get-Date $Location = 'eastus' -$VMSize = 'Standard_D32ds_v5' +$VMSize = 'Standard_D32ads_v5' $ProtoVMName = 'PROTOTYPE' $ImagePublisher = 'MicrosoftWindowsServer' $ImageOffer = 'WindowsServer' @@ -167,11 +167,11 @@ $Nic = New-AzNetworkInterface ` #################################################################################################### Display-ProgressBar -Status 'Creating prototype VM' +# Previously: -Priority 'Spot' $VM = New-AzVMConfig ` -Name $ProtoVMName ` -VMSize $VMSize ` - -Priority 'Spot' ` - -MaxPrice -1 + -Priority 'Regular' $VM = Set-AzVMOperatingSystem ` -VM $VM ` @@ -342,7 +342,7 @@ $PoolName = $ResourceGroupName + '-Pool' $PoolProperties = @{ 'organization' = 'https://dev.azure.com/vclibs' 'projects' = @('STL') - 'sku' = @{ 'name' = $VMSize; 'tier' = 'StandardSSD'; 'enableSpot' = $true; } + 'sku' = @{ 'name' = $VMSize; 'tier' = 'StandardSSD'; 'enableSpot' = $false; } 'images' = @(@{ 'imageName' = $ImageName; 'poolBufferPercentage' = '100'; }) 'maxPoolSize' = 64 'agentProfile' = @{ 'type' = 'Stateless'; } diff --git a/azure-devops/cross-build.yml b/azure-devops/cross-build.yml deleted file mode 100644 index c391f50424a..00000000000 --- a/azure-devops/cross-build.yml +++ /dev/null @@ -1,44 +0,0 @@ -# Copyright (c) Microsoft Corporation. -# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception - -parameters: -- name: hostArch - type: string - default: amd64 -- name: targetPlatform - type: string -- name: vsDevCmdArch - type: string -- name: buildBenchmarks - type: boolean - default: true -- name: numShards - type: number - default: 8 -jobs: -- job: '${{ parameters.targetPlatform }}' - strategy: - parallel: ${{ parameters.numShards }} - timeoutInMinutes: 30 - steps: - - script: | - if exist "$(tmpDir)" (rmdir /S /Q $(tmpDir)) - mkdir $(tmpDir) - displayName: 'Setup TMP Directory' - - - template: checkout-sources.yml - - template: cmake-configure-build.yml - parameters: - targetPlatform: ${{ parameters.targetPlatform }} - hostArch: ${{ parameters.hostArch }} - targetArch: ${{ parameters.vsDevCmdArch }} - cmakeAdditionalFlags: '-DTESTS_BUILD_ONLY=ON' - buildBenchmarks: ${{ parameters.buildBenchmarks }} - - template: run-tests.yml - parameters: - hostArch: ${{ parameters.hostArch }} - targetPlatform: ${{ parameters.targetPlatform }} - targetArch: ${{ parameters.vsDevCmdArch }} - displayName: 'Build Tests' - # Exclude "stlasan" test (we don't yet support ASAN on ARM or ARM64) - testSelection: '-E stlasan' diff --git a/azure-devops/format-validation.yml b/azure-devops/format-validation.yml index fa86b6b67a2..62553a627ad 100644 --- a/azure-devops/format-validation.yml +++ b/azure-devops/format-validation.yml @@ -8,22 +8,10 @@ jobs: timeoutInMinutes: 5 displayName: 'Validation' steps: - - script: | - if exist "$(tmpDir)" ( - rmdir /S /Q $(tmpDir) - ) - mkdir $(tmpDir) - displayName: 'Setup TMP Directory' - - checkout: self - clean: true - submodules: false - - script: | - cd $(Build.SourcesDirectory) - git clean --quiet -x -d -f -f - displayName: 'Clean after checkout' + - template: checkout-self.yml - script: | call "%ProgramFiles%\Microsoft Visual Studio\2022\Preview\Common7\Tools\VsDevCmd.bat" ^ - -host_arch=amd64 -arch=amd64 -no_logo + -host_arch=x64 -arch=x64 -no_logo cmake -G Ninja -S $(Build.SourcesDirectory)/tools -B $(tmpDir)/format-validate-build cmake --build $(tmpDir)/format-validate-build displayName: 'Build format and validation' @@ -31,22 +19,21 @@ jobs: env: { TMP: $(tmpDir), TEMP: $(tmpDir) } - script: | call "%ProgramFiles%\Microsoft Visual Studio\2022\Preview\Common7\Tools\VsDevCmd.bat" ^ - -host_arch=amd64 -arch=amd64 -no_logo + -host_arch=x64 -arch=x64 -no_logo cmake --build $(tmpDir)/format-validate-build --target run-format displayName: 'clang-format Files' timeoutInMinutes: 5 env: { TMP: $(tmpDir), TEMP: $(tmpDir) } - script: | call "%ProgramFiles%\Microsoft Visual Studio\2022\Preview\Common7\Tools\VsDevCmd.bat" ^ - -host_arch=amd64 -arch=amd64 -no_logo + -host_arch=x64 -arch=x64 -no_logo cmake --build $(tmpDir)/format-validate-build --target run-validate displayName: 'Validate Files' timeoutInMinutes: 2 env: { TMP: $(tmpDir), TEMP: $(tmpDir) } - - task: Powershell@2 + - task: PowerShell@2 displayName: 'Create Diff' inputs: filePath: azure-devops/create-prdiff.ps1 - pwsh: false condition: succeededOrFailed() env: { TMP: $(tmpDir), TEMP: $(tmpDir) } diff --git a/azure-devops/native-build-test.yml b/azure-devops/native-build-test.yml deleted file mode 100644 index 3c31da597cc..00000000000 --- a/azure-devops/native-build-test.yml +++ /dev/null @@ -1,47 +0,0 @@ -# Copyright (c) Microsoft Corporation. -# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception - -parameters: -- name: targetPlatform - type: string -- name: vsDevCmdArch - type: string -- name: buildBenchmarks - type: boolean - default: true -- name: asanBuild - type: boolean - default: false -- name: numShards - type: number - default: 8 - # Parameters to pass to ctest to select the test(s) to run -- name: testSelection - type: string - # Exclude "stlasan" test by default - default: '-E stlasan' -jobs: -- job: '${{ parameters.targetPlatform }}' - strategy: - parallel: ${{ parameters.numShards }} - timeoutInMinutes: 30 - steps: - - script: | - if exist "$(tmpDir)" (rmdir /S /Q $(tmpDir)) - mkdir $(tmpDir) - displayName: 'Setup TMP Directory' - - - template: checkout-sources.yml - - template: cmake-configure-build.yml - parameters: - targetPlatform: ${{ parameters.targetPlatform }} - targetArch: ${{ parameters.vsDevCmdArch }} - hostArch: ${{ parameters.vsDevCmdArch }} - buildBenchmarks: ${{ parameters.buildBenchmarks }} - asanBuild: ${{ parameters.asanBuild }} - - template: run-tests.yml - parameters: - hostArch: ${{ parameters.vsDevCmdArch }} - targetPlatform: ${{ parameters.targetPlatform }} - targetArch: ${{ parameters.vsDevCmdArch }} - testSelection: ${{ parameters.testSelection }} diff --git a/azure-devops/provision-image.ps1 b/azure-devops/provision-image.ps1 index ee3f0ab1a6d..99f75eeee9b 100644 --- a/azure-devops/provision-image.ps1 +++ b/azure-devops/provision-image.ps1 @@ -62,11 +62,11 @@ Function DownloadAndExtractZip { return $TempSubdirPath } -if ($PSVersionTable.PSVersion -lt [Version]::new('7.4.1')) { +if ($PSVersionTable.PSVersion -lt [Version]::new('7.4.2')) { Write-Host "Old PowerShell version: $($PSVersionTable.PSVersion)" # https://github.com/PowerShell/PowerShell/releases/latest - $PowerShellZipUrl = 'https://github.com/PowerShell/PowerShell/releases/download/v7.4.1/PowerShell-7.4.1-win-x64.zip' + $PowerShellZipUrl = 'https://github.com/PowerShell/PowerShell/releases/download/v7.4.2/PowerShell-7.4.2-win-x64.zip' Write-Host "Downloading: $PowerShellZipUrl" $ExtractedPowerShellPath = DownloadAndExtractZip -Url $PowerShellZipUrl $PwshPath = Join-Path $ExtractedPowerShellPath 'pwsh.exe' diff --git a/azure-devops/run-tests.yml b/azure-devops/run-tests.yml index 32aa742c1bd..27ce640f32f 100644 --- a/azure-devops/run-tests.yml +++ b/azure-devops/run-tests.yml @@ -2,40 +2,34 @@ # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception parameters: -- name: targetPlatform - type: string - name: hostArch type: string - name: targetArch type: string -- name: displayName - type: string - default: 'Run Tests' - # Parameters to pass to ctest to select the test(s) to run -- name: testSelection +- name: ctestOptions type: string +- name: skipTesting + type: boolean steps: -- task: CmdLine@2 - displayName: ${{ parameters.displayName }} +- script: | + call "%ProgramFiles%\Microsoft Visual Studio\2022\Preview\Common7\Tools\VsDevCmd.bat" ^ + -host_arch=${{ parameters.hostArch }} -arch=${{ parameters.targetArch }} -no_logo + ctest --verbose ${{ parameters.ctestOptions }} + displayName: 'Build and Run Tests' timeoutInMinutes: 30 - condition: succeeded() - inputs: - workingDirectory: $(buildOutputLocation) - script: | - call "%ProgramFiles%\Microsoft Visual Studio\2022\Preview\Common7\Tools\VsDevCmd.bat" ^ - -host_arch=${{ parameters.hostArch }} -arch=${{ parameters.targetArch }} -no_logo - ctest -V ${{ parameters.testSelection }} + condition: and(succeeded(), not(${{ parameters.skipTesting }})) + workingDirectory: $(buildOutputLocation) env: { TMP: $(tmpDir), TEMP: $(tmpDir) } - task: PublishTestResults@2 displayName: 'Publish Tests' timeoutInMinutes: 5 - condition: succeededOrFailed() + condition: and(succeededOrFailed(), not(${{ parameters.skipTesting }})) inputs: searchFolder: $(buildOutputLocation) testResultsFormat: JUnit testResultsFiles: '**/test-results.xml' - testRunTitle: 'test-${{ parameters.targetPlatform }}-$(System.JobPositionInPhase)' + testRunTitle: 'test-${{ parameters.targetArch }}-$(System.JobPositionInPhase)' - publish: $(buildOutputLocation)/test-results.xml - artifact: '${{ parameters.targetPlatform }}-$(System.JobPositionInPhase)-xml-$(System.JobId)' - condition: failed() + artifact: '${{ parameters.targetArch }}-$(System.JobPositionInPhase)-xml-$(System.JobId)' + condition: and(failed(), not(${{ parameters.skipTesting }})) displayName: 'Publish XML Artifact' diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 1ff09dfdc66..3941274d57a 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -18,17 +18,85 @@ stages: jobs: - template: azure-devops/format-validation.yml + - stage: Early_Build_x64 + dependsOn: [] + displayName: 'Early Build x64' + pool: + name: ${{ variables.poolName }} + demands: ${{ variables.poolDemands }} + jobs: + - template: azure-devops/build-and-test.yml + parameters: + hostArch: x64 + targetArch: x64 + analyzeBuild: true + buildBenchmarks: true + numShards: 1 + skipTesting: true + + - stage: Early_Build_x86 + dependsOn: [] + displayName: 'Early Build x86' + pool: + name: ${{ variables.poolName }} + demands: ${{ variables.poolDemands }} + jobs: + - template: azure-devops/build-and-test.yml + parameters: + hostArch: x86 + targetArch: x86 + analyzeBuild: true + buildBenchmarks: true + numShards: 1 + skipTesting: true + + - stage: Early_Build_ARM + dependsOn: [] + displayName: 'Early Build ARM' + pool: + name: ${{ variables.poolName }} + demands: ${{ variables.poolDemands }} + jobs: + - template: azure-devops/build-and-test.yml + parameters: + hostArch: x64 + targetArch: arm + analyzeBuild: true + numShards: 1 + skipTesting: true + + - stage: Early_Build_ARM64 + dependsOn: [] + displayName: 'Early Build ARM64' + pool: + name: ${{ variables.poolName }} + demands: ${{ variables.poolDemands }} + jobs: + - template: azure-devops/build-and-test.yml + parameters: + hostArch: x64 + targetArch: arm64 + analyzeBuild: true + buildBenchmarks: true + numShards: 1 + skipTesting: true + - stage: Build_And_Test_x64 - dependsOn: Code_Format + dependsOn: + - Code_Format + - Early_Build_x64 + - Early_Build_x86 + - Early_Build_ARM + - Early_Build_ARM64 displayName: 'Build and Test x64' pool: name: ${{ variables.poolName }} demands: ${{ variables.poolDemands }} jobs: - - template: azure-devops/native-build-test.yml + - template: azure-devops/build-and-test.yml parameters: - targetPlatform: x64 - vsDevCmdArch: amd64 + hostArch: x64 + targetArch: x64 - stage: Build_And_Test_x86 dependsOn: Build_And_Test_x64 @@ -37,32 +105,33 @@ stages: name: ${{ variables.poolName }} demands: ${{ variables.poolDemands }} jobs: - - template: azure-devops/native-build-test.yml + - template: azure-devops/build-and-test.yml parameters: - targetPlatform: x86 - vsDevCmdArch: x86 + hostArch: x86 + targetArch: x86 - - stage: Build_ARM + - stage: Build_And_Test_ARM dependsOn: Build_And_Test_x64 - displayName: 'Build ARM' + displayName: 'Build and Test ARM' pool: name: ${{ variables.poolName }} demands: ${{ variables.poolDemands }} jobs: - - template: azure-devops/cross-build.yml + - template: azure-devops/build-and-test.yml parameters: - targetPlatform: arm - vsDevCmdArch: arm - buildBenchmarks: false + hostArch: x64 + targetArch: arm + testsBuildOnly: true - - stage: Build_ARM64 + - stage: Build_And_Test_ARM64 dependsOn: Build_And_Test_x64 - displayName: 'Build ARM64' + displayName: 'Build and Test ARM64' pool: name: ${{ variables.poolName }} demands: ${{ variables.poolDemands }} jobs: - - template: azure-devops/cross-build.yml + - template: azure-devops/build-and-test.yml parameters: - targetPlatform: arm64 - vsDevCmdArch: arm64 + hostArch: x64 + targetArch: arm64 + testsBuildOnly: true