diff --git a/.github/workflows/bash-versions.yml b/.github/workflows/bash-versions.yml new file mode 100644 index 00000000..6e9f717a --- /dev/null +++ b/.github/workflows/bash-versions.yml @@ -0,0 +1,41 @@ +name: "Bash version compatibility" + +on: + push: + branches: [bash-5.3] + pull_request: + branches: [bash-5.3] + workflow_dispatch: + inputs: + bash_versions: + description: "Comma-separated Bash versions to test" + default: "5.0,5.1,5.2,5.3" + +jobs: + versions: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.matrix.outputs.matrix }} + steps: + - id: matrix + env: + VERSIONS: ${{ inputs.bash_versions || '5.0,5.1,5.2,5.3' }} + run: echo "matrix=$(jq -Rc 'split(",") | map(gsub("\\s"; "")) | map(select(. != "")) | unique' <<< "$VERSIONS")" >> "$GITHUB_OUTPUT" + + tests: + name: "Bash ${{ matrix.bash }}" + needs: versions + runs-on: ubuntu-latest + timeout-minutes: 15 + container: bash:${{ matrix.bash }} + strategy: + fail-fast: false + matrix: + bash: ${{ fromJSON(needs.versions.outputs.matrix) }} + steps: + - run: apk add build-base autoconf automake libtool texinfo git coreutils diffutils findutils grep sed gawk perl + - uses: actions/checkout@v7 + - run: bash ./autogen.sh --with-bash="$(command -v bash)" + - run: make -j3 check + env: + VERBOSE: 1 diff --git a/configure.ac b/configure.ac index 57886f70..f84d3a76 100644 --- a/configure.ac +++ b/configure.ac @@ -103,12 +103,12 @@ bash_version=`$SH_PROG --version` [bash_minor=`$SH_PROG -c 'echo ${BASH_VERSINFO[1]}'`] bash_5_or_greater=no case "${bash_major}.${bash_minor}" in - 'OK_BASH_VERS' | '5.2' ) + 'OK_BASH_VERS' | '5.2' | '5.1' | '5.0' ) bash_5_or_greater=yes ;; *) AC_MSG_WARN([You have Bash $bash_version installed.]) - AC_MSG_ERROR([This package is only known to work with Bash 5.2 or Bash 5.3]) + AC_MSG_ERROR([This package is only known to work with Bash 5.0 through 5.3]) ;; esac