To speed up and for reliability
- Use (own) docker images for the jobs that have all tools you need for your build already installed.
Your before_script should shrink to a minimum
- Use the GitLab CI cache but don't depend on them!!
"The cache is provided on a best-effort basis, so don't expect that the cache will be always present."
- "You can only use paths that are within the project workspace."
- Cache the caches!
Configure the tools to use folders within the project workspace and save that folder to the GitLab CI Cache
- Tag your runners
- Define a cache key that fits to your jobs. Don't override your good, filled cache!
- Use job templates and variables