prepare_shop:
  matrix: &matrix
    php: &matrix_php '["8.1", "8.2"]'
    mysql: &matrix_mysql '["8.0"]'
  specific: &specific_matrix
    php: '["8.1"]'
    mysql: '["8.0"]'
  git:
    shop_ref: '{{ .Data.global.git.default_ref }}'

install_shop:
  matrix: *matrix

install_module:
  matrix:
    <<: *matrix
    testplan: '["-"]'
  cache:
    prefix: &install_module_prefix 'moduleInstallation-ce-{{ .Github.SHA }}-{{ .Github.RunNumber }}-{{ .Github.RunAttempt }}'
  ids: &ids 'oxps_usercentrics'
  activate: *ids
  git:
    module:
      url: &git_module_url '{{ .Github.Repository }}'
      ref: '{{ .Github.RefName }}'
  package_name: &package_name 'oxid-professional-services/usercentrics'
  path: *ids

phpunit:
  matrix:
    <<: *matrix
    testplan: '["tests/github_actions/defaults/module_phpunit_unit.yml","tests/github_actions/defaults/module_phpunit_integration.yml"]'
  load_shop: *install_module_prefix

codeception:
  matrix:
    <<: *matrix
    testplan: '["-"]'
  load_shop: *install_module_prefix
  title: codeception
  container:
    options: '-e SELENIUM_SERVER_HOST=selenium -e BROWSER_NAME=chrome -e XDEBUG_MODE=coverage -e THEME_ID=apex'
  configuration: '/var/www/vendor/oxid-professional-services/usercentrics/tests/codeception.yml'
  suite: 'Acceptance'
  additional_options: '--coverage-xml=/var/www/codeception_coverage.xml'
  logfile:
    prefix: 'codeception'
  output:
    prefix: 'codeception-artifacts'
  coverage:
    path: 'source/codeception_coverage.xml'

runtest:
  matrix:
    testplan: 'skip'
  load_shop: *install_module_prefix

sonarcloud:
  matrix:
    <<: *specific_matrix
    testplan: '["-"]'
  project_key: 'OXID-eSales_usercentrics'
  project_name: *package_name
  parameters: |
    -Dsonar.language=php
    -Dsonar.scm.provider=git
    -Dsonar.sources=src
    -Dsonar.tests=tests

phpcs_tests:
  skip: true

styles:
  matrix:
    <<: *specific_matrix
    testplan: '["-"]'
  load_shop: *install_module_prefix
  path: *ids
  module_ids: *ids

finish:
  slack_title: 'Module oxps_usercentrics on {{ .Github.Repository }} by {{ .Github.Actor }}'