################
# GitLabCI template for Drupal projects.
#
# This template is designed to give any Contrib maintainer everything they need to test, without requiring modification.
# It is also designed to keep up to date with Core Development automatically through the use of include files that can be centrally maintained.
# As long as you include the project, ref and three files below, any future updates added by the Drupal Association will be used in your
# pipelines automatically. However, you can modify this template if you have additional needs for your project.
# The full documentation is on https://project.pages.drupalcode.org/gitlab_templates/
################

# For information on alternative values for 'ref' see https://project.pages.drupalcode.org/gitlab_templates/info/templates-version/
# To test a Drupal 7 project, change the first include filename from .main.yml to .main-d7.yml
include:
  - project: $_GITLAB_TEMPLATES_REPO
    ref: $_GITLAB_TEMPLATES_REF
    file:
      - "/includes/include.drupalci.main.yml"
      - "/includes/include.drupalci.variables.yml"
      - "/includes/include.drupalci.workflows.yml"

################
# Pipeline configuration variables are defined with default values and descriptions in the file
# https://git.drupalcode.org/project/gitlab_templates/-/blob/main/includes/include.drupalci.variables.yml
# Uncomment the lines below if you want to override any of the variables. The following is just an example.
################
variables:
  _PHPUNIT_CONCURRENT: 1
  OPT_IN_TEST_MAX_PHP: 1
  OPT_IN_TEST_NEXT_MINOR: 1
  OPT_IN_TEST_PREVIOUS_MAJOR: 1
  _LENIENT_ALLOW_LIST: "select2, styleguide"
  _CSPELL_IGNORE_PATHS: 'webform.libraries.yml,
  config/install/*,
  config/schema/*,
  tests/modules/*/config/*,
  modules/*/js/*,
  modules/*/tests/modules/*/config/*,
  modules/*/config/install/*,
  includes/webform.libraries.inc,
  js/*, css/*,
  tests/files/*,
  modules/*/tests/modules/*/files/*.csv,
  modules/*/tests/modules/*/style-guide/*'
  _PHPCS_EXTRA: '--ignore=*/modules/webform_bootstap/*'

phpcs:
  allow_failure: false

# Todo: Remove this workaround once all our dependencies are D11 compatible.
phpunit:
  allow_failure: false
  before_script:
    - 'sed -i "s/core_version_requirement.*/core_version_requirement: \^11/" web/modules/contrib/**/*.info.yml'
    # Replace versions in submodules too.
    - 'sed -i "s/core_version_requirement.*/core_version_requirement: \^11/" web/modules/contrib/**/**/*.info.yml'

phpunit (previous major):
  before_script: []

# Allow max PHP tests to fail as deprecations in other modules will fail this pipeline.
phpunit (max PHP version):
  allow_failure: true
