2019-03-27 13:28:45 +01:00
|
|
|
language: php
|
2020-01-01 18:51:33 +01:00
|
|
|
dist: bionic
|
2019-03-27 13:28:45 +01:00
|
|
|
|
2019-10-20 14:35:19 +02:00
|
|
|
services:
|
|
|
|
- mysql
|
|
|
|
|
2019-03-27 16:28:01 +01:00
|
|
|
env:
|
2019-11-23 18:18:30 +01:00
|
|
|
- SYMFONY_DEPRECATIONS_HELPER=disabled APP_ENV=test # Disable deprecation warnings
|
2019-03-27 16:28:01 +01:00
|
|
|
|
2019-03-27 13:28:45 +01:00
|
|
|
# Test for all supported PHP versions
|
|
|
|
php:
|
2020-01-01 15:57:34 +01:00
|
|
|
#- '7.1'
|
2019-03-27 13:28:45 +01:00
|
|
|
- '7.2'
|
|
|
|
- '7.3'
|
2019-12-11 20:33:38 +01:00
|
|
|
- '7.4'
|
2019-03-27 13:32:45 +01:00
|
|
|
|
2020-05-13 21:40:35 +02:00
|
|
|
before_install:
|
|
|
|
# Use a more modern nodejs version, than provided by default
|
|
|
|
- nvm install --lts
|
|
|
|
|
2019-03-27 13:32:45 +01:00
|
|
|
install:
|
2020-01-01 18:51:33 +01:00
|
|
|
- composer install -o
|
2019-10-31 23:14:02 +01:00
|
|
|
# Compile assets
|
|
|
|
- yarn install
|
|
|
|
- yarn build
|
2019-10-20 15:19:32 +02:00
|
|
|
- php bin/console --env test doctrine:database:create --if-not-exists -n
|
2019-10-20 15:11:42 +02:00
|
|
|
- php bin/console --env test doctrine:migrations:migrate -n
|
2019-10-20 19:56:49 +02:00
|
|
|
# Load fixtures (We have to disable foreign key checks or we get errors)
|
2019-10-20 19:28:48 +02:00
|
|
|
- mysql -e "SET GLOBAL FOREIGN_KEY_CHECKS=0;"
|
2019-10-20 15:33:43 +02:00
|
|
|
- php bin/console --env test doctrine:fixtures:load -n
|
2019-10-20 19:28:48 +02:00
|
|
|
- mysql -e "SET GLOBAL FOREIGN_KEY_CHECKS=1;"
|
2019-03-27 16:00:08 +01:00
|
|
|
|
2020-02-01 18:56:31 +01:00
|
|
|
before_script:
|
|
|
|
# Disable Xdebug on non coverage builds
|
|
|
|
- if [[ $(phpenv version-name) != '7.2' ]]; then phpenv config-rm xdebug.ini ; fi
|
|
|
|
|
2019-03-27 16:00:08 +01:00
|
|
|
script:
|
2020-01-09 14:23:17 +01:00
|
|
|
# Only run code coverage on PHP 7.2 to improve performance (code coverage is slower than normal testing)
|
|
|
|
- if [[ $(phpenv version-name) == '7.2' ]]; then php bin/phpunit --coverage-clover=coverage.xml ; fi
|
2020-01-09 14:27:57 +01:00
|
|
|
- if [[ $(phpenv version-name) != '7.2' ]]; then php bin/phpunit ; fi
|
2020-01-09 14:23:17 +01:00
|
|
|
|
2019-11-21 22:27:17 +01:00
|
|
|
# Perform some simple linting if everything is correct
|
|
|
|
- ./bin/console lint:yaml config --parse-tags
|
|
|
|
- ./bin/console lint:twig templates --env=prod
|
2020-01-01 17:42:13 +01:00
|
|
|
- ./bin/console lint:xliff translations
|
2019-11-21 22:27:17 +01:00
|
|
|
# Check if we dont use dependencies with known vulnerabilities
|
|
|
|
- ./bin/console security:check
|
|
|
|
# Check doctrine mapping
|
|
|
|
- ./bin/console doctrine:schema:validate --skip-sync -vvv --no-interaction
|
2019-10-20 19:56:49 +02:00
|
|
|
|
2020-02-01 18:56:31 +01:00
|
|
|
# Static analysis
|
2020-02-02 16:53:34 +01:00
|
|
|
- ./bin/console cache:clear --env dev
|
2020-02-01 18:56:31 +01:00
|
|
|
- composer phpstan
|
|
|
|
|
2019-10-20 19:56:49 +02:00
|
|
|
after_success:
|
2020-01-09 14:23:17 +01:00
|
|
|
- if [[ $(phpenv version-name) == '7.2' ]]; then bash <(curl -s https://codecov.io/bash) ; fi
|
2019-09-23 13:01:37 +02:00
|
|
|
matrix:
|
2019-12-11 20:33:38 +01:00
|
|
|
fast_finish: true
|