drupal/.gitlab-ci.yml

134 lines
3.7 KiB
YAML
Raw Normal View History

################
# Drupal GitLabCI template.
#
# Based off GitlabCI templates project: https://git.drupalcode.org/project/gitlab_templates
# Guide: https://www.drupal.org/docs/develop/git/using-gitlab-to-contribute-to-drupal/gitlab-ci
#
# With thanks to:
# - The GitLab Acceleration Initiative participants
# - DrupalSpoons
################
################
# Includes
#
# Additional configuration can be provided through includes.
# One advantage of include files is that if they are updated upstream, the
# changes affect all pipelines using that include.
#
# Includes can be overridden by re-declaring anything provided in an include,
# here in gitlab-ci.yml.
# https://docs.gitlab.com/ee/ci/yaml/includes.html#override-included-configuration-values
################
include:
- project: $_GITLAB_TEMPLATES_REPO
ref: $_GITLAB_TEMPLATES_REF
file:
- '/includes/include.drupalci.variables.yml'
- '/includes/include.drupalci.workflows.yml'
################
# Variables
#
# Overriding variables
# - To override one or more of these variables, simply declare your own variables keyword.
# - Keywords declared directly in .gitlab-ci.yml take precedence over include files.
# - Documentation: https://docs.gitlab.com/ee/ci/variables/
# - Predefined variables: https://docs.gitlab.com/ee/ci/variables/predefined_variables.html
#
################
variables:
COMPOSER: composer.json
# Let composer know what self.version means.
COMPOSER_ROOT_VERSION: "${CI_MERGE_REQUEST_TARGET_BRANCH_NAME}${CI_COMMIT_BRANCH}-dev"
CONCURRENCY: 32
GIT_DEPTH: "3"
################
# Stages
#
# Each job is assigned to a stage, defining the order in which the jobs are executed.
# Jobs in the same stage run in parallel.
#
# If all jobs in a stage succeed, the pipeline will proceed to the next stage.
# If any job in the stage fails, the pipeline will exit early.
################
.default-stage: &default-stage
stage: test
trigger:
# Rely on the status of the child pipeline.
strategy: depend
include:
- local: .gitlab-ci/pipeline.yml
.run-on-commit: &run-on-commit
rules:
- if: $CI_PIPELINE_SOURCE == "push" && $CI_PROJECT_ROOT_NAMESPACE == "project"
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
when: manual
allow_failure: true
.run-daily: &run-daily
rules:
- if: $CI_PIPELINE_SOURCE == "schedule" && $CI_PROJECT_ROOT_NAMESPACE == "project"
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
when: manual
allow_failure: true
# Default configuration.
'PHP 8.2 MySQL 8':
<<: *default-stage
variables:
_TARGET_PHP: "8.2"
_TARGET_DB: "mysql-8"
rules:
- if: $CI_PIPELINE_SOURCE == "push" && $CI_PROJECT_ROOT_NAMESPACE == "project"
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
# Run on commit, or manually.
'PHP 8.1 MySQL 5.7':
<<: [ *default-stage, *run-on-commit ]
variables:
_TARGET_PHP: "8.1"
_TARGET_DB: "mysql-5.7"
'PHP 8.2 PostgreSQL 14.1':
<<: [ *default-stage, *run-on-commit ]
variables:
_TARGET_PHP: "8.2"
_TARGET_DB: "pgsql-14.1"
# 'PHP 8.2 SQLite 3.34.0':
# <<: [ *default-stage, *run-on-commit ]
# variables:
# _TARGET_PHP: "8.2"
# _TARGET_DB: "php-$_TARGET_PHP-apache"
# Run daily, or manually.
# 'PHP 8.1 MariaDB 10.3.22':
# <<: [ *default-stage, *run-daily ]
# variables:
# _TARGET_PHP: "8.1"
# _TARGET_DB: "mariadb-10.3.22"
# 'PHP 8.1 MySQL 5.7 with updated deps':
# <<: [ *default-stage, *run-daily ]
# variables:
# _TARGET_PHP: "8.1"
# _TARGET_DB: "mysql-5.7"
'PHP 8.1 PostgreSQL 14.1':
<<: [ *default-stage, *run-daily ]
variables:
_TARGET_PHP: "8.1"
_TARGET_DB: "pgsql-14.1"
# 'PHP 8.1 SQLite 3.27.0':
# <<: [ *default-stage, *run-daily ]
# variables:
# _TARGET_PHP: "8.1"
# _TARGET_DB: "php-$_TARGET_PHP-apache"