GitLab CI for Drupal 11+¶
Since 2022 Drupal.org provide a great GitLab CI integration, this project was created before and is not related to the official Drupal way of using GitLab CI with a Drupal.org module or theme.
If you are looking for Drupal.org GitLab CI see GitLab Templates.
This project aim to provide a GitLab CI quick setup if you do not host your code on drupal.org.

GitLab CI for a Drupal module / theme or full project.
Include Build, Testing, Code quality, Metrics and more...
For any issue, please use the GitLab CI project page
Based on an include behavior, ie you don't have to copy all files from this project.
Prerequisites¶
- GitLab CI with a runner that support docker
- Minimal understanding of GitLab CI and GitLab CI Yaml
Documentation¶
Quick setup¶
What version to use¶
| Drupal core | GitLab CI for Drupal |
|---|---|
| Drupal ^10+ | 4.x-dev |
| Drupal ^11 | 11.x-dev |
Quick setup for a Drupal module / theme¶
Push your module / theme to a Gitlab with CI and runners enabled.
Gitlab.com offer some CI pipeline minutes/month on free accounts.
- Copy starter.gitlab-ci.yml file as a
.gitlab-ci.ymlat the root of your Drupal module or theme (same level asmy_module_or_theme.info.ymlfile). - If your project is not on Gitlab.com, edit the
includesection et the beginning. - Edit the
variablesand uncomment the section underOverride default variables for a module - Create and push your branch, see the pipeline running for basic code standard and lint.
External module demo, real module example Content moderation edit notify
For more option and details see the full documentation.
Quick setup for a full Drupal project¶
Push your project to a Gitlab with CI and runners enabled.
Gitlab.com offer some CI pipeline minutes/month on free accounts.
Assuming your project include a composer.json file from the Drupal project.
- Copy starter.gitlab-ci.yml file as a
.gitlab-ci.ymlin your project - If you are using Behat you must add your tests in a
behat_testsfolders at the root of your Drupal project (same level ascomposer.jsonfile). - As a starting point you can look in the behat_tests folder of this project.
- Put your custom code in the
web/modules/customandweb/themes/customfolders of your project. - Create and push your branch, see the pipeline running for basic code standard, lint, tests and metrics.
External project demo.
As an example you can check my project on a Drupal template: Drupal project advanced template
For more option and details see the full documentation.
Want some help implementing this on your project? I provide Drupal expertise as a freelance, just contact me.
If you want to support this project, you can:
