Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test PowerShell Preview in CI instead of Daily #2225

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 4 additions & 17 deletions .github/workflows/ci-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@ on:
branches: [ main ]
pull_request:
branches: [ main ]
merge_group:
types: [ checks_requested ]
schedule:
# 6am UTC which should be after a new daily build posts
- cron: "0 6 * * *"

jobs:
ci:
Expand All @@ -36,29 +31,21 @@ jobs:
shell: pwsh
run: ./tools/installPSResources.ps1

- name: Download daily install script
if: ${{ github.event_name == 'schedule' || github.event_name == 'merge_group' }}
- name: Download PowerShell install script
uses: actions/checkout@v4
with:
repository: PowerShell/PowerShell
path: pwsh
sparse-checkout: tools/install-powershell.ps1
sparse-checkout-cone-mode: false

- name: Install daily
if: ${{ github.event_name == 'schedule' || github.event_name == 'merge_group' }}
continue-on-error: true
- name: Install preview
shell: pwsh
run: ./pwsh/tools/install-powershell.ps1 -Daily
run: ./pwsh/tools/install-powershell.ps1 -Preview

- name: Build and test
shell: pwsh
run: Invoke-Build -Configuration Release ${{ github.event_name == 'merge_group' && 'TestFull' || 'Test' }}

- name: Test daily
if: ${{ github.event_name == 'schedule' }}
shell: pwsh
run: Invoke-Build -Configuration Release TestE2EDaily
run: Invoke-Build -Configuration Release TestFull

- name: Upload build artifacts
if: always()
Expand Down
15 changes: 8 additions & 7 deletions PowerShellEditorServices.build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -227,16 +227,17 @@ Task TestE2EPwsh Build, SetupHelpForTests, {
Invoke-BuildExec { & dotnet $script:dotnetTestArgs $script:NetFramework.PS74 }
}

$PwshDaily = if ($script:IsNix) {
"$HOME/.powershell-daily/pwsh"
$PwshPreview = if ($script:IsNix) {
"$HOME/.powershell-preview/pwsh"
} else {
"$env:LOCALAPPDATA/Microsoft/powershell-daily/pwsh.exe"
"$env:LOCALAPPDATA/Microsoft/powershell-preview/pwsh.exe"
}

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

Expand Down Expand Up @@ -314,6 +315,6 @@ Task BuildIfChanged -Inputs {

Task Test TestPS74, TestE2EPwsh, TestPS51, TestE2EPowerShell

Task TestFull Test, TestE2EDaily, TestE2EPwshCLM, TestE2EPowerShellCLM
Task TestFull Test, TestE2EPreview, TestE2EPwshCLM, TestE2EPowerShellCLM

Task . Clean, Build, Test
Loading