Upgraded CI

This commit is contained in:
Florian Bouillon 2019-04-17 21:16:34 +02:00
parent 50a035047d
commit 815f2bc69d
3 changed files with 44 additions and 18 deletions

View File

@ -6,22 +6,25 @@ image: php:latest
cache: cache:
paths: paths:
- vendor/ - vendor/
- node_modules/
stages: stages:
- build - Build
- test - Test
- Code Quality
- Package
before_script: before_script:
- apt-get update -yqq - apt-get update -yqq
- apt-get install -yqq git libzip-dev libmcrypt-dev libpq-dev libcurl4-gnutls-dev libicu-dev libvpx-dev libjpeg-dev libpng-dev libxpm-dev zlib1g-dev libfreetype6-dev libxml2-dev libexpat1-dev libbz2-dev libgmp3-dev libldap2-dev unixodbc-dev libsqlite3-dev libaspell-dev libsnmp-dev libpcre3-dev libtidy-dev - apt-get install -yqq git # libicu-dev libvpx-dev libjpeg-dev libpng-dev libxpm-dev zlib1g-dev libfreetype6-dev libxml2-dev libexpat1-dev libbz2-dev libgmp3-dev libldap2-dev unixodbc-dev libsqlite3-dev libaspell-dev libsnmp-dev libpcre3-dev libtidy-dev
# Install PHP extensions # Install PHP extensions
- docker-php-ext-install mbstring pdo_pgsql curl json intl gd xml zip bz2 opcache - docker-php-ext-install json
# Install & enable Xdebug for code coverage reports # json is neccesary
- pecl install xdebug # Install & enable Xdebug for code coverage reports
- docker-php-ext-enable xdebug - pecl install xdebug
# Install and run Composer - docker-php-ext-enable xdebug
- curl -sS https://getcomposer.org/installer | php # Install and run Composer
- curl -sS https://getcomposer.org/installer | php
# Bring in any services we need http://docs.gitlab.com/ee/ci/docker/using_docker_images.html#what-is-a-service # Bring in any services we need http://docs.gitlab.com/ee/ci/docker/using_docker_images.html#what-is-a-service
# See http://docs.gitlab.com/ce/ci/services/README.html for examples. # See http://docs.gitlab.com/ce/ci/services/README.html for examples.
@ -37,17 +40,32 @@ variables:
# Run our tests # Run our tests
# If Xdebug was installed you can generate a coverage report and see code coverage metrics. # If Xdebug was installed you can generate a coverage report and see code coverage metrics.
build: build:
stage: build stage: Build
script: script:
- php composer.phar install - php composer.phar install
phpmd: "PHP Mess Detector":
stage: test stage: Code Quality
script: script:
- php composer.phar run phpmd - php composer.phar run phpmd
phpcs: "PHP Unit":
stage: test stage: Test
script: script:
- php composer.phar run phpunit - php composer.phar run phpunit
- vendor/bin/codacycoverage clover tmp/code-coverage.xml - vendor/bin/codacycoverage clover tmp/code-coverage.xml
"PHP CodeSniffer":
stage: Code Quality
script: php composer.phar run phpcs
"Package":
stage: Package
artifacts:
paths:
- package.zip
- package.tar.gz
script:
- php composer.phar install --no-dev --optimize-autoload
- cat production.txt | zip package.zip -r -@
- tar -cvzf package.tar.gz -T production.txt

View File

@ -36,6 +36,7 @@
"scripts": { "scripts": {
"phpmd": "phpmd src/ text phpmd", "phpmd": "phpmd src/ text phpmd",
"phpunit": "phpunit --coverage-text --colors=never", "phpunit": "phpunit --coverage-text --colors=never",
"test": "composer run phpmd && composer run phpcs" "phpcs": "phpcs",
"test": "composer run phpmd && composer run phpunit"
} }
} }

7
production.txt Normal file
View File

@ -0,0 +1,7 @@
logs/
src/
vendor/
.htaccess
CHANGELOG.md
LICENSE
README.md