Skip to content

ci: run module tests on Windows PowerShell 5.1 in shared workflow#7

Merged
tablackburn merged 2 commits into
psake:mainfrom
tablackburn:ci/add-windows-powershell-5.1-job
Jun 4, 2026
Merged

ci: run module tests on Windows PowerShell 5.1 in shared workflow#7
tablackburn merged 2 commits into
psake:mainfrom
tablackburn:ci/add-windows-powershell-5.1-job

Conversation

@tablackburn
Copy link
Copy Markdown
Contributor

Summary

Adds a dedicated test_powershell job to the shared ModuleCI.yml that builds and runs the full test suite under Windows PowerShell 5.1 (Desktop), alongside the existing PowerShell 7+ matrix (ubuntu/windows/macOS).

Desktop is not a runner OS, so it runs as its own job on windows-latest using the built-in powershell shell:

test_powershell:
  name: Run Tests (Windows PowerShell 5.1)
  runs-on: windows-latest
  steps:
    - uses: actions/checkout@v4
    - name: Test
      shell: powershell
      run: ./build.ps1 -Task Test -Bootstrap
    - name: Upload Unit Test Results
      ...

Its results are wired into publish-test-results (needs: [test, test_powershell]).

Motivation

Modules that declare Windows PowerShell (Desktop) support need the lowest supported engine exercised by CI, not just PowerShell 7+. PowerShellBuild 0.8.0 shipped a PS7-only ternary that broke module import on 5.1, and the pwsh-only test run did not catch it (psake/PowerShellBuild#126).

Notes / compatibility

  • The existing test job (id and Run Pwsh Tests name) is unchanged, so no required-status-check names change for current consumers.
  • The new 5.1 job runs unconditionally. No psake repo currently consumes this reusable workflow via uses: yet — fix: restore Windows PowerShell 5.1 import compatibility PowerShellBuild#126 is the first adopter — so blast radius today is limited to that PR.
  • If a future consumer does not support Desktop, we can gate this job behind a workflow_call input; left unconditional for now per maintainer direction.

🤖 Generated with Claude Code

Add a dedicated `test_powershell` job that builds and runs the full test
suite (`build.ps1 -Task Test -Bootstrap`) under Windows PowerShell 5.1
(Desktop) on windows-latest, alongside the existing PowerShell 7+ matrix.
Desktop is not a runner OS, so it runs as its own job using the built-in
`powershell` shell. Wire its results into publish-test-results.

Modules that declare Windows PowerShell (Desktop) support need the lowest
supported engine exercised by CI; PowerShellBuild 0.8.0 shipped a PS7-only
ternary that broke import on 5.1 and a pwsh-only test run did not catch it.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 3, 2026 22:08
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds a dedicated Windows PowerShell 5.1 test job to CI and wires it into the unit test results publishing flow.

Changes:

  • Add a test_powershell job that runs tests under Windows PowerShell 5.1 (shell: powershell) on windows-latest.
  • Update publish-test-results to depend on both test and test_powershell jobs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/ModuleCI.yml Outdated
Comment thread .github/workflows/ModuleCI.yml Outdated
tablackburn added a commit to psake/PowerShellBuild that referenced this pull request Jun 3, 2026
Point the caller's TODO at the upstream PR that adds the Windows
PowerShell 5.1 (test_powershell) job to the shared workflow.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Switch publish-test-results gate from `success() || failure()` to `!cancelled()` so results still publish if a needed test job is skipped, and update the stale comment that only referenced the single test job.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

@tablackburn tablackburn merged commit 221c32f into psake:main Jun 4, 2026
@tablackburn tablackburn deleted the ci/add-windows-powershell-5.1-job branch June 4, 2026 01:06
tablackburn added a commit to psake/PowerShellBuild that referenced this pull request Jun 4, 2026
psake/.github#7 is merged; staying on @main intentionally for this
internal CI workflow.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants