From c9fa8b4b1136c6a5c56384ed8bab5a801fd86f7d Mon Sep 17 00:00:00 2001 From: Shawn Yuan Date: Wed, 11 Dec 2024 17:06:36 +0800 Subject: [PATCH 1/5] using the latest webview2 for testing Signed-off-by: Shawn Yuan --- .pipelines/v2/ci.yml | 4 +++ .pipelines/v2/templates/job-test-project.yml | 27 +++++++++++++++++++ .pipelines/v2/templates/pipeline-ci-build.yml | 4 +++ 3 files changed, 35 insertions(+) diff --git a/.pipelines/v2/ci.yml b/.pipelines/v2/ci.yml index 0b8daa76d63f..e696848c3c6b 100644 --- a/.pipelines/v2/ci.yml +++ b/.pipelines/v2/ci.yml @@ -41,6 +41,9 @@ parameters: type: boolean displayName: "Build Using Visual Studio Preview" default: false + - name: usingLatestWebView2 + type: boolean + default: false extends: template: templates/pipeline-ci-build.yml @@ -49,3 +52,4 @@ extends: enableMsBuildCaching: ${{ parameters.enableMsBuildCaching }} runTests: ${{ parameters.runTests }} useVSPreview: ${{ parameters.useVSPreview }} + usingLatestWebView2: ${{ parameters.usingLatestWebView2 }} diff --git a/.pipelines/v2/templates/job-test-project.yml b/.pipelines/v2/templates/job-test-project.yml index 212dbeccd882..893ee16dc966 100644 --- a/.pipelines/v2/templates/job-test-project.yml +++ b/.pipelines/v2/templates/job-test-project.yml @@ -8,6 +8,9 @@ parameters: - name: inputArtifactStem type: string default: "" + - name: usingLatestWebView2 + type: boolean + default: false jobs: - job: Test${{ parameters.platform }}${{ parameters.configuration }} @@ -34,6 +37,30 @@ jobs: fetchDepth: 1 fetchTags: false + - powershell: | + $edge_url = 'https://go.microsoft.com/fwlink/?linkid=2084649&Channel=Canary&language=en' + $timeout = New-TimeSpan -Minutes 6 + $timeoutSeconds = [int]$timeout.TotalSeconds + $command = { + Invoke-WebRequest -Uri $using:edge_url -OutFile $(Pipeline.Workspace)\MicrosoftEdgeSetup.exe + Write-Host "##[command]Installing Canary channel of Microsoft Edge" + Start-Process $(Pipeline.Workspace)\MicrosoftEdgeSetup.exe -ArgumentList '/silent /install' -Wait + } + + $job = Start-Job -ScriptBlock $command + Wait-Job $job -Timeout $timeoutSeconds + if ($job.State -eq "Running") { + Stop-Job $job + Write-Host "##[warning]The job was stopped because it exceeded the time limit." + } + displayName: "Install the latest MSEdge Canary" + condition: eq('${{ parameters.usingLatestWebView2 }}', true) + + - script: + reg add "HKLM\Software\Policies\Microsoft\Edge\WebView2\ReleaseChannels" /v PowerToys.exe /t REG_SZ /d "0,3" + displayName: "Enable WebView2 Canary Channel" + condition: eq('${{ parameters.usingLatestWebView2 }}', true) + - download: current displayName: Download artifacts artifact: build-${{ parameters.platform }}-${{ parameters.configuration }}${{ parameters.inputArtifactStem }} diff --git a/.pipelines/v2/templates/pipeline-ci-build.yml b/.pipelines/v2/templates/pipeline-ci-build.yml index 71ebd6a33b47..9139a6eecb3d 100644 --- a/.pipelines/v2/templates/pipeline-ci-build.yml +++ b/.pipelines/v2/templates/pipeline-ci-build.yml @@ -22,6 +22,9 @@ parameters: - name: useVSPreview type: boolean default: false + - name: usingLatestWebView2 + type: boolean + default: false stages: # Allow manual builds to skip pre-check @@ -66,3 +69,4 @@ stages: parameters: platform: ${{ platform }} configuration: Release + usingLatestWebView2: ${{ parameters.usingLatestWebView2 }} From 5843e64229073dd31b2f7e3e2383ebfbdc1269ce Mon Sep 17 00:00:00 2001 From: Shawn Yuan Date: Thu, 12 Dec 2024 16:55:31 +0800 Subject: [PATCH 2/5] create yml file. Signed-off-by: Shawn Yuan --- .pipelines/v2/ci.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.pipelines/v2/ci.yml b/.pipelines/v2/ci.yml index e696848c3c6b..0b8daa76d63f 100644 --- a/.pipelines/v2/ci.yml +++ b/.pipelines/v2/ci.yml @@ -41,9 +41,6 @@ parameters: type: boolean displayName: "Build Using Visual Studio Preview" default: false - - name: usingLatestWebView2 - type: boolean - default: false extends: template: templates/pipeline-ci-build.yml @@ -52,4 +49,3 @@ extends: enableMsBuildCaching: ${{ parameters.enableMsBuildCaching }} runTests: ${{ parameters.runTests }} useVSPreview: ${{ parameters.useVSPreview }} - usingLatestWebView2: ${{ parameters.usingLatestWebView2 }} From 8a6921f2e4dd302dfd84ae05223043b0bb4cf958 Mon Sep 17 00:00:00 2001 From: Shawn Yuan Date: Thu, 12 Dec 2024 17:09:05 +0800 Subject: [PATCH 3/5] add yml pipeline file. Signed-off-by: Shawn Yuan --- .../v2/ci-test-with-canary-webview2.yml | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .pipelines/v2/ci-test-with-canary-webview2.yml diff --git a/.pipelines/v2/ci-test-with-canary-webview2.yml b/.pipelines/v2/ci-test-with-canary-webview2.yml new file mode 100644 index 000000000000..85a85f4575b7 --- /dev/null +++ b/.pipelines/v2/ci-test-with-canary-webview2.yml @@ -0,0 +1,42 @@ +trigger: none +pr: none +schedules: + - cron: "0 0 * * *" # every day at midnight + displayName: "Daily midnight Build" + branches: + include: + - main + always: false # only run if there's code changes! + +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: false + - name: runTests + type: boolean + displayName: "Run Tests" + default: true + - name: useVSPreview + type: boolean + displayName: "Build Using Visual Studio Preview" + default: false + - name: usingLatestWebView2 + type: boolean + default: false + +extends: + template: templates/pipeline-ci-build.yml + parameters: + buildPlatforms: ${{ parameters.buildPlatforms }} + enableMsBuildCaching: ${{ parameters.enableMsBuildCaching }} + runTests: ${{ parameters.runTests }} + useVSPreview: ${{ parameters.useVSPreview }} + usingLatestWebView2: ${{ parameters.usingLatestWebView2 }} From 9c717b7e934ad9a15808cb714e424b0eab016cc7 Mon Sep 17 00:00:00 2001 From: Clint Rutkas Date: Thu, 12 Dec 2024 16:20:02 -0800 Subject: [PATCH 4/5] Update expect.txt --- .github/actions/spell-check/expect.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/actions/spell-check/expect.txt b/.github/actions/spell-check/expect.txt index de32d2a32403..e5db603380b8 100644 --- a/.github/actions/spell-check/expect.txt +++ b/.github/actions/spell-check/expect.txt @@ -786,6 +786,7 @@ lhwnd LIBID licate lindex +linkid LINKOVERLAY LINQTo listview From 90a84aff79d88f58af7db5aca59c8f377e80ea32 Mon Sep 17 00:00:00 2001 From: Shawn Yuan Date: Mon, 16 Dec 2024 11:00:17 +0800 Subject: [PATCH 5/5] resolve comments Signed-off-by: Shawn Yuan --- .../v2/ci-test-with-canary-webview2.yml | 4 +- .pipelines/v2/templates/job-test-project.yml | 43 +++++++++---------- .pipelines/v2/templates/pipeline-ci-build.yml | 4 +- 3 files changed, 25 insertions(+), 26 deletions(-) diff --git a/.pipelines/v2/ci-test-with-canary-webview2.yml b/.pipelines/v2/ci-test-with-canary-webview2.yml index 85a85f4575b7..01f0454186bd 100644 --- a/.pipelines/v2/ci-test-with-canary-webview2.yml +++ b/.pipelines/v2/ci-test-with-canary-webview2.yml @@ -28,7 +28,7 @@ parameters: type: boolean displayName: "Build Using Visual Studio Preview" default: false - - name: usingLatestWebView2 + - name: useLatestWebView2 type: boolean default: false @@ -39,4 +39,4 @@ extends: enableMsBuildCaching: ${{ parameters.enableMsBuildCaching }} runTests: ${{ parameters.runTests }} useVSPreview: ${{ parameters.useVSPreview }} - usingLatestWebView2: ${{ parameters.usingLatestWebView2 }} + useLatestWebView2: ${{ parameters.useLatestWebView2 }} diff --git a/.pipelines/v2/templates/job-test-project.yml b/.pipelines/v2/templates/job-test-project.yml index 893ee16dc966..0bf4641e429f 100644 --- a/.pipelines/v2/templates/job-test-project.yml +++ b/.pipelines/v2/templates/job-test-project.yml @@ -8,7 +8,7 @@ parameters: - name: inputArtifactStem type: string default: "" - - name: usingLatestWebView2 + - name: useLatestWebView2 type: boolean default: false @@ -37,29 +37,28 @@ jobs: fetchDepth: 1 fetchTags: false - - powershell: | - $edge_url = 'https://go.microsoft.com/fwlink/?linkid=2084649&Channel=Canary&language=en' - $timeout = New-TimeSpan -Minutes 6 - $timeoutSeconds = [int]$timeout.TotalSeconds - $command = { - Invoke-WebRequest -Uri $using:edge_url -OutFile $(Pipeline.Workspace)\MicrosoftEdgeSetup.exe - Write-Host "##[command]Installing Canary channel of Microsoft Edge" - Start-Process $(Pipeline.Workspace)\MicrosoftEdgeSetup.exe -ArgumentList '/silent /install' -Wait - } + - ${{ if eq(parameters.useLatestWebView2, true) }}: + - powershell: | + $edge_url = 'https://go.microsoft.com/fwlink/?linkid=2084649&Channel=Canary&language=en' + $timeout = New-TimeSpan -Minutes 6 + $timeoutSeconds = [int]$timeout.TotalSeconds + $command = { + Invoke-WebRequest -Uri $using:edge_url -OutFile $(Pipeline.Workspace)\MicrosoftEdgeSetup.exe + Write-Host "##[command]Installing Canary channel of Microsoft Edge" + Start-Process $(Pipeline.Workspace)\MicrosoftEdgeSetup.exe -ArgumentList '/silent /install' -Wait + } - $job = Start-Job -ScriptBlock $command - Wait-Job $job -Timeout $timeoutSeconds - if ($job.State -eq "Running") { - Stop-Job $job - Write-Host "##[warning]The job was stopped because it exceeded the time limit." - } - displayName: "Install the latest MSEdge Canary" - condition: eq('${{ parameters.usingLatestWebView2 }}', true) + $job = Start-Job -ScriptBlock $command + Wait-Job $job -Timeout $timeoutSeconds + if ($job.State -eq "Running") { + Stop-Job $job + Write-Host "##[warning]The job was stopped because it exceeded the time limit." + } + displayName: "Install the latest MSEdge Canary" - - script: - reg add "HKLM\Software\Policies\Microsoft\Edge\WebView2\ReleaseChannels" /v PowerToys.exe /t REG_SZ /d "0,3" - displayName: "Enable WebView2 Canary Channel" - condition: eq('${{ parameters.usingLatestWebView2 }}', true) + - script: + reg add "HKLM\Software\Policies\Microsoft\Edge\WebView2\ReleaseChannels" /v PowerToys.exe /t REG_SZ /d "3" + displayName: "Enable WebView2 Canary Channel" - download: current displayName: Download artifacts diff --git a/.pipelines/v2/templates/pipeline-ci-build.yml b/.pipelines/v2/templates/pipeline-ci-build.yml index 9139a6eecb3d..c49f61f6a1c8 100644 --- a/.pipelines/v2/templates/pipeline-ci-build.yml +++ b/.pipelines/v2/templates/pipeline-ci-build.yml @@ -22,7 +22,7 @@ parameters: - name: useVSPreview type: boolean default: false - - name: usingLatestWebView2 + - name: useLatestWebView2 type: boolean default: false @@ -69,4 +69,4 @@ stages: parameters: platform: ${{ platform }} configuration: Release - usingLatestWebView2: ${{ parameters.usingLatestWebView2 }} + useLatestWebView2: ${{ parameters.useLatestWebView2 }}