-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.travis.yml
77 lines (74 loc) · 4.92 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
language: php
# Functional and Unit tests require Apache
env:
- DBVERSION=mssql2019 DB_COLLATION=LATIN1_GENERAL_100_CI_AS_SC_UTF8 DRUPAL_VERSION=9.1.x TEST_SUITE=core-kernel
- DBVERSION=mssql2019 DB_COLLATION=LATIN1_GENERAL_100_CI_AS_SC_UTF8 DRUPAL_VERSION=9.1.x TEST_SUITE=core-extensions-kernel TEST_INDEX=0
- DBVERSION=mssql2019 DB_COLLATION=LATIN1_GENERAL_100_CI_AS_SC_UTF8 DRUPAL_VERSION=9.1.x TEST_SUITE=core-extensions-kernel TEST_INDEX=1
- DBVERSION=mssql2019 DB_COLLATION=LATIN1_GENERAL_100_CI_AS_SC_UTF8 DRUPAL_VERSION=9.1.x TEST_SUITE=core-extensions-kernel TEST_INDEX=2
- DBVERSION=mssql2019 DB_COLLATION=LATIN1_GENERAL_100_CI_AS_SC_UTF8 DRUPAL_VERSION=9.1.x TEST_SUITE=passing_functional,unit APACHE=yes
- DBVERSION=mssql2019 DB_COLLATION=LATIN1_GENERAL_100_CI_AS_SC_UTF8 DRUPAL_VERSION=9.1.x TEST_SUITE=passing_functional2 APACHE=yes
- DBVERSION=mssql2019 DB_COLLATION=LATIN1_GENERAL_100_CI_AS_SC_UTF8 DRUPAL_VERSION=9.1.x TEST_SUITE=failing CODE_SNIFF=yes APACHE=yes
- DBVERSION=mssql2019 DB_COLLATION=LATIN1_GENERAL_100_CI_AS_SC_UTF8 DRUPAL_VERSION=9.1.x TEST_SUITE=core-extensions-functional APACHE=yes foo=1
- DBVERSION=mssql2019 DB_COLLATION=LATIN1_GENERAL_100_CI_AS_SC_UTF8 DRUPAL_VERSION=9.1.x TEST_SUITE=core-extensions-functional APACHE=yes foo=2
- DBVERSION=mssql2019 DB_COLLATION=LATIN1_GENERAL_100_CI_AS_SC_UTF8 DRUPAL_VERSION=9.1.x TEST_SUITE=core-extensions-functional APACHE=yes foo=3
- DBVERSION=mssql2019 DB_COLLATION=LATIN1_GENERAL_100_CI_AS_SC_UTF8 DRUPAL_VERSION=9.1.x TEST_SUITE=core-extensions-functional APACHE=yes foo=4
- DBVERSION=mssql2019 DB_COLLATION=LATIN1_GENERAL_100_CI_AS_SC_UTF8 DRUPAL_VERSION=9.1.x TEST_SUITE=core-extensions-functional APACHE=yes foo=5
matrix:
allow_failures:
- env: DBVERSION=mssql2019 DB_COLLATION=LATIN1_GENERAL_100_CI_AS_SC_UTF8 DRUPAL_VERSION=9.1.x TEST_SUITE=failing CODE_SNIFF=yes APACHE=yes
- env: DBVERSION=mssql2019 DB_COLLATION=LATIN1_GENERAL_100_CI_AS_SC_UTF8 DRUPAL_VERSION=9.1.x TEST_SUITE=core-extensions-functional APACHE=yes foo=1
- env: DBVERSION=mssql2019 DB_COLLATION=LATIN1_GENERAL_100_CI_AS_SC_UTF8 DRUPAL_VERSION=9.1.x TEST_SUITE=core-extensions-functional APACHE=yes foo=2
- env: DBVERSION=mssql2019 DB_COLLATION=LATIN1_GENERAL_100_CI_AS_SC_UTF8 DRUPAL_VERSION=9.1.x TEST_SUITE=core-extensions-functional APACHE=yes foo=3
- env: DBVERSION=mssql2019 DB_COLLATION=LATIN1_GENERAL_100_CI_AS_SC_UTF8 DRUPAL_VERSION=9.1.x TEST_SUITE=core-extensions-functional APACHE=yes foo=4
- env: DBVERSION=mssql2019 DB_COLLATION=LATIN1_GENERAL_100_CI_AS_SC_UTF8 DRUPAL_VERSION=9.1.x TEST_SUITE=core-extensions-functional APACHE=yes foo=5
php:
- '7.4'
before_install:
# remove Xdebug to speed up test runner
- phpenv config-rm xdebug.ini
- pecl channel-update pecl.php.net
# Install the database
- bash dev/travis/${DBVERSION}.sh
# Install custom php.ini
- phpenv config-add dev/travis/travis-7.x.ini
install:
# Create a Drupal Site
- cd ..
- export COMPOSER_MEMORY_LIMIT=-1
- git clone https://git.drupalcode.org/project/drupal.git -b $DRUPAL_VERSION drupal-project
- cd drupal-project
- composer config -g github-oauth.github.com $GITHUB_OAUTH
- composer install
- bash ../sqlsrv/dev/travis/drupal${DRUPAL_VERSION}.sh
before_script:
- |
if ! [ -z "$APACHE" ]; then
sudo apt-get update
sudo apt-get install apache2 libapache2-mod-fastcgi
# enable php-fpm
sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf
sudo a2enmod rewrite actions fastcgi alias
echo "cgi.fix_pathinfo = 1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
sudo sed -i -e "s,www-data,travis,g" /etc/apache2/envvars
sudo chown -R travis:travis /var/lib/apache2/fastcgi
~/.phpenv/versions/$(phpenv version-name)/sbin/php-fpm
# configure apache virtual hosts
sudo cp -f $TRAVIS_BUILD_DIR/dev/travis/travis-ci-apache /etc/apache2/sites-available/000-default.conf
cd $TRAVIS_BUILD_DIR/../drupal-project
sudo sed -e "s?%TRAVIS_WEB_DIR%?$(pwd)?g" --in-place /etc/apache2/sites-available/000-default.conf
sudo service apache2 restart
fi
script:
- cp $TRAVIS_BUILD_DIR/dev/phpunit.xml.dist $TRAVIS_BUILD_DIR/../drupal-project/core/phpunit.xml
- cd $TRAVIS_BUILD_DIR/../drupal-project
- vendor/bin/phpunit -v -c core/phpunit.xml --testsuite=$TEST_SUITE
- |
if ! [ -z "$CODE_SNIFF" ]; then
vendor/bin/phpcs --config-set installed_paths $TRAVIS_BUILD_DIR/../drupal-project/vendor/drupal/coder/coder_sniffer
vendor/bin/phpcs --standard=Drupal --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml modules/sqlsrv
fi
- |
if ! [ -z "$CODE_SNIFF" ]; then
composer require phpstan/phpstan phpstan/phpstan-phpunit jangregor/phpstan-prophecy mglaman/phpstan-drupal
vendor/bin/phpstan analyze modules/sqlsrv --level 4 -c $TRAVIS_BUILD_DIR/dev/phpstan.neon
fi