From 59f62e1fceab50118707122061ce9017f703c900 Mon Sep 17 00:00:00 2001 From: Trent Blackburn Date: Wed, 3 Jun 2026 18:07:15 -0400 Subject: [PATCH 1/2] ci: run module tests on Windows PowerShell 5.1 in shared workflow 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) --- .github/workflows/ModuleCI.yml | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ModuleCI.yml b/.github/workflows/ModuleCI.yml index 5b10ae1..6c1a3d5 100644 --- a/.github/workflows/ModuleCI.yml +++ b/.github/workflows/ModuleCI.yml @@ -43,9 +43,29 @@ jobs: with: name: Unit Test Results (OS ${{ matrix.os }}) path: ./tests/out/testResults.xml + test_powershell: + name: Run Tests (Windows PowerShell 5.1) + # Windows PowerShell 5.1 (Desktop) is not a runner OS, so it is run as a + # separate job using the built-in `powershell` shell on windows-latest. + # Modules that declare Windows PowerShell (Desktop) support must build and + # test cleanly on the lowest supported engine, not just PowerShell 7+. + runs-on: windows-latest + steps: + - uses: actions/checkout@v4 + - name: Test + shell: powershell + run: ./build.ps1 -Task Test -Bootstrap + - name: Upload Unit Test Results + if: always() + uses: actions/upload-artifact@v4 + with: + name: Unit Test Results (Windows PowerShell 5.1) + path: ./tests/out/testResults.xml publish-test-results: name: "Publish Unit Tests Results" - needs: test + needs: + - test + - test_powershell runs-on: ubuntu-latest # the test job might be skipped, we don't need to run this job then if: success() || failure() From b17bcc4f5cb945c5a01c89995b49de4877a1b81d Mon Sep 17 00:00:00 2001 From: Trent Blackburn Date: Wed, 3 Jun 2026 20:52:03 -0400 Subject: [PATCH 2/2] ci: publish results unless workflow is cancelled 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) --- .github/workflows/ModuleCI.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ModuleCI.yml b/.github/workflows/ModuleCI.yml index 6c1a3d5..52ecf51 100644 --- a/.github/workflows/ModuleCI.yml +++ b/.github/workflows/ModuleCI.yml @@ -67,8 +67,9 @@ jobs: - test - test_powershell runs-on: ubuntu-latest - # the test job might be skipped, we don't need to run this job then - if: success() || failure() + # Publish whenever the test jobs ran (pass or fail); only skip if the + # workflow itself was cancelled. + if: ${{ !cancelled() }} steps: - name: Download Artifacts uses: actions/download-artifact@v4