-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.travis.yml
114 lines (102 loc) · 3.97 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
101
102
103
104
105
106
107
108
109
110
language: php
sudo: required
dist: bionic
cache:
directories:
- vendor
- $HOME/.composer/cache
before_install:
- mv ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini{,.disabled} || echo "xdebug not available"
before_script:
- if [[ "$SET_INNODB_CONF" == "yes" ]]; then echo -e "[server]\ninnodb_file_per_table=1\ninnodb_file_format=barracuda\ninnodb_large_prefix=1" | sudo tee -a /etc/mysql/my.cnf; sudo service mysql restart; fi;
# Create two test databases
- mysql -e "DROP DATABASE IF EXISTS openstore_test_utf8_compat;" -u root
- mysql -e "CREATE DATABASE openstore_test_utf8_compat;" -u root
- mysql -e "DROP DATABASE IF EXISTS openstore_test_utf8mb4;" -u root
- mysql -e "CREATE DATABASE openstore_test_utf8mb4;" -u root
- cp ./.travis/openstore-schema-core.config.travis.php ./config/openstore-schema-core.config.php
install:
- travis_retry composer -n install
script:
# Test 1.
# Build generated SQL and check they work by pushing them to the db
- composer build
# - Create a database from generated SQL (utf8)
- cat resources/sql/mysql-utf8-compat/create_schema_utf8_compat.sql | mysql -u root openstore_test_utf8_compat
- cat resources/sql/mysql-utf8-compat/create_schema_extra_utf8_compat.sql | mysql -u root openstore_test_utf8_compat
- cat resources/sql/mysql-utf8-compat/create_schema_extra_utf8_compat.sql
# - Create a database from generated SQL (utf8mb4)
- cat resources/sql/create_schema_utf8mb4.sql | mysql -u root openstore_test_utf8mb4
- cat resources/sql/create_schema_extra_utf8mb4.sql | mysql -u root openstore_test_utf8mb4
- cat resources/sql/create_schema_extra_utf8mb4.sql
# Running a diff should not generate migrations (--dump-sql for debug it always return 0 exit code)
- php vendor/bin/doctrine orm:schema-tool:update --dump-sql
- php vendor/bin/doctrine orm:schema-tool:update
# Test 2.
# Recreate test database from doctrine
- mysql -e "DROP DATABASE IF EXISTS openstore_test_utf8mb4;" -u root
- mysql -e "CREATE DATABASE openstore_test_utf8mb4;" -u root
- php vendor/bin/doctrine orm:schema-tool:create
# Running a diff should not generate migrations (--dump-sql for debug it always return 0 exit code)
- php vendor/bin/doctrine orm:schema-tool:update --dump-sql
- php vendor/bin/doctrine orm:schema-tool:update
# Test 3.
# Adding a new entity should generate a new diff
- cp tests/entity/Question.php src/OpenstoreSchema/Core/Entity/Question.php
- php vendor/bin/doctrine orm:schema-tool:update --dump-sql
# Updating schema
- php vendor/bin/doctrine orm:schema-tool:update --force
# This one should not give new migrations (--dump-sql for debug it always return 0 exit code)
- php vendor/bin/doctrine orm:schema-tool:update --dump-sql
- php vendor/bin/doctrine orm:schema-tool:update
jobs:
include:
# PHPStan - CS
- stage: PHPStan
php: 7.3
env: MARIADB_VERSION=10.3 SET_INNODB_CONF=no
addons:
mariadb: 10.3
script:
- composer phpstan
- ./vendor/bin/php-cs-fixer --diff --dry-run -v fix
# PHP 7.2
- stage: Test
php: 7.2
env: MYSQL_VERSION=5.7 SET_INNODB_CONF=yes
sudo: required
- stage: Test
php: 7.2
env: MARIADB_VERSION=10.1 SET_INNODB_CONF=yes
addons:
mariadb: 10.1
- stage: Test
php: 7.2
env: MARIADB_VERSION=10.2 SET_INNODB_CONF=yes
addons:
mariadb: 10.2
# PHP 7.3
- stage: Test
php: 7.3
env: MYSQL_VERSION=5.7 SET_INNODB_CONF=yes
sudo: required
- stage: Test
php: 7.3
env: MARIADB_VERSION=10.1 SET_INNODB_CONF=yes
addons:
mariadb: 10.1
- stage: Test
php: 7.3
env: MARIADB_VERSION=10.2 SET_INNODB_CONF=yes
addons:
mariadb: 10.2
- stage: Test
php: 7.3
env: MARIADB_VERSION=10.3 SET_INNODB_CONF=no
addons:
mariadb: 10.3
- stage: Test
php: 7.3
env: MARIADB_VERSION=10.4 SET_INNODB_CONF=no
addons:
mariadb: 10.4