Skip to content
Snippets Groups Projects
Commit ec6bfde9 authored by Steven Ayers's avatar Steven Ayers Committed by Jonathan Hedstrom
Browse files

Issue #3397814 by bluegeek9: Gitlab CI

parent 4829aba9
No related branches found
No related tags found
1 merge request!20Issue #3397814: Gitlab CI
Pipeline #44134 canceled
################
# DrupalCI GitLabCI template
#
# Gitlab-ci.yml to replicate DrupalCI testing for Contrib
#
# With thanks to:
# * The GitLab Acceleration Initiative participants
# * DrupalSpoons
################
################
# Guidelines
#
# 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.
#
# However, you can modify this template if you have additional needs for your project.
################
################
# 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:
################
# DrupalCI includes:
# As long as you include this, any future includes added by the Drupal Association will be accessible to your pipelines automatically.
# View these include files at https://git.drupalcode.org/project/gitlab_templates/
################
- project: $_GITLAB_TEMPLATES_REPO
ref: $_GITLAB_TEMPLATES_REF
file:
- '/includes/include.drupalci.main.yml'
# EXPERIMENTAL: For Drupal 7, remove the above line and uncomment the below.
# - '/includes/include.drupalci.main-d7.yml'
- '/includes/include.drupalci.variables.yml'
- '/includes/include.drupalci.workflows.yml'
################
# Pipeline configuration variables
#
# These are the variables provided to the Run Pipeline form that a user may want to override.
#
# Docs at https://git.drupalcode.org/project/gitlab_templates/-/blob/1.0.x/includes/include.drupalci.variables.yml
################
# variables:
# SKIP_ESLINT: '1'
###################################################################################
#
# *
# /(
# ((((,
# /(((((((
# ((((((((((*
# ,(((((((((((((((
# ,(((((((((((((((((((
# ((((((((((((((((((((((((*
# *(((((((((((((((((((((((((((((
# ((((((((((((((((((((((((((((((((((*
# *(((((((((((((((((( .((((((((((((((((((
# ((((((((((((((((((. /(((((((((((((((((*
# /((((((((((((((((( .(((((((((((((((((,
# ,(((((((((((((((((( ((((((((((((((((((
# .(((((((((((((((((((( .(((((((((((((((((
# ((((((((((((((((((((((( ((((((((((((((((/
# (((((((((((((((((((((((((((/ ,(((((((((((((((*
# .((((((((((((((/ /(((((((((((((. ,(((((((((((((((
# *(((((((((((((( ,(((((((((((((/ *((((((((((((((.
# ((((((((((((((, /(((((((((((((. ((((((((((((((,
# (((((((((((((/ ,(((((((((((((* ,(((((((((((((,
# *((((((((((((( .((((((((((((((( ,(((((((((((((
# ((((((((((((/ /((((((((((((((((((. ,((((((((((((/
# ((((((((((((( *(((((((((((((((((((((((* *((((((((((((
# ((((((((((((( ,(((((((((((((..((((((((((((( *((((((((((((
# ((((((((((((, /((((((((((((* /((((((((((((/ ((((((((((((
# ((((((((((((( /((((((((((((/ (((((((((((((* ((((((((((((
# (((((((((((((/ /(((((((((((( ,((((((((((((, *((((((((((((
# (((((((((((((( *(((((((((((/ *((((((((((((. ((((((((((((/
# *((((((((((((((((((((((((((, /(((((((((((((((((((((((((
# ((((((((((((((((((((((((( ((((((((((((((((((((((((,
# .(((((((((((((((((((((((/ ,(((((((((((((((((((((((
# ((((((((((((((((((((((/ ,(((((((((((((((((((((/
# *((((((((((((((((((((( (((((((((((((((((((((,
# ,(((((((((((((((((((((, ((((((((((((((((((((/
# ,(((((((((((((((((((((* /((((((((((((((((((((
# ((((((((((((((((((((((, ,/((((((((((((((((((((,
# ,(((((((((((((((((((((((((((((((((((((((((((((((((((
# .(((((((((((((((((((((((((((((((((((((((((((((
# .((((((((((((((((((((((((((((((((((((,.
# .,(((((((((((((((((((((((((.
#
###################################################################################
language: php
sudo: false
php:
- 5.6
- 7.0
- 7.1
- 7.2
env:
- TEST_SUITE=8.7.x
- TEST_SUITE=PHP_CodeSniffer
# Only run the coding standards check once.
matrix:
exclude:
- php: 5.6
env: TEST_SUITE=PHP_CodeSniffer
- php: 7.0
env: TEST_SUITE=PHP_CodeSniffer
mysql:
database: drupal
username: root
encoding: utf8
before_script:
# Remove Xdebug as we don't need it and it causes "PHP Fatal error: Maximum
# function nesting level of '256' reached."
# We also don't care if that file exists or not on PHP 7.
- phpenv config-rm xdebug.ini || true
# Make sure Composer is up to date.
- composer self-update
# Remember the current directory for later use in the Drupal installation.
- MODULE_DIR=$(pwd)
# Install Composer dependencies.
- composer install
# Navigate out of module directory to prevent blown stack by recursive module
# lookup.
- cd ..
# Create database.
- mysql -e 'create database drupal'
# Download Drupal 8 core. Skip this for the coding standards test.
- test ${TEST_SUITE} == "PHP_CodeSniffer" || travis_retry git clone --branch $TEST_SUITE --depth 1 https://git.drupal.org/project/drupal.git
# Remember the Drupal installation path.
- DRUPAL_DIR=$(pwd)/drupal
# Install Composer dependencies for core. Skip this for the coding standards test.
- test ${TEST_SUITE} == "PHP_CodeSniffer" || composer install --working-dir=$DRUPAL_DIR
- test ${TEST_SUITE} == "PHP_CodeSniffer" || composer update phpunit/phpunit --with-dependencies --working-dir=$DRUPAL_DIR
# Start a web server on port 8888 in the background.
- test ${TEST_SUITE} == "PHP_CodeSniffer" || nohup php -S localhost:8888 --docroot $DRUPAL_DIR > /dev/null 2>&1 &
# Wait until the web server is responding.
- test ${TEST_SUITE} == "PHP_CodeSniffer" || until curl -s localhost:8888; do true; done > /dev/null
# Export web server URL for browser tests.
- export SIMPLETEST_BASE_URL=http://localhost:8888
# Export database variable for kernel tests.
- export SIMPLETEST_DB=mysql://root:@127.0.0.1/drupal
script: DRUPAL_DIR=$DRUPAL_DIR MODULE_DIR=$MODULE_DIR $MODULE_DIR/scripts/travis-ci/run-test.sh $TEST_SUITE
# This is the drupalci.yml file for the Examples project.
# Learn how to make your own:
# https://www.drupal.org/drupalorg/docs/drupal-ci/customizing-drupalci-testing-for-projects
# This drupalci.yml build file should almost exactly mirror the default contrib
# build used by the testbot. We are only adding the
# 'suppress-deprecations: false' config to the run_tests tasks. This is so we
# can catch Drupal core deprecations early.
build:
assessment:
validate_codebase:
phplint:
csslint:
eslint:
phpcs:
testing:
run_tests.standard:
types: 'Simpletest,PHPUnit-Unit,PHPUnit-Kernel,PHPUnit-Functional'
suppress-deprecations: true
run_tests.js:
concurrency: 1
types: 'PHPUnit-FunctionalJavascript'
suppress-deprecations: true
<?xml version="1.0"?>
<!-- PHP_CodeSniffer standard for Drupal modules. -->
<!-- See http://pear.php.net/manual/en/package.php.php-codesniffer.annotated-ruleset.php -->
<ruleset name="Drupal Module">
<description>Drupal coding standard for contributed modules</description>
<!-- Exclude unsupported file types. -->
<exclude-pattern>*.gif</exclude-pattern>
<exclude-pattern>*.less</exclude-pattern>
<exclude-pattern>*.png</exclude-pattern>
<!-- Minified files don't have to comply with coding standards. -->
<exclude-pattern>*.min.css</exclude-pattern>
<exclude-pattern>*.min.js</exclude-pattern>
<rule ref="./vendor/drupal/coder/coder_sniffer/Drupal" />
</ruleset>
<?xml version="1.0" encoding="UTF-8"?>
<ruleset name="pbm_default">
<description>Default PHP CodeSniffer configuration for Messages.</description>
<rule ref="phpcs-ruleset.xml.dist"/>
<arg name="extensions" value="php,inc,module,install,info,test,profile,theme,css,js"/>
<arg name="report" value="full"/>
<arg name="severity" value="error"/>
<arg value="p"/>
<file>.</file>
<exclude-pattern>./vendor</exclude-pattern>
</ruleset>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment