diff --git a/.pipelines/v2/ci-nightly.yml b/.pipelines/v2/ci-nightly.yml new file mode 100644 index 0000000000..1f49359f66 --- /dev/null +++ b/.pipelines/v2/ci-nightly.yml @@ -0,0 +1,38 @@ +# .pipelines/v2/nightly-prewarm.yml +# Nightly pre-warm that reuses your existing ci.yml as-is + +trigger: none +pr: none + +# (18:00 UTC) — adjust as you like +schedules: + - cron: "0 18 * * *" # UTC + displayName: Nightly pre-warm (main) + branches: + include: + - main + always: true + +name: $(BuildDefinitionName)_$(date:yyMM).$(date:dd)$(rev:rrr) + +parameters: + - name: buildPlatforms + type: object + default: + - x64 + - arm64 + - name: enableMsBuildCaching + type: boolean + displayName: "Enable MSBuild Caching" + default: true + - name: msBuildCacheIsReadOnly + type: boolean + displayName: "MSBuild Cache Read Only" + default: false + +extends: + template: templates/pipeline-ci-build.yml + parameters: + buildPlatforms: ${{ parameters.buildPlatforms }} + enableMsBuildCaching: ${{ parameters.enableMsBuildCaching }} + msBuildCacheIsReadOnly: ${{ parameters.msBuildCacheIsReadOnly }} \ No newline at end of file diff --git a/.pipelines/v2/ci.yml b/.pipelines/v2/ci.yml index 6b0105a38a..297c268757 100644 --- a/.pipelines/v2/ci.yml +++ b/.pipelines/v2/ci.yml @@ -32,7 +32,7 @@ parameters: - name: enableMsBuildCaching type: boolean displayName: "Enable MSBuild Caching" - default: true + default: false - name: runTests type: boolean displayName: "Run Tests" diff --git a/.pipelines/v2/templates/job-build-project.yml b/.pipelines/v2/templates/job-build-project.yml index 91a11bf484..cdacfa576f 100644 --- a/.pipelines/v2/templates/job-build-project.yml +++ b/.pipelines/v2/templates/job-build-project.yml @@ -50,6 +50,9 @@ parameters: - name: enableMsBuildCaching type: boolean default: false + - name: msBuildCacheIsReadOnly + type: boolean + default: true - name: runTests type: boolean default: true @@ -154,6 +157,11 @@ jobs: $MSBuildCacheParameters += " -reportfileaccesses" $MSBuildCacheParameters += " -p:MSBuildCacheEnabled=true" $MSBuildCacheParameters += " -p:MSBuildCacheLogDirectory=$(LogOutputDirectory)\MSBuildCacheLogs" + # Cache read-only policy controlled by parameter + $cacheIsReadOnly = "${{ parameters.msBuildCacheIsReadOnly }}" + if ($cacheIsReadOnly -eq "True") { + $MSBuildCacheParameters += " /p:MSBuildCacheRemoteCacheIsReadOnly=true" + } Write-Host "MSBuildCacheParameters: $MSBuildCacheParameters" Write-Host "##vso[task.setvariable variable=MSBuildCacheParameters]$MSBuildCacheParameters" displayName: Prepare MSBuildCache variables @@ -418,7 +426,7 @@ jobs: } if ($Packages.Count -gt 0) { - # Priority: Look for platform-specific MSIX (x64/arm64) first, then fall back to any + # Priority: Look for platform-specific MSIX (x64/arm64) first, then fallback to any $PlatformPackage = $Packages | Where-Object { $_.Name -match "Microsoft\.CmdPal\.UI_.*_(x64|arm64)\.msix$" } | Select-Object -First 1 if ($PlatformPackage) { $Package = $PlatformPackage diff --git a/.pipelines/v2/templates/pipeline-ci-build.yml b/.pipelines/v2/templates/pipeline-ci-build.yml index 541aff4845..30c1dbc757 100644 --- a/.pipelines/v2/templates/pipeline-ci-build.yml +++ b/.pipelines/v2/templates/pipeline-ci-build.yml @@ -13,6 +13,9 @@ parameters: - name: enableMsBuildCaching type: boolean default: false + - name: msBuildCacheIsReadOnly + type: boolean + default: true - name: runTests type: boolean default: true @@ -52,6 +55,7 @@ stages: buildConfigurations: [Release] enablePackageCaching: true enableMsBuildCaching: ${{ parameters.enableMsBuildCaching }} + msBuildCacheIsReadOnly: ${{ parameters.msBuildCacheIsReadOnly }} runTests: ${{ parameters.runTests }} useVSPreview: ${{ parameters.useVSPreview }} useLatestWinAppSDK: ${{ parameters.useLatestWinAppSDK }}