forked from craftcms/cms
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
100 lines (99 loc) · 3.81 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
language: php
dist: bionic
group: edge
os: linux
env:
global:
- DEFAULT_COMPOSER_FLAGS="--no-interaction --no-ansi --no-progress --no-suggest"
branches:
only:
- develop
services:
- mysql
- postgresql
jobs:
fast_finish: true
include:
- php: 8.1.0
env: DB=mysql
- php: 8.1.0
env: DB=pgsql
- php: 8.0
env: DB=mysql
- php: 8.0
env: DB=pgsql
- 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.19
env: DB=mysql
- php: 7.2.19
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
sudo mysql_upgrade || echo "MySQL is already up to date"
- travis_retry mysql -e 'CREATE DATABASE `craft_test`;';
- 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 "craft_test";';
- cp tests/.env.example.$DB tests/.env
- |
yes | pecl install imagick
- |
if [[ $DB == "pgsql" ]]; then
sed -i 's/DB_USER=root/DB_USER=postgres/' tests/.env
fi
script:
- nvm install 14
- npm install -g npm
- npm cache clean -f
- npm install -g snyk
#- snyk monitor --all-projects # Enable reachable vulns, scan and publish results to Snyk
#- snyk test --all-projects # Enable reachable vulns
- |
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: "jbU/UC+dlzgqhujZlLwuFQpYgYu4mHZUdgaOytI3Q/joCTCDraXs4KzA3K3zLZNCVOruDr+JYGVORsjDJBxkKayBwkpJTl7Klpbhqv+nDvTfFBYlZX0W/RqyW55+BYYfxA7xkKRYqQxbIYN6ycgcXGgV9bQPHcXfD2U1slshmCJZDjBf55C8Oh6cYOjnQ1MwN3rXTjR5WkGgn6tZlCoSteAabO60OgFtljObbGj13ChT6Vj1/sOYQNh0GJWJWCcUcWUCgZI7HnxtZbj3a1Et+rsiPrI2MVzcaUvzy02vJBTGJcrDDcAo6Nt6JrAaLJ/Jz7atrkTYK9hNgRVnF0i7O5KVMNWxHW0CMHlMK02w0nfXhnlpFPi/0nU6Ko7qacaVxk0SkFUt74aByMz2rI5CQnlDlGMfZ24J0aqGCtKlBpCIaAR9RUCd2N4K/UTRWRZi6GnxGl41aKAbNMd+AX7HH+TbHTovNI4GQyNyb+lWPZzvD/1tfJwYCFOQm/hi27LrifJ3DrVUzBDxQwcqYdqCnjS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