Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit f2b242f

Browse files
Test PowerShell Preview in CI instead of Daily (#2225)
1 parent 7935cf8 commit f2b242f

File tree

2 files changed

+17
-29
lines changed

2 files changed

+17
-29
lines changed

‎.github/workflows/ci-test.yml‎

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,6 @@ on:
55
branches: [ main ]
66
pull_request:
77
branches: [ main ]
8-
merge_group:
9-
types: [ checks_requested ]
10-
schedule:
11-
# 6am UTC which should be after a new daily build posts
12-
- cron: "0 6 * * *"
138

149
jobs:
1510
ci:
@@ -36,35 +31,27 @@ jobs:
3631
shell: pwsh
3732
run: ./tools/installPSResources.ps1
3833

39-
- name: Download daily install script
40-
if: ${{ github.event_name == 'schedule' || github.event_name == 'merge_group' }}
34+
- name: Download PowerShell install script
4135
uses: actions/checkout@v4
4236
with:
4337
repository: PowerShell/PowerShell
4438
path: pwsh
4539
sparse-checkout: tools/install-powershell.ps1
4640
sparse-checkout-cone-mode: false
4741

48-
- name: Install daily
49-
if: ${{ github.event_name == 'schedule' || github.event_name == 'merge_group' }}
50-
continue-on-error: true
42+
- name: Install preview
5143
shell: pwsh
52-
run: ./pwsh/tools/install-powershell.ps1 -Daily
44+
run: ./pwsh/tools/install-powershell.ps1 -Preview -Destination ./preview
5345

54-
- name: If Debugging, start upterm for interactive pipeline troubleshooting
46+
- name: If debugging, start upterm for interactive pipeline troubleshooting
5547
if: ${{ runner.debug == 1 }}
5648
uses: lhotari/action-upterm@v1
5749
with:
5850
wait-timeout-minutes: 1
5951

6052
- name: Build and test
6153
shell: pwsh
62-
run: Invoke-Build -Configuration Release ${{ github.event_name == 'merge_group' && 'TestFull' || 'Test' }}
63-
64-
- name: Test daily
65-
if: ${{ github.event_name == 'schedule' }}
66-
shell: pwsh
67-
run: Invoke-Build -Configuration Release TestE2EDaily
54+
run: Invoke-Build -Configuration Release TestFull
6855

6956
- name: Upload build artifacts
7057
if: always()

‎PowerShellEditorServices.build.ps1‎

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -263,11 +263,11 @@ Task SetupHelpForTests {
263263
}
264264
}
265265

266-
if ($PwshDaily -and (Get-Command $PwshDaily -ea 0)) {
267-
Write-Build DarkMagenta "Checking PowerShell Daily help at $PwshDaily"
268-
Invoke-BuildExec { & $PwshDaily -NoProfile -NonInteractive -Command $installHelpScript -args $helpPath }
266+
if ($PwshPreview -and (Get-Command $PwshPreview -ea 0)) {
267+
Write-Build DarkMagenta "Checking PowerShell Preview help at $PwshPreview"
268+
Invoke-BuildExec { & $PwshPreview -NoProfile -NonInteractive -Command $installHelpScript -args $helpPath }
269269
if ($LASTEXITCODE -ne 0) {
270-
throw 'Failed to install PowerShell Daily help!'
270+
throw 'Failed to install PowerShell Preview help!'
271271
}
272272
}
273273

@@ -307,16 +307,17 @@ Task TestE2EPwsh Build, SetupHelpForTests, {
307307
Invoke-BuildExec { & dotnet $script:dotnetTestArgs $script:NetFramework.PS74 }
308308
}
309309

310-
$PwshDaily=if ($script:IsNix) {
311-
"$HOME/.powershell-daily/pwsh"
310+
if ($env:GITHUB_ACTIONS) {
311+
$PwshPreview=if ($script:IsNix) { "$PSScriptRoot/preview/pwsh" } else { "$PSScriptRoot/preview/pwsh.exe" }
312312
} else {
313-
"$env:LOCALAPPDATA/Microsoft/powershell-daily/pwsh.exe"
313+
$PwshPreview=if ($script:IsNix) { "$HOME/.powershell-preview/pwsh" } else { "$env:LOCALAPPDATA/Microsoft/powershell-preview/pwsh.exe" }
314314
}
315315

316-
Task TestE2EDaily -If (Test-Path $PwshDaily) Build, SetupHelpForTests, {
316+
Task TestE2EPreview Build, SetupHelpForTests, {
317+
Assert (Test-Path $PwshPreview) "PowerShell Preview not found at $PwshPreview, please install it: https://github.com/PowerShell/PowerShell/blob/master/tools/install-powershell.ps1"
317318
Set-Location ./test/PowerShellEditorServices.Test.E2E/
318-
$env:PWSH_EXE_NAME = $PwshDaily
319-
Write-Build DarkGreen "Running end-to-end tests with: $(& $PwshDaily --version)"
319+
$env:PWSH_EXE_NAME = $PwshPreview
320+
Write-Build DarkGreen "Running end-to-end tests with: $(& $PwshPreview --version)"
320321
Invoke-BuildExec { & dotnet $script:dotnetTestArgs $script:NetFramework.PS74 }
321322
}
322323

@@ -394,6 +395,6 @@ Task BuildIfChanged -Inputs {
394395

395396
Task Test TestPS74, TestE2EPwsh, TestPS51, TestE2EPowerShell
396397

397-
Task TestFull Test, TestE2EDaily, TestE2EPwshCLM, TestE2EPowerShellCLM
398+
Task TestFull Test, TestE2EPreview, TestE2EPwshCLM, TestE2EPowerShellCLM
398399

399400
Task . Clean, Build, Test

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /