Problem/Motivation
The module has no .gitlab-ci.yml, so no pipeline runs on commits or merge requests. Coding standards, static analysis and the kernel test suite can currently only be run locally, which means every contribution has to be verified by hand before it is merged. For example, the tests added in #3625529 were only run in a local environment.
The module requires PostgreSQL with the PostGIS extension, and all kernel tests depend on it. A default CI setup running on MySQL/MariaDB or plain PostgreSQL would therefore not be able to run the test suite.
Steps to reproduce
- Open a merge request against
1.0.x. - No pipeline is triggered; no phpcs, phpstan or PHPUnit results are reported on the MR.
Proposed resolution
Add a .gitlab-ci.yml based on the Drupal Association's GitLab CI templates (include.drupalci.main.yml, include.drupalci.variables.yml, include.drupalci.workflows.yml), so that pipelines run on pushes and merge requests.
- Set
_TARGET_DB_TYPEtopgsqlso the tests run against PostgreSQL. - Make sure the database service used by the PHPUnit job has PostGIS available and the extension enabled. If the template's PostgreSQL image does not ship PostGIS, override the database service with a PostGIS image (for example
postgis/postgis) of a matching PostgreSQL version. - Keep the template's default jobs: composer, phpcs, phpstan, cspell, eslint/stylelint (where applicable) and PHPUnit.
- Fix any phpcs, phpstan or cspell findings on existing code that would make the pipeline fail, or document them in the CI configuration where fixing them is out of scope.
Remaining tasks
- Verify whether the template's PostgreSQL image includes PostGIS.
- Add
.gitlab-ci.ymlwith the PostGIS-enabled database service. - Get a green pipeline on
1.0.x. - Review.
User interface changes
None.
API changes
None.
Data model changes
None.
Issue fork eca_geofield-3625568
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #4
orkutmuratyilmaz