diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..8aac6f1 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,26 @@ +image: alpine:3.8 + +# This configures the whole environment +before_script: + # Install git, make, zip and php + extensions + - ping -c 3 alpinelinux.org + - apk add --no-cache git curl make gcc unzip php7 php7-mcrypt php7-intl php7-gettext php7-ctype php7-curl php7-dom php7-fileinfo php7-ftp php7-iconv php7-json php7-mbstring php7-mysqlnd php7-openssl php7-pdo php7-pdo_sqlite php7-pear php7-phar php7-posix php7-session php7-simplexml php7-sqlite3 php7-tokenizer php7-xml php7-xmlreader php7-xmlwriter php7-zlib php7-xdebug + # Enable xDebug for coverage report + - echo "zend_extension=/usr/lib/php7/modules/xdebug.so" >> /etc/php7/php.ini + - echo "xdebug.coverage_enable=1" >> /etc/php7/php.ini + # Display php version + - php -v + # Install and run composer + - curl --location --output /usr/local/bin/composer https://getcomposer.org/download/1.7.3/composer.phar + - chmod +x /usr/local/bin/composer + - composer install --ansi + +test: + cache: + key: ${CI_COMMIT_REF_SLUG} + paths: + - vendor/ + script: + - php vendor/bin/phpunit --coverage-text --colors=never + only: + - branches diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 52d38e5..0000000 --- a/.travis.yml +++ /dev/null @@ -1,30 +0,0 @@ -language: php -env: - global: - - CC_TEST_REPORTER_ID=$CC_TEST_REPORTER_ID -dist: precise -php: - - '7.1' - - '7.2' - - nightly - -matrix: - allow_failures: - - php: nightly - -sudo: false -cache: - directories: - - $HOME/.composer/cache - -before_script: - - travis_retry composer self-update - - travis_retry composer install --no-interaction --prefer-dist - - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter - - chmod +x ./cc-test-reporter - - ./cc-test-reporter before-build - -script: composer run test - -after_script: - - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..22f84c1 --- /dev/null +++ b/Makefile @@ -0,0 +1,8 @@ +coverage: + vendor/bin/phpunit --coverage-text + +cs: + vendor/bin/php-cs-fixer fix --diff --verbose + +commit: cs coverage + git add . && git commit \ No newline at end of file diff --git a/README.md b/README.md index cc5adad..d2f02ea 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,6 @@ Rut Chileno =========== -[![Build Status](https://travis-ci.org/mnavarrocarter/chilean-rut.svg?branch=master)](https://travis-ci.org/mnavarrocarter/chilean-rut) -[![Maintainability](https://api.codeclimate.com/v1/badges/c93bd4d894722c404cfd/maintainability)](https://codeclimate.com/github/mnavarrocarter/chilean-rut/maintainability) -[![Test Coverage](https://api.codeclimate.com/v1/badges/c93bd4d894722c404cfd/test_coverage)](https://codeclimate.com/github/mnavarrocarter/chilean-rut/test_coverage) -[![Latest Stable Version](https://poser.pugx.org/mnavarrocarter/chilean-rut/v/stable.svg)](https://packagist.org/packages/mnavarrocarter/chilean-rut) -[![Latest Unstable Version](https://poser.pugx.org/mnavarrocarter/chilean-rut/v/unstable)](https://packagist.org/packages/mnavarrocarter/chilean-rut) -[![Total Downloads](https://poser.pugx.org/mnavarrocarter/chilean-rut/downloads)](https://packagist.org/packages/mnavarrocarter/chilean-rut) -[![License](https://poser.pugx.org/mnavarrocarter/chilean-rut/license)](https://packagist.org/packages/mnavarrocarter/chilean-rut) - Esta librería implementa una clase Rut como un *value object* inmutable, incluyendo una api de validación flexible y extendible. diff --git a/composer.json b/composer.json index 95df055..79e19e3 100644 --- a/composer.json +++ b/composer.json @@ -30,9 +30,5 @@ "psr-4": { "MNC\\ChileanRut\\Tests\\": "tests" } - }, - "scripts": { - "test": "@php vendor/bin/phpunit --verbose --coverage-text --coverage-clover build/logs/clover.xml", - "style": "@php vendor/bin/php-cs-fixer fix" } }