I'm posting this as an answer since others weren't completely clear and/or detailed IMHO
Starting from GitLab 8.12+, assuming the submodule repo is in the same server as the one requesting it, you can now:
Set up the repo with git submodules as usual (
git submodule add git@somewhere:folder/mysubmodule.git)Modify your
.gitmodulesfile as follows[submodule "mysubmodule"] path = mysubmodule url = ../../group/mysubmodule.gitwhere `../../group/mysubmodule.git'
../../group/mysubmodule.gitis a relative path from your repository to the submodule's one.Add the following lines to
gitlab-ci.ymlvariables: GIT_SUBMODULE_STRATEGY: recursiveto instruct the runner to fetch all submodules before the build.
Caveat: if your runner seems to ignore the GIT_SUBMODULE_STRATEGY directive, you should probably consider updating it.