This repository has been archived by the owner on Feb 20, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy path.travis.yml
70 lines (58 loc) · 2.75 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
language: php
dist: xenial
services:
- mysql
php:
- 5.6
- 7.4
env:
matrix:
- CAKE_VERSION=^3.6.0 REINSTALL_CAKEPHP=0
global:
- DEFAULT=1
- DB=mysql
- db_dsn='mysql://travis:[email protected]/cakephp_test'
cache:
directories:
- $HOME/.composer/files
matrix:
fast_finish: true
include:
- php: 5.6
env: CAKE_VERSION='~3.6.0' REINSTALL_CAKEPHP=1
- php: 7.4
env: PHPCS=1 DEFAULT=0
before_install:
- phpenv config-rm xdebug.ini
- composer self-update
- git fetch --unshallow
- git branch ci-build
install:
- composer install --prefer-dist --no-interaction
- if [ $DEFAULT = '1' ]; then composer create-project --no-interaction cakephp/app:$CAKE_VERSION tests/test_app; fi
- if [ $DEFAULT = '1' ]; then cd tests/test_app; fi
- if [ $REINSTALL_CAKEPHP -eq 1 ]; then rm composer.lock && rm -rf vendor/ && composer require cakephp/cakephp:$CAKE_VERSION; fi
- if [ $DEFAULT = '1' ]; then composer config repositories.cakephp/codeception vcs ../../; fi
- if [ $DEFAULT = '1' ]; then composer require --prefer-source --dev cakephp/codeception:dev-ci-build#$TRAVIS_COMMIT; fi
- if [ $DEFAULT = '1' ]; then composer run-script --no-interaction post-install-cmd; fi
- if [ $DEFAULT = '1' ]; then cd ../sample_app; fi
- if [ $DEFAULT = '1' ]; then cp -rv ../test_app/src ./ && cp -r ../test_app/config ./ && cp -r ../test_app/webroot ./; fi
- if [ $CAKE_VERSION = '3.1.*' ]; then mv config/app-3.1.php config/app.php; fi
- if [ $DEFAULT = '1' ]; then cp ../test_app/src/Console/Installer.php src/Console/.; fi
- if [ $DEFAULT = '1' ]; then cp ../test_app/composer.json .; fi
- if [ $DEFAULT = '1' ]; then composer install --no-interaction; fi
before_script:
- if [ $DB = 'mysql' ]; then mysql -u root -e 'CREATE DATABASE cakephp_test;'; fi
- if [ $DB = 'mysql' ]; then echo "ALTER USER 'travis'@'localhost' IDENTIFIED BY 'travis';\nFLUSH PRIVILEGES;\n" | mysql -u root; fi
- if [ $PHPCS = '1' ]; then composer require --dev squizlabs/php_codesniffer; fi
- if [ $DEFAULT = '1' ]; then cd $TRAVIS_BUILD_DIR/tests/test_app; fi
- if [ $DEFAULT = '1' ]; then vendor/bin/codecept bootstrap; fi
- if [ $DEFAULT = '1' ]; then vendor/bin/codecept generate:cest Functional Foo; fi
- if [ $DEFAULT = '1' ]; then vendor/bin/codecept generate:cept Functional Foo; fi
- if [ $DEFAULT = '1' ]; then vendor/bin/codecept generate:suite Api; fi
script:
- if [ $PHPCS = '1' ]; then cd $TRAVIS_BUILD_DIR && vendor/bin/phpcs --standard=PSR2 --extensions=php --ignore=tests/*_app src/ tests/; fi
- if [ $DEFAULT = '1' ]; then cd $TRAVIS_BUILD_DIR && vendor/bin/phpunit; fi
- if [ $DEFAULT = '1' ]; then cd $TRAVIS_BUILD_DIR/tests/sample_app && vendor/bin/codecept build && vendor/bin/codecept run; fi
notifications:
email: false