This may sound funny, but adding a simple build status badge (or shield if you prefer) on GitLab can be a bit tricky since it is not clearly documented.
Apparently over the time GitLab namespace scheme has changed resulting in older HOW-TOs failure. Currently you just need to add following line to your README.md (or any other markdown file you prefer):
Replace user_name, project_name and branch with appropriate names. If you haven’t deleted default master branch in git, you can safely replace branch with master or any other existing branch name. To list branches in you repository just issue:
$ git branch
It is worth mentioning that GitLab is using own flavor of mark down. Check GitLab Flavored Markdown for details.
If you are using GitLab CE or EE just replace the first part of the badge url to point to your server. If for some reason you are not using DNS but IP addresses this still will work, just put IP address instead of domain name.
TIP: If you are building from more than one branch you can insert badges for every branch. This helps tracking your current status.