-
Notifications
You must be signed in to change notification settings - Fork 13
/
.travis.yml
73 lines (59 loc) · 2.24 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
language: php
dist: jammy
services:
- mysql
php:
- 8.1
- 8.2
env:
global:
# Export database variable for kernel tests.
- SIMPLETEST_DB=mysql://root:@127.0.0.1/logs_http
# Export web server URL for browser tests.
- SIMPLETEST_BASE_URL=http://localhost:8888
matrix:
- DRUPAL_CORE=10.2.x
- DRUPAL_CORE=10.1.x
jobs:
include:
- stage: lint
script:
- composer global config --no-plugins allow-plugins.dealerdirect/phpcodesniffer-composer-installer true
- export PATH="$PATH:$HOME/.config/composer/vendor/bin"
- composer global require drupal/coder:8.3.13
- composer global require dealerdirect/phpcodesniffer-composer-installer
- phpcs --config-show installed_paths
- phpcs --config-set installed_paths $HOME/.config/composer/vendor/drupal/coder/coder_sniffer
- phpcs --standard="Drupal,DrupalPractice" -p --colors --extensions=php,module,inc,install,test,profile,theme,css .
php: 8.1
env: DRUPAL_CORE=10.2.x
stages:
- lint
- test
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
# The default stage is "test", so we specify the "test" stage below.
script:
# Remember the current directory for later use in the Drupal installation.
- TESTDIR=$(pwd)
# Navigate out of module directory to prevent blown stack by recursive module
# lookup.
- cd ..
# Create database.
- mysql -e 'create database logs_http'
# Download Drupal 8 core.
- travis_retry git clone --branch $DRUPAL_CORE --depth 1 https://git.drupal.org/project/drupal.git
- cd drupal
# Install Composer dependencies.
- composer self-update && composer install
# Reference OG in the Drupal site.
- ln -s $TESTDIR modules/logs_http
# Start a web server on port 8888 in the background.
- nohup php -S localhost:8888 > /dev/null 2>&1 &
# Wait until the web server is responding.
- until curl -s localhost:8888; do true; done > /dev/null
# Run the PHPUnit tests which also include the kernel tests.
- ./vendor/phpunit/phpunit/phpunit -c ./core/phpunit.xml.dist ./modules/logs_http