Files
WSL/cloudtest/CMakeLists.txt
Ben Hillis 6bc39a6bd7 Split x64/arm64 builds into parallel pipeline stages (#14497)
* Split x64/arm64 builds into parallel pipeline stages

Restructure the CI/CD pipeline to build x64 and arm64 in parallel
instead of sequentially, reducing end-to-end build time.

Pipeline shapes:
- PR: build_x64 ∥ build_arm64 → test (uses installer.msix directly)
- Nightly: build_x64 ∥ build_arm64 → package → test (dev-cert bundle)
- Release: build_x64 ∥ build_arm64 → package → test (ESRP-signed bundle)

Key changes:
- Extract shared build-job.yml template parameterized by platform
- Add package-stage.yml that creates msixbundle from both platform
  artifacts, ESRP-signs for release, dev-cert signs for nightly
- PR tests run immediately after x64 build using installer.msix
  (no package stage, no bundle needed)
- Release/nightly tests wait for the package stage and test the real
  signed bundle that gets published
- CloudTest configs are parameterized: release tests pull the bundle
  from the [package] artifact, PR tests use installer.msix from [drop]
- arm64 + formatting checks always run in parallel with x64 but don't
  block the PR test gate
- CodeQL runs in the arm64 stage (off the critical path)
- flight-stage and nuget-stage updated for new stage names

* formatting

* Remove redundant runtime conditions on release-only tasks

These tasks are already wrapped in compile-time conditionals which
prevent them from being added to the pipeline definition for
non-release builds. The runtime condition checks can never evaluate
to false at that point, so they are pure noise.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Address review feedback from OneBlue

- Remove wslcsdk NuGet staging (wslc is not in master)
- Always include [package] provider in TestMap.xml.in instead of
  conditionally injecting via PACKAGE_PROVIDER_BLOCK cmake variable.
  PR builds simply use [drop] as TEST_PACKAGE_PROVIDER; the [package]
  provider exists but is unused.
- Add BUNDLE_ONLY cmake option so the package pipeline stage reuses
  cmake's existing bundle target instead of forking makeappx logic.
  This locks the SDK version via cmake (CMAKE_SYSTEM_VERSION) and
  keeps bundle creation logic in one place (msixinstaller/CMakeLists.txt).
  The pipeline now copies msix files to expected paths, runs a fast
  cmake configure with -DBUNDLE_ONLY=TRUE, and builds the bundle target.
- Remove dead NuGet binary restore step in package stage.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Address PR review feedback

- Fix PACKAGE_VERSION regex: escape dots so only A.B.C.D is accepted
- Consolidate CMake defaults (build type, config types, output dir)
  before BUNDLE_ONLY block to avoid duplication
- Nightly tests now use the full bundle from the package stage instead
  of installer.msix (new INCLUDE_PACKAGE_STAGE cmake variable)
- Package stage reuses version output from build stage instead of
  recomputing it

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-09 13:31:55 -07:00

52 lines
1.8 KiB
CMake

set(OUT ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/cloudtest)
file(MAKE_DIRECTORY ${OUT})
if (${TARGET_PLATFORM} STREQUAL x64)
set(CLOUDTEST_IMAGES
"wsl-test-image-rs_prerelease-2025-01-30"
"wsl-test-image-win11-23h2-ent-2024-11-18"
"wsl-test-image-2022-datacenter-g2-2024-09-10"
"wsl-test-image-win10-22h2-ent-g2-2024-09-10")
set(CLOUDTEST_TEST_PACKAGES "Test_Packages_2025_07_28")
set(DUMPTOOL_DROP "DumpTool_X64_2025-01-27")
elseif (${TARGET_PLATFORM} STREQUAL arm64)
set(CLOUDTEST_IMAGES)
else()
message(FATAL_ERROR "Unsupported target platform: ${TARGET_PLATFORM}")
endif()
# Passed down to test-setup.ps1 to determine if -AllowUnsigned should be passed to Add-AppxPackage
if (OFFICIAL_BUILD)
set(ALLOW_UNSIGNED_PACKAGE "0")
else()
set(ALLOW_UNSIGNED_PACKAGE "1")
endif()
# When the package stage is included (release + nightly), test the real bundle from that stage.
# PR builds test the installer.msix directly from the build artifact (no bundle needed).
if (INCLUDE_PACKAGE_STAGE)
set(TEST_PACKAGE_PROVIDER "[package]")
set(TEST_PACKAGE_PATH "bundle\\Microsoft.WSL_${PACKAGE_VERSION}_x64_ARM64.msixbundle")
set(TEST_PACKAGE_FILE "Microsoft.WSL_${PACKAGE_VERSION}_x64_ARM64.msixbundle")
else()
set(TEST_PACKAGE_PROVIDER "[drop]")
set(TEST_PACKAGE_PATH "testbin\\x64\\release\\installer.msix")
set(TEST_PACKAGE_FILE "installer.msix")
endif()
function(add_test_group image version)
set(DIR ${OUT}/${image}-wsl${version})
file(MAKE_DIRECTORY ${DIR})
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/TestMap.xml.in ${DIR}/TestMap.xml)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/TestGroup.xml.in ${DIR}/TestGroup.xml)
endfunction()
foreach(image ${CLOUDTEST_IMAGES})
add_test_group("${image}" "1")
add_test_group("${image}" "2")
endforeach()