Skip to content
Merged
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
34 changes: 34 additions & 0 deletions .github/workflows/release-asset.yml
Original file line number Diff line number Diff line change
@@ -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
26 changes: 26 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -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
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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`.
Loading