Skip to content
Snippets Groups Projects
Commit 13eaf21e authored by Thomas Flori's avatar Thomas Flori
Browse files

Merge branch 'gitlab-ci' into 'master'

switch to gitlab-ci and move project

See merge request !24
parents cc29c357 edeaae29
No related branches found
No related tags found
1 merge request!24switch to gitlab-ci and move project
Pipeline #747 passed with stages
in 6 minutes and 8 seconds
stages:
- test
- publish
phpunit:
stage: test
needs: []
parallel:
matrix:
- PHP_VERSION: ['7.3', '7.4', '8.0', '8.1', '8.2']
image: iras/php-composer:${PHP_VERSION}
cache:
key: php-dependencies-${PHP_VERSION}
paths:
- ./storage/composer
before_script:
- export COMPOSER_CACHE_DIR=$(pwd)/storage/composer
# basically we are ignoring the composer.lock in tests
- composer update --no-interaction --ansi
script:
- php -dzend_extension=xdebug.so -dxdebug.mode=coverage
vendor/bin/phpunit -c phpunit.xml --color=always
--coverage-text --coverage-cobertura=coverage/cobertura.xml
--coverage-html=coverage/html | tee /tmp/phpunit.out
- sed -r 's~\x01?(\x1B\(B)?\x1B\[([0-9;]*)?[JKmsu]\x02?~~g' /tmp/phpunit.out|grep '^ Lines'
artifacts:
paths:
- coverage/html
reports:
coverage_report:
coverage_format: cobertura
path: coverage/cobertura.xml
coverage: '/^\s*Lines:\s*\d+.\d+\%/'
phpunit-old:
stage: test
needs: []
parallel:
matrix:
- PHP_VERSION: ['7.1', '7.2']
image: iras/php-composer:${PHP_VERSION}
cache:
key: php-dependencies-${PHP_VERSION}
paths:
- ./storage/composer
before_script:
- export COMPOSER_CACHE_DIR=$(pwd)/storage/composer
# basically we are ignoring the composer.lock in tests
- composer update --no-interaction --ansi
script:
- php -dzend_extension=xdebug.so -dxdebug.mode=coverage
vendor/bin/phpunit -c phpunit.xml --color=always
--coverage-text
--coverage-html=coverage/html | tee /tmp/phpunit.out
- sed -r 's~\x01?(\x1B\(B)?\x1B\[([0-9;]*)?[JKmsu]\x02?~~g' /tmp/phpunit.out|grep '^ Lines'
artifacts:
paths:
- coverage/html
coverage: '/^\s*Lines:\s*\d+.\d+\%/'
#quality:
# stage: test
# needs: [ ]
# image: iras/php-composer:8.2
# cache:
# key: php-dependencies-8.2
# paths:
# - ./storage/composer
# before_script:
# - export COMPOSER_CACHE_DIR=$(pwd)/storage/composer
# # basically we are ignoring the composer.lock in tests
# - composer update --no-interaction --ansi
# script:
# - composer run code-quality
style:
stage: test
needs: []
image: iras/php-composer:8.2
cache:
key: php-dependencies-8.2
paths:
- ./storage/composer
before_script:
- export COMPOSER_CACHE_DIR=$(pwd)/storage/composer
# basically we are ignoring the composer.lock in tests
- composer update --no-interaction --ansi
script:
- composer run code-style
packagist:
stage: publish
needs: [phpunit]
image: alpine:3.18
before_script:
- apk add --no-cache curl
script:
- curl -XPOST -H'content-type:application/json'
'https://packagist.org/api/update-package?username=tflori&apiToken='${PACKAGIST_API_TOKEN}
-d'{"repository":{"url":"https://gitlab.w00tserver.org/tflori/nb-sessions.git"}}'
# tflori/verja # tflori/verja
[![.github/workflows/push.yml](https://github.com/tflori/verja/actions/workflows/push.yml/badge.svg)](https://github.com/tflori/verja/actions/workflows/push.yml) [![Build Status](https://gitlab.w00tserver.org/tflori/verja/badges/master/pipeline.svg)](https://gitlab.w00tserver.org/tflori/verja/-/pipelines)
[![Test Coverage](https://api.codeclimate.com/v1/badges/e07f4d5da0789699e27c/test_coverage)](https://codeclimate.com/github/tflori/verja/test_coverage) [![Coverage Status](https://gitlab.w00tserver.org/tflori/verja/badges/master/coverage.svg)](https://gitlab.w00tserver.org/tflori/verja/-/pipelines)
[![Maintainability](https://api.codeclimate.com/v1/badges/e07f4d5da0789699e27c/maintainability)](https://codeclimate.com/github/tflori/verja/maintainability)
[![Latest Stable Version](https://poser.pugx.org/tflori/verja/v/stable.svg)](https://packagist.org/packages/tflori/verja) [![Latest Stable Version](https://poser.pugx.org/tflori/verja/v/stable.svg)](https://packagist.org/packages/tflori/verja)
[![Total Downloads](https://poser.pugx.org/tflori/verja/downloads.svg)](https://packagist.org/packages/tflori/verja) [![Total Downloads](https://poser.pugx.org/tflori/verja/downloads.svg)](https://packagist.org/packages/tflori/verja)
[![License](https://poser.pugx.org/tflori/verja/license.svg)](https://packagist.org/packages/tflori/verja) [![License](https://poser.pugx.org/tflori/verja/license.svg)](https://packagist.org/packages/tflori/verja)
......
...@@ -9,9 +9,10 @@ ...@@ -9,9 +9,10 @@
"require-dev": { "require-dev": {
"phpunit/phpunit": "*", "phpunit/phpunit": "*",
"tflori/phpunit-printer": "*", "tflori/phpunit-printer": "*",
"mockery/mockery": "^1.1", "mockery/mockery": "*",
"squizlabs/php_codesniffer": "^3.5", "squizlabs/php_codesniffer": "*",
"tflori/dependency-injector": "^2.2", "tflori/dependency-injector": "^2.2",
"phpmd/phpmd": "*",
"nesbot/carbon": "^2.53" "nesbot/carbon": "^2.53"
}, },
"autoload": { "autoload": {
...@@ -25,8 +26,9 @@ ...@@ -25,8 +26,9 @@
} }
}, },
"scripts": { "scripts": {
"code-style": "phpcs --standard=PSR2 src && phpcs --standard=PSR2 --ignore=Examples tests", "code-style": "phpcs --colors --standard=PSR2 src tests",
"test": "phpunit", "code-quality": "phpmd src,tests ansi ruleset.xml",
"coverage": "phpunit --coverage-text" "test": "phpunit --stderr",
"coverage": "phpunit --stderr --coverage-text"
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment