This repository has been archived by the owner on Nov 21, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
/
.travis.yml
107 lines (89 loc) · 3.35 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
language: php
sudo: false
php:
- 5.5
- 5.6
- 7
env:
global:
- DRUPAL_GRAPHQL=8.x-3.x
- DRUPAL_BUILD_DIR=$TRAVIS_BUILD_DIR/../drupal
- SIMPLETEST_DB=mysql://root:@127.0.0.1/graphql
- TRAVIS=true
matrix:
- DRUPAL_CORE=8.2.x
- DRUPAL_CORE=8.3.x
- DRUPAL_CORE=8.4.x
matrix:
# Don't wait for the allowed failures to build.
fast_finish: true
include:
- php: 7
env:
- DRUPAL_CORE=8.4.x
# Only run code coverage on the latest php and drupal versions.
- WITH_PHPDBG_COVERAGE=true
allow_failures:
# Allow the code coverage report to fail.
- php: 7
env:
- DRUPAL_CORE=8.4.x
# Only run code coverage on the latest php and drupal versions.
- WITH_PHPDBG_COVERAGE=true
mysql:
database: graphql
username: root
encoding: utf8
# Cache composer downloads.
cache:
directories:
- $HOME/.composer
before_install:
# Disable xdebug.
- phpenv config-rm xdebug.ini
# Determine the php settings file location.
- if [[ $TRAVIS_PHP_VERSION = hhvm* ]];
then export PHPINI=/etc/hhvm/php.ini;
else export PHPINI=$HOME/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini;
fi
# PHP Deprecated: Automatically populating $HTTP_RAW_POST_DATA is deprecated
# and will be removed in a future version. To avoid this warning set
# 'always_populate_raw_post_data' to '-1' in php.ini and use the php://input
# stream instead.
- if [[ "$TRAVIS_PHP_VERSION" == "5.6" ]];
then echo always_populate_raw_post_data = -1 >> $PHPINI;
fi;
# Disable the default memory limit.
- echo memory_limit = -1 >> $PHPINI
# Update composer.
- composer self-update
install:
# Create the database.
- mysql -e 'create database graphql'
# Download Drupal 8 core from the Github mirror because it is faster.
- git clone --branch $DRUPAL_CORE --depth 1 https://github.com/drupal/drupal.git $DRUPAL_BUILD_DIR
- git clone --branch $DRUPAL_GRAPHQL --depth 1 https://github.com/drupal-graphql/graphql.git $DRUPAL_BUILD_DIR/modules/graphql
# Reference the module in the build site.
- ln -s $TRAVIS_BUILD_DIR $DRUPAL_BUILD_DIR/modules/graphql_views
# When running with phpdbg we need to replace all code occurrences that check
# for 'cli' with 'phpdbg'. Some files might be write protected, hence the
# fallback.
- if [[ "$WITH_PHPDBG_COVERAGE" == "true" ]];
then grep -rl 'cli' $DRUPAL_BUILD_DIR/core $DRUPAL_BUILD_DIR/modules | xargs sed -i "s/'cli'/'phpdbg'/g" || true;
fi
# Bring in the module dependencies without requiring a merge plugin. The
# require also triggers a full 'composer install'.
- composer --working-dir=$DRUPAL_BUILD_DIR require webonyx/graphql-php:^0.11.5
script:
# Run the unit tests using phpdbg if the environment variable is 'true'.
- if [[ "$WITH_PHPDBG_COVERAGE" == "true" ]];
then phpdbg -qrr $DRUPAL_BUILD_DIR/vendor/bin/phpunit --configuration $DRUPAL_BUILD_DIR/core/phpunit.xml.dist --coverage-clover $TRAVIS_BUILD_DIR/coverage.xml $TRAVIS_BUILD_DIR;
fi
# Run the unit tests with standard php otherwise.
- if [[ "$WITH_PHPDBG_COVERAGE" != "true" ]];
then $DRUPAL_BUILD_DIR/vendor/bin/phpunit --configuration $DRUPAL_BUILD_DIR/core/phpunit.xml.dist $TRAVIS_BUILD_DIR;
fi
after_success:
- if [[ "$WITH_PHPDBG_COVERAGE" == "true" ]];
then bash <(curl -s https://codecov.io/bash);
fi