forked from craftcms/commerce
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
98 lines (97 loc) · 3.76 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
language: php
dist: xenial
group: edge
os: linux
env:
global:
- DEFAULT_COMPOSER_FLAGS="--no-interaction --no-ansi --no-progress --no-suggest" PHP_8=false
branches:
only:
- develop
- 3.4
services:
- mysql
- postgresql
jobs:
fast_finish: true
include:
- php: 8.0
env: DB=mysql PHP_8=true
- php: 8.0
env: DB=pgsql PHP_8=true
- php: 7.4
env: DB=mysql TASK_TESTS_COVERAGE=1 XDEBUG_MODE=coverage
- php: 7.4
env: DB=pgsql
- php: 7.3
env: DB=mysql
- php: 7.3
env: DB=pgsql
- php: 7.2.5
env: DB=mysql
- php: 7.2.5
env: DB=pgsql
cache:
directories:
- "$HOME/.composer/cache"
- "$HOME/.npm"
addons:
postgresql: "9.6"
install:
- |
if [[ $TASK_TESTS_COVERAGE != 1 ]]; then
# disable xdebug for performance reasons when code coverage is not needed.
phpenv config-rm xdebug.ini || echo "xdebug is not installed"
fi
# install composer dependencies
export PATH="$HOME/.composer/vendor/bin:$PATH"
composer validate
travis_retry composer install $DEFAULT_COMPOSER_FLAGS
before_script:
- |
# show some version and environment information
php --version
composer --version
php -r "echo INTL_ICU_VERSION . \"\n\";"
php -r "echo INTL_ICU_DATA_VERSION . \"\n\";"
psql --version
mysql --version
date +%Z
sudo mysql_upgrade || echo "MySQL is already up to date"
- travis_retry mysql -e 'CREATE DATABASE `commercetest`;';
- mysql -e "SET GLOBAL sql_mode = 'ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION';";
- mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -uroot mysql
- psql -U postgres -c 'CREATE DATABASE "commercetest";';
- cp tests/.env.example.$DB tests/.env
- |
if [[ $PHP_8 == "false" ]]; then
pear config-set preferred_state beta
pecl channel-update pecl.php.net
yes | pecl install imagick
fi
- |
if [[ $DB == "mysql" ]]; then
sed -i 's/DB_USER="craft"/DB_USER="root"/' tests/.env
else
sed -i 's/DB_USER="craft"/DB_USER="postgres"/' tests/.env
fi
script:
- |
if [[ $TASK_TESTS_COVERAGE != 1 ]]; then
vendor/bin/codecept run unit,functional
else
mkdir -p build/logs
vendor/bin/codecept run unit,functional --coverage-xml coverage.xml;
fi
after_script:
- |
if [ $TASK_TESTS_COVERAGE == 1 ]; then
bash <(curl -s https://codecov.io/bash)
fi
notifications:
webhooks:
urls:
- secure: "NSPPPO9zXMYAFjmFBT+3PXvp1RDT1fq0RgxEfAvHzaUMzj5RTwqQ3GlLucCGol/S314Rdof7eCJyrkpok5C6V5ebyW5aU/hPRc/thmFCcs/UJSHEVcbPzrAA6CaJ4GxLCm2Siwhlt5PA13jC+WJBe8+9WxDE3v+8n0G6g+X4feUv6dePj3lDf12lvzpLaHNC0BW+I7+9aipDp+EDM7ecKaT7eIUoQsYHyaerP4hVtQoC1r48qM3cvknGD/38tj68EXzPoAJwfzOV4o6V3fNKwm7JPe+qzxhYhCYf44thjXlDOLiIBorUtrX5eX746JLbt/6luyH2wnrGbBed5WZj5tOFWq503eMrqHFOPE2zdlxLjfcR2hKvw3ZdwrX+C3YsFaJjxEVROH5eO3NxF46olUW6say84EOvsSnZbA//vehzYeC786g70Ziavs32v7kGdwMDa3G3bmP7nSC3vpX0AhZaNmfxJ4mlNzFIH8feECYU3uJPcYTmFgN0Qk8FSNmfOTBvOZqUKEB2EkOpwK7YHfGzqaNCyhUfjg72IlWlmM6gWqzUbrSLtklH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