add pipeline gitlab file

This commit is contained in:
Tykayn 2021-11-22 12:24:32 +01:00 committed by tykayn
parent d3f3b75252
commit ca5a77c408
1 changed files with 63 additions and 0 deletions

63
.gitlab-ci.yml Normal file
View File

@ -0,0 +1,63 @@
image: jakzal/phpqa:php7.4
before_script:
- composer install
cache:
paths:
- vendor/
stages:
- SecurityChecker
- CodingStandards
- UnitTests
security-checker:
stage: SecurityChecker
script:
- security-checker security:check composer.lock
allow_failure: false
phpcs:
stage: CodingStandards
script:
- phpcs -v --standard=PSR12 --ignore=./src/Kernel.php ./src
allow_failure: false
phpstan:
stage: CodingStandards
script:
- phpstan analyse ./src
allow_failure: false
twig-lint:
stage: CodingStandards
script:
- twig-lint lint ./templates
allow_failure: false
phpunit:
stage: UnitTests
script:
- php bin/phpunit
allow_failure: false
phpunit:
image: php:7.4-apache
stage: UnitTests
services:
- name: mysql:5.7
alias: mysql
variables:
MYSQL_ROOT_PASSWORD: pass_test
MYSQL_DATABASE: myapptest
MYSQL_USER: myapptest
MYSQL_PASSWORD: myapptest
DATABASE_URL: 'mysql://myapptest:myapptest@mysql:3306/myapptest'
before_script:
- apt-get update && apt-get install -y git libzip-dev
- curl -sSk https://getcomposer.org/installer | php -- --disable-tls && mv composer.phar /usr/local/bin/composer
- docker-php-ext-install mysqli pdo pdo_mysql zip
- php bin/console doctrine:database:drop --force --env=test
- php bin/console doctrine:database:create --env=test
- php bin/console doctrine:migration:migrate --env=test --no-interaction
script:
- php bin/phpunit
allow_failure: true