-
-
Notifications
You must be signed in to change notification settings - Fork 48
Support Bash 3.0 #584
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Support Bash 3.0 #584
Changes from 11 commits
Commits
Show all changes
43 commits
Select commit
Hold shift + click to select a range
e374f8c
feat: lower minimum bash version requirement from 3.2 to 3.0
Chemaclass 5100702
fix: complete Bash 3.0 compatibility fixes
Chemaclass 3a10363
fix: Bash 3.0 compatibility for assert_contains_ignore_case
Chemaclass c2fbe67
ci: run Bash 3.0 tests in parallel jobs
Chemaclass 01dba04
fix: resolve shellcheck and lint errors
Chemaclass 05ffbe1
ci: remove read-only flag from Docker volume mount
Chemaclass 032107b
ci: add procps package for ps command in Docker
Chemaclass bfd3d97
ci: trigger fresh build
Chemaclass 46f94b6
test: skip mock/spy external script tests on Bash 3.0
Chemaclass 9235356
fix: use local -a for safe Bash 3.0 array init, fix variable scoping
Chemaclass af54c95
Merge branch 'main' into feat/support-bash-3.0
Chemaclass e274b8a
Merge branch 'main' into feat/support-bash-3.0
Chemaclass 313c540
fix: improve Bash 3.0 regex compatibility and assignment quoting
Chemaclass 54a1ff1
fix: prevent variable leakage in loops across all source files
Chemaclass 68941fc
fix: add local declarations for all remaining loop variables
Chemaclass d7cd950
fix: initialize all loop variables to prevent unbound variable errors…
Chemaclass d68762c
fix: make array iteration safe for strict mode (set -u)
Chemaclass de43885
fix: remove redundant array size check in benchmark print function
Chemaclass a0e86ea
fix(runner): expand test_file at trap definition time to prevent unbo…
Chemaclass 9c8f621
fix(compat): harden regex matching, array expansion, and parameter subs
Chemaclass ec935c2
revert: remove unnecessary loop variable initializations from d7cd950
Chemaclass 421fbee
fix(coverage): initialize lineno counter to prevent strict mode error
Chemaclass e9be71b
fix(compat): address PR feedback for Bash 3.0 compatibility
Chemaclass 834bd32
fix(compat): convert all literal regex patterns to variables
Chemaclass ea2970a
fix(compat): move regex pattern outside loop in doc.sh
Chemaclass bc993e1
fix(compat): use glob pattern instead of regex for code fence
Chemaclass 81d47c4
Update src/reports.sh
Chemaclass 2915045
Update src/runner.sh
Chemaclass a8be738
Update src/reports.sh
Chemaclass 4cc506e
Update src/helpers.sh
Chemaclass 8758009
Update src/main.sh
Chemaclass ec1f282
Update src/helpers.sh
Chemaclass 47ced2c
Update src/learn.sh
Chemaclass 90ba80a
Update src/main.sh
Chemaclass 1280a79
fix(compat): store literal regex patterns in variables for Bash 3.0
Chemaclass 172026f
fix(compat): simplify array init and add IFS guards
Chemaclass eda74cc
style: fix indentation from 8 spaces to 2 in acceptance tests and con…
Chemaclass 197f4b2
refactor(compat): inline regex matching and remove bashunit::regex_ma…
Chemaclass a4e0ea6
fix(compat): add IFS guards to assert functions and fix array expansi…
Chemaclass 320942c
fix(style): revert formatting changes to bin/ files
Chemaclass 0944c13
docs: update Bash version references from 3.2+ to 3.0+
Chemaclass 6dbb3e4
fix(style): bashunit
Chemaclass 2c62d75
fix(compat): guard empty array expansion in parse_result_parallel
Chemaclass File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,101 @@ | ||
| name: Bash 3.0 Compatibility | ||
|
|
||
| on: | ||
| pull_request: | ||
| push: | ||
| branches: | ||
| - main | ||
|
|
||
| jobs: | ||
| build-image: | ||
| name: "Build Bash 3.0 Image" | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 15 | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 1 | ||
|
|
||
| - name: Build Bash 3.0 Docker image | ||
| run: | | ||
| docker build -t bashunit-bash3 -f - . <<'EOF' | ||
| FROM debian:bullseye-slim | ||
|
|
||
| RUN apt-get update && apt-get install -y \ | ||
| build-essential \ | ||
| curl \ | ||
| ca-certificates \ | ||
| bison \ | ||
| git \ | ||
| procps \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| WORKDIR /tmp | ||
| RUN curl -LO https://ftp.gnu.org/gnu/bash/bash-3.0.tar.gz \ | ||
| && tar xzf bash-3.0.tar.gz \ | ||
| && cd bash-3.0 \ | ||
| && curl -fsSL -o support/config.guess 'https://raw.githubusercontent.com/gcc-mirror/gcc/master/config.guess' \ | ||
| && curl -fsSL -o support/config.sub 'https://raw.githubusercontent.com/gcc-mirror/gcc/master/config.sub' \ | ||
| && chmod +x support/config.guess support/config.sub \ | ||
| && ./configure --prefix=/opt/bash-3.0 \ | ||
| && make \ | ||
| && make install \ | ||
| && rm -rf /tmp/bash-3.0* | ||
|
|
||
| WORKDIR /bashunit | ||
| CMD ["/opt/bash-3.0/bin/bash", "--version"] | ||
| EOF | ||
|
|
||
| - name: Save Docker image | ||
| run: docker save bashunit-bash3 -o /tmp/bashunit-bash3.tar | ||
|
|
||
| - name: Upload Docker image artifact | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: bashunit-bash3-image | ||
| path: /tmp/bashunit-bash3.tar | ||
| retention-days: 1 | ||
|
|
||
| test: | ||
| name: "Bash 3.0 - ${{ matrix.name }}" | ||
| runs-on: ubuntu-latest | ||
| needs: build-image | ||
| timeout-minutes: 15 | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| include: | ||
| - name: "Sequential" | ||
| flags: "" | ||
| - name: "Parallel" | ||
| flags: "--parallel" | ||
| - name: "Simple" | ||
| flags: "--simple" | ||
| - name: "Simple Parallel" | ||
| flags: "--simple --parallel" | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 1 | ||
|
|
||
| - name: Download Docker image artifact | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: bashunit-bash3-image | ||
| path: /tmp | ||
|
|
||
| - name: Load Docker image | ||
| run: docker load --input /tmp/bashunit-bash3.tar | ||
|
|
||
| - name: Verify Bash 3.0 version | ||
| run: docker run --rm bashunit-bash3 /opt/bash-3.0/bin/bash --version | ||
|
|
||
| - name: Run tests with Bash 3.0 (${{ matrix.name }}) | ||
| run: | | ||
| docker run --rm \ | ||
| -v "$(pwd)":/bashunit \ | ||
| -w /bashunit \ | ||
| bashunit-bash3 \ | ||
| /opt/bash-3.0/bin/bash ./bashunit ${{ matrix.flags }} tests/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.