travis builds with mysql (#924)
This commit is contained in:
75
.travis.yml
75
.travis.yml
@@ -1,29 +1,63 @@
|
|||||||
|
dist: xenial
|
||||||
language: php
|
language: php
|
||||||
sudo: false
|
|
||||||
|
|
||||||
cache:
|
cache:
|
||||||
directories:
|
directories:
|
||||||
- $HOME/.composer/cache/files
|
- $HOME/.composer/cache/files
|
||||||
|
|
||||||
addons:
|
|
||||||
mariadb: '10.2'
|
|
||||||
|
|
||||||
services:
|
services:
|
||||||
- mysql
|
- mysql
|
||||||
|
|
||||||
env:
|
|
||||||
global:
|
|
||||||
- CODECOVERAGE=0
|
|
||||||
|
|
||||||
matrix:
|
matrix:
|
||||||
fast_finish: true
|
|
||||||
include:
|
include:
|
||||||
- php: 7.2
|
- stage: Code quality
|
||||||
- php: 7.3
|
env: CODECOVERAGE=0 DB=sqlite
|
||||||
env: CODECOVERAGE=1
|
php: '7.2'
|
||||||
|
script:
|
||||||
|
- composer validate --no-check-all --strict
|
||||||
|
- composer kimai:codestyle
|
||||||
|
- composer kimai:phpstan
|
||||||
|
- stage: Test
|
||||||
|
php: '7.2'
|
||||||
|
env: CODECOVERAGE=0 DB=mysql
|
||||||
|
sudo: required
|
||||||
|
services:
|
||||||
|
- mysql
|
||||||
|
- stage: Test
|
||||||
|
php: '7.3'
|
||||||
|
env: CODECOVERAGE=0 DB=mysql
|
||||||
|
sudo: required
|
||||||
|
services:
|
||||||
|
- mysql
|
||||||
|
- stage: Test
|
||||||
|
php: '7.2'
|
||||||
|
env: CODECOVERAGE=0 DB=sqlite
|
||||||
|
- stage: Test
|
||||||
|
#php: '7.4snapshot'
|
||||||
|
php: '7.3'
|
||||||
|
env: CODECOVERAGE=0 DB=sqlite
|
||||||
|
- stage: Test
|
||||||
|
php: '7.2'
|
||||||
|
env: CODECOVERAGE=0 DB=mariadb
|
||||||
|
addons:
|
||||||
|
mariadb: '10.2'
|
||||||
|
before_script:
|
||||||
|
- mysql -u root -e 'CREATE USER IF NOT EXISTS travis@localhost; GRANT ALL ON *.* TO travis@localhost;'
|
||||||
|
- stage: Test
|
||||||
|
php: '7.3'
|
||||||
|
env: CODECOVERAGE=0 DB=mariadb
|
||||||
|
addons:
|
||||||
|
mariadb: '10.2'
|
||||||
|
before_script:
|
||||||
|
- mysql -u root -e 'CREATE USER IF NOT EXISTS travis@localhost; GRANT ALL ON *.* TO travis@localhost;'
|
||||||
|
- stage: Code coverage
|
||||||
|
php: '7.3'
|
||||||
|
env: CODECOVERAGE=1 DB=sqlite
|
||||||
|
after_success:
|
||||||
|
- if [[ $CODECOVERAGE == 1 ]]; then bash <(curl -s https://codecov.io/bash); fi
|
||||||
|
|
||||||
before_install:
|
before_install:
|
||||||
# - phpenv config-rm xdebug.ini
|
- if [[ $CODECOVERAGE == 0 ]]; then phpenv config-rm xdebug.ini; fi;
|
||||||
- composer self-update
|
- composer self-update
|
||||||
- php -i
|
- php -i
|
||||||
- php -m
|
- php -m
|
||||||
@@ -33,18 +67,11 @@ install:
|
|||||||
- composer require zendframework/zend-ldap
|
- composer require zendframework/zend-ldap
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- composer validate --no-check-all --strict
|
- if [[ $CODECOVERAGE == 1 ]]; then vendor/bin/phpunit tests/ --coverage-clover=coverage.xml; fi;
|
||||||
- composer kimai:codestyle
|
- if [[ $CODECOVERAGE == 0 ]]; then vendor/bin/phpunit tests/; fi;
|
||||||
- composer kimai:phpstan
|
- if [[ $DB == 'sqlite' ]]; then cp tests/.env.dist.sqlite .env; fi;
|
||||||
- if [[ $CODECOVERAGE == 1 ]]; then vendor/bin/phpunit tests/ --coverage-clover=coverage.xml; else vendor/bin/phpunit tests/; fi;
|
- if [[ $DB == "mysql" || $DB == "mariadb" ]]; then cp tests/.env.dist.mysql .env; fi;
|
||||||
- cp tests/.env.dist.sqlite .env
|
|
||||||
- bin/console doctrine:database:create -n
|
|
||||||
- bin/console doctrine:migrations:migrate -n
|
|
||||||
- bin/console doctrine:migrations:migrate first -n
|
|
||||||
- cp tests/.env.dist.mysql .env
|
|
||||||
- bin/console doctrine:database:create -n
|
- bin/console doctrine:database:create -n
|
||||||
- bin/console doctrine:migrations:migrate -n
|
- bin/console doctrine:migrations:migrate -n
|
||||||
- bin/console doctrine:migrations:migrate first -n
|
- bin/console doctrine:migrations:migrate first -n
|
||||||
|
|
||||||
after_success:
|
|
||||||
- if [[ $CODECOVERAGE == 1 ]]; then bash <(curl -s https://codecov.io/bash); fi
|
|
||||||
|
|||||||
@@ -5,6 +5,15 @@
|
|||||||
# to each configured DirectoryIndex file (e.g. index.php, index.html, index.pl).
|
# to each configured DirectoryIndex file (e.g. index.php, index.html, index.pl).
|
||||||
DirectoryIndex index.php
|
DirectoryIndex index.php
|
||||||
|
|
||||||
|
# Do NOT use Kimai with http, this is a huge security risk!
|
||||||
|
# Activate these lines if you configured SSL and certificates:
|
||||||
|
|
||||||
|
#<IfModule mod_rewrite.c>
|
||||||
|
# RewriteEngine On
|
||||||
|
# RewriteCond %{SERVER_PORT} 80
|
||||||
|
# RewriteRule ^(.*)$ https://kimai.example.com/$1 [R,L]
|
||||||
|
#</IfModule>
|
||||||
|
|
||||||
<IfModule mod_rewrite.c>
|
<IfModule mod_rewrite.c>
|
||||||
RewriteEngine On
|
RewriteEngine On
|
||||||
|
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ final class Version20180715160326 extends AbstractMigration
|
|||||||
$this->addSql('INSERT INTO ' . $users . ' (id, name, mail, active, password, roles, alias, registration_date, title, avatar) SELECT id, username, email, enabled, password, roles, alias, registration_date, title, avatar FROM __temp__' . $users);
|
$this->addSql('INSERT INTO ' . $users . ' (id, name, mail, active, password, roles, alias, registration_date, title, avatar) SELECT id, username, email, enabled, password, roles, alias, registration_date, title, avatar FROM __temp__' . $users);
|
||||||
$this->addSql('DROP TABLE __temp__' . $users);
|
$this->addSql('DROP TABLE __temp__' . $users);
|
||||||
} else {
|
} else {
|
||||||
$this->addSql('ALTER TABLE ' . $users . ' CHANGE username name VARCHAR(60) NOT NULL COLLATE utf8mb4_unicode_ci, CHANGE email mail VARCHAR(160) NOT NULL COLLATE utf8mb4_unicode_ci, DROP username_canonical, DROP email_canonical, DROP salt, DROP last_login, DROP confirmation_token, DROP password_requested_at, CHANGE password password VARCHAR(254) DEFAULT NULL COLLATE utf8mb4_unicode_ci, CHANGE roles roles JSON NOT NULL COLLATE utf8mb4_bin COMMENT \'(DC2Type:json_array)\', CHANGE alias alias VARCHAR(60) DEFAULT NULL COLLATE utf8mb4_unicode_ci, CHANGE registration_date registration_date DATETIME DEFAULT NULL, CHANGE title title VARCHAR(50) DEFAULT NULL COLLATE utf8mb4_unicode_ci, CHANGE avatar avatar VARCHAR(255) DEFAULT NULL COLLATE utf8mb4_unicode_ci, CHANGE enabled active TINYINT(1) NOT NULL');
|
$this->addSql('ALTER TABLE ' . $users . ' CHANGE username name VARCHAR(60) NOT NULL COLLATE utf8mb4_unicode_ci, CHANGE email mail VARCHAR(160) NOT NULL COLLATE utf8mb4_unicode_ci, DROP username_canonical, DROP email_canonical, DROP salt, DROP last_login, DROP confirmation_token, DROP password_requested_at, CHANGE password password VARCHAR(254) DEFAULT NULL COLLATE utf8mb4_unicode_ci, CHANGE roles roles JSON NOT NULL COMMENT \'(DC2Type:json_array)\', CHANGE alias alias VARCHAR(60) DEFAULT NULL COLLATE utf8mb4_unicode_ci, CHANGE registration_date registration_date DATETIME DEFAULT NULL, CHANGE title title VARCHAR(50) DEFAULT NULL COLLATE utf8mb4_unicode_ci, CHANGE avatar avatar VARCHAR(255) DEFAULT NULL COLLATE utf8mb4_unicode_ci, CHANGE enabled active TINYINT(1) NOT NULL');
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->addSql('UPDATE ' . $users . ' SET roles = \'["ROLE_SUPER_ADMIN"]\' WHERE roles LIKE "%ROLE_SUPER_ADMIN%"');
|
$this->addSql('UPDATE ' . $users . ' SET roles = \'["ROLE_SUPER_ADMIN"]\' WHERE roles LIKE "%ROLE_SUPER_ADMIN%"');
|
||||||
|
|||||||
Reference in New Issue
Block a user