/
config.yml
113 lines (111 loc) · 3.28 KB
/
config.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
108
109
110
111
112
113
workflows:
version: 2
matrix-build:
jobs:
- php56-phpunit3
- php56-phpunit5
- php71-phpunit3
- php71-phpunit5
- php72-phpunit3
- php72-phpunit4
- php72-phpunit5
defaults: &defaults
environment:
- PHP_VERSION: '7.1'
- PHPUNIT_VERSION: '5.*'
docker:
- image: circleci/php:$PHP_VERSION
auth:
username: $DOCKER_USER
password: $DOCKER_PASS
environment:
DEV_MYSQL_HOST: 127.0.0.1
DEV_MYSQL_PORT: 3306
DEV_MYSQL_USER: base
DEV_MYSQL_PASS: base
- image: circleci/mysql:5.6
command: mysqld --character-set-server=utf8 --sql_mode=NO_ENGINE_SUBSTITUTION --innodb_lock_wait_timeout=3
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: test_base
MYSQL_USER: base
MYSQL_PASSWORD: base
steps:
- run: sudo apt-get update && sudo apt-get install -y zlib1g-dev libicu-dev g++ mariadb-client
- run: sudo docker-php-ext-install intl pdo_mysql
- checkout
- run:
name: save cache key as file
command: echo "$PHP_VERSION-$PHPUNIT_VERSION" > .cache_key
- restore_cache:
name: restore cache - composer
key: composer-{{ arch }}-{{ checksum ".cache_key" }}
- run:
name: install phpunit
command: composer require --dev phpunit/phpunit:"$PHPUNIT_VERSION"
- run:
name: composer install
command: |
composer install --dev --no-suggest
- save_cache:
name: save cache - composer
key: composer-{{ arch }}-{{ checksum ".cache_key" }}
paths:
- vendor
- run:
name: create test repotes dir
command: |
mkdir -p ~/reports/phpunit
- run:
name: setup test app
command: |
yes y | vendor/bin/cake bake project Test/test_app || true
echo "date_default_timezone_set('UTC');" >> 'Test/test_app/Config/core.php'
echo "CakePlugin::load('ExtendTestSuite', array('path' => dirname(ROOT) . DS));" >> 'Test/test_app/Config/bootstrap.php'
echo "require_once dirname(ROOT) . DS . 'vendor' . DS . 'autoload.php';" >> 'Test/test_app/Config/bootstrap.php'
cp .circleci/database.php Test/test_app/Config/database.php
- run:
name: run tests
command: |
./Test/test_app/Console/cake test ExtendTestSuite AllExtendTestSuite --stderr --log-junit ~/reports/phpunit/junit.xml
- store_artifacts:
path: ~/reports/
- store_test_results:
path: ~/reports/
version: 2
jobs:
php56-phpunit3:
<<: *defaults
environment:
- PHP_VERSION: '5.6'
- PHPUNIT_VERSION: '3.*'
php56-phpunit5:
<<: *defaults
environment:
- PHP_VERSION: '5.6'
- PHPUNIT_VERSION: '5.*'
php71-phpunit3:
<<: *defaults
environment:
- PHP_VERSION: '7.1'
- PHPUNIT_VERSION: '3.*'
php71-phpunit5:
<<: *defaults
environment:
- PHP_VERSION: '7.1'
- PHPUNIT_VERSION: '5.*'
php72-phpunit3:
<<: *defaults
environment:
- PHP_VERSION: '7.2'
- PHPUNIT_VERSION: '3.*'
php72-phpunit4:
<<: *defaults
environment:
- PHP_VERSION: '7.2'
- PHPUNIT_VERSION: '4.*'
php72-phpunit5:
<<: *defaults
environment:
- PHP_VERSION: '7.2'
- PHPUNIT_VERSION: '5.*'