Follow https://docs.gitlab.com/ee/ci/yaml/#parallelmatrix to simplify .gitlab-ci.yml file.
.gitlab-ci.yml