From fdd216191125be16893819e77633fd584a3a249d Mon Sep 17 00:00:00 2001 From: Hal <22532613+HalRiveria@users.noreply.github.com> Date: Tue, 27 Oct 2026 14:05:43 -0400 Subject: [PATCH] Add CI test workflow and release asset workflow - tests.yml runs ParallelKit.Harness.ps1 on Windows PowerShell 5.1 for every pull request and every push to main. - release-asset.yml attaches ParallelKit.ps1 to each published release. - README: test status badge, and a note that CI runs the harness. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/release-asset.yml | 34 +++++++++++++++++++++++++++++ .github/workflows/tests.yml | 26 ++++++++++++++++++++++ README.md | 4 ++++ 3 files changed, 64 insertions(+) create mode 100644 .github/workflows/release-asset.yml create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/release-asset.yml b/.github/workflows/release-asset.yml new file mode 100644 index 0000000..6977128 --- /dev/null +++ b/.github/workflows/release-asset.yml @@ -0,0 +1,34 @@ +name: Release asset + +# Attaches ParallelKit.ps1 to a release when it is published, so users can +# download the one file they need. Re-run by hand for an existing tag if needed. +on: + release: + types: [published] + workflow_dispatch: + inputs: + tag: + description: Existing release tag to attach the file to (e.g. v1.0) + required: true + +permissions: + contents: write + +jobs: + attach: + name: Attach ParallelKit.ps1 + # Windows, so the attached file has Windows (CRLF) line endings. + runs-on: windows-latest + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ github.event.release.tag_name || inputs.tag }} + + - name: Upload + shell: powershell + env: + GH_TOKEN: ${{ github.token }} + TAG: ${{ github.event.release.tag_name || inputs.tag }} + run: | + gh release upload $env:TAG ParallelKit.ps1 --clobber + exit $LASTEXITCODE diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..d2546cd --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,26 @@ +name: Tests + +on: + pull_request: + push: + branches: [main] + workflow_dispatch: + +permissions: + contents: read + +jobs: + harness: + name: Harness + runs-on: windows-latest + timeout-minutes: 15 + steps: + - uses: actions/checkout@v4 + + # Windows PowerShell 5.1 (shell: powershell), the version the kit targets. + # A fresh powershell.exe so the kit's compiled types load clean. + - name: Run ParallelKit.Harness.ps1 + shell: powershell + run: | + & powershell.exe -NoProfile -ExecutionPolicy Bypass -File .\ParallelKit.Harness.ps1 + exit $LASTEXITCODE diff --git a/README.md b/README.md index befb6da..ec465b3 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # ParallelKit +[![Tests](https://github.com/HalRiveria/PowerShell-5.1-Parallelization-and-Multithreading-Script/actions/workflows/tests.yml/badge.svg)](https://github.com/HalRiveria/PowerShell-5.1-Parallelization-and-Multithreading-Script/actions/workflows/tests.yml) + Run thousands of command-line programs, or blocks of PowerShell code, in parallel from Windows PowerShell 5.1, and stop cleanly when you press Ctrl+C. One file, nothing to install. - **Process dispatch** - run many external programs, a set number at a time, with their output captured. @@ -250,6 +252,8 @@ powershell -NoProfile -File .\ParallelKit.Harness.ps1 It uses real runspaces and real child processes (`cmd.exe`, `ping.exe`), with nothing mocked, so it takes about a minute. It prints a `[PASS]`/`[FAIL]` line per check and exits 0 only if everything passed. A few `message handler failed` lines in the output are expected: some checks break the message handler on purpose to test the fallback. +GitHub runs the same harness on Windows PowerShell 5.1 for every pull request and every change to `main`. + ## License MIT - see `LICENSE`.