It appears that bash is not one of the supported languages for use in a matrix.
At first I tried building by own version from source, but was not particularly fast.
I then tried using the official docker versions of bash and this seemed to work.
This is the resulting config file:
language: bash
env:
- BASH=latest
- BASH=5.0.3
- BASH=4.4.23
- BASH=4.3.48
- BASH=4.2.53
before_script:
- docker pull bash:$BASH
- docker run bash:$BASH --version
script:
- docker run -v $PWD:/bash bash:$BASH bash/example/array.sh
- docker run -v $PWD:/bash bash:$BASH bash/example/human.sh
- docker run -v $PWD:/bash bash:$BASH bash/example/string.sh
- docker run -v $PWD:/bash bash:$BASH bash/example/testing.sh
- docker run -v $PWD:/bash bash:$BASH bash/example/trycatch.sh
To see this running:
https://travis-ci.com/mmcc007/bash-oo-framework/builds/105794384
This has limitations as it forces the script to run in a very lightweight docker container that for example does not have the ‘cd’ command.
Is there a better way to do script testing against multiple versions of bash?