task: #3629903: Add GitLab CI using the drupal.org GitLab templates

Closes #3629903

Adds a .gitlab-ci.yml based on the drupal.org GitLab CI template, so merge requests get the standard contrib pipeline (composer, phpcs, phpstan, cspell, eslint and the others).

Changes

  • .gitlab-ci.yml: the drupal.org template, plus OPT_IN_TEST_PREVIOUS_MAJOR: '1', because field_expression.info.yml declares ^10.2 || ^11 and the default jobs only cover the current major. The Drupal 10 variant jobs do not run automatically; they can be started from the pipeline page.
  • .cspell-project-words.txt: module-specific words that cspell reported: the arc trigonometric function names, the webit package vendor, and the maintainer names in README.md. The template reads this file by default.
  • Spelling fixes for two words that cspell reported, instead of adding them to the dictionary:
    • Evalute to Evaluate in the "Evaluate empty tokens to zero?" setting title (ExpressionItem and ExpressionItemTrait).
    • Supress/supress to Suppress/suppress in the "Suppress Errors" setting title and description (ExpressionItem).

These are translatable strings, so existing translations of them will need to be translated again.

The phpunit and nightwatch jobs are only created when the project has tests, and stylelint only when it has CSS files, so they do not run yet and no SKIP_* variables are needed.

Testing

Run locally with the template's own default configuration files:

  • cspell: assets/.cspell.json prepared with scripts/prepare-cspell.php, core's dictionaries and cspell 9: 31 issues before, 0 after.
  • phpcs: assets/phpcs.xml.dist (Drupal standard, including yml and info files): no errors.
  • phpstan: level 0 with phpstan-drupal: no errors.

eslint was not run locally. For this module it only checks .yml files, and the job is allowed to fail.

Out of scope

  • OPT_IN_TEST_NEXT_MAJOR, which belongs with the Drupal 12 work in #3598184.
  • Adding tests.

Merge request reports

Loading
Loading