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
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
/bin/bash --version | grep -q "version 3\." || (echo "Expected Bash 3.x" && exit 1)

- name: Install dependencies
run: brew install bats-core jq
run: brew install bats-core jq rush-parallel

- name: Run tests with Bash 3.2
run: /bin/bash ./test/run.sh
Expand All @@ -43,7 +43,7 @@ jobs:

- name: Install dependencies
run: |
sudo apt-get update && sudo apt-get install -y jq
sudo apt-get update && sudo apt-get install -y jq parallel
# Install bats-core from source (apt/npm packages are outdated)
git clone https://github.com/bats-core/bats-core.git /tmp/bats-core
sudo /tmp/bats-core/install.sh /usr/local
Expand Down
12 changes: 11 additions & 1 deletion test/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,14 @@ if ! command -v bats &>/dev/null; then
exit 1
fi

exec bats "$@" *.bats
# Auto-detect CPU cores for parallel execution
jobs=$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 1)

# Use rush (macOS) or parallel (Linux) for parallelization
if command -v rush &>/dev/null; then
exec bats --parallel-binary-name rush -j "$jobs" "$@" *.bats
elif command -v parallel &>/dev/null && parallel --version 2>&1 | grep -q "GNU"; then
exec bats -j "$jobs" "$@" *.bats
else
exec bats "$@" *.bats
fi