Changed CI to Gitlab

This commit is contained in:
2018-12-26 09:42:54 -03:00
parent b858b89d5b
commit 4566a4e4cc
5 changed files with 34 additions and 42 deletions

26
.gitlab-ci.yml Normal file
View File

@@ -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

View File

@@ -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

8
Makefile Normal file
View File

@@ -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

View File

@@ -1,14 +1,6 @@
Rut Chileno 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 Esta librería implementa una clase Rut como un *value object* inmutable, incluyendo
una api de validación flexible y extendible. una api de validación flexible y extendible.

View File

@@ -30,9 +30,5 @@
"psr-4": { "psr-4": {
"MNC\\ChileanRut\\Tests\\": "tests" "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"
} }
} }