I have a matrix variable setup like this -
strategy:
matrix:
compiler: [gcc-5, gcc-6, gcc-8, gcc-9, clang-4, clang-7, clang-8, clang-9, clang-10, clang-11]
How do I extract the numbers from this?
I tried doing -
if [ "${{ matrix.compiler }}" = *"gcc"* ]; then
echo "CC=gcc-${{ matrix.compiler }:4:1}" >> $GITHUB_ENV
echo "CXX=g++-${{ matrix.compiler }:4:1}" >> $GITHUB_ENV
else
echo "CC=clang-${{ matrix.compiler }:5:1}" >> $GITHUB_ENV
echo "CXX=clang++${{ matrix.compiler }:5:1}" >> $GITHUB_ENV
fi
where I try to get the 4th and the 5th character from the string as ${{ matrix.compiler }:4:1}
and ${{ matrix.compiler }:5:1}
but that doesn’t work