Skip to content

Commit

Permalink
Switch to codecov (#76)
Browse files Browse the repository at this point in the history
  • Loading branch information
vearutop authored Jun 20, 2019
1 parent 5a8e78f commit e4a5429
Show file tree
Hide file tree
Showing 23 changed files with 1,833 additions and 2,643 deletions.
19 changes: 6 additions & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
language: php
php:
- nightly
- hhvm
- 7.3
- 7.2
- 7.1
Expand All @@ -11,31 +10,25 @@ php:
- 5.4

sudo: false
dist: trusty

## Cache composer bits
cache:
directories:
- $HOME/.composer/cache
- $HOME/.cache/composer

# execute any number of scripts before the test run, custom env's are available as variables
before_script:
- composer install --dev --no-interaction --prefer-dist
- if [[ $(phpenv version-name) =~ 7.2 ]] ; then test -f $HOME/.composer/cache/phpstan.phar || wget https://github.com/phpstan/phpstan/releases/download/0.9.2/phpstan.phar -O $HOME/.composer/cache/phpstan.phar; fi
- if [[ $(phpenv version-name) =~ 7.2 ]] ; then test -f $HOME/.composer/cache/ocular.phar || wget https://scrutinizer-ci.com/ocular.phar -O $HOME/.composer/cache/ocular.phar; fi
- if [[ $(phpenv version-name) =~ 7.2 ]] ; then test -f $HOME/.composer/cache/cctr || wget https://codeclimate.com/downloads/test-reporter/test-reporter-0.1.4-linux-amd64 -O $HOME/.composer/cache/cctr && chmod +x $HOME/.composer/cache/cctr; fi
- if [[ $(phpenv version-name) =~ 7.2 ]] ; then $HOME/.composer/cache/cctr before-build; fi
- if ! [[ $(phpenv version-name) =~ 7.3 ]] ; then phpenv config-rm xdebug.ini || true ; fi
- if [[ $(phpenv version-name) =~ 7.2 ]] ; then test -f $HOME/.cache/composer/phpstan-0.11.8.phar || wget https://github.com/phpstan/phpstan/releases/download/0.11.8/phpstan.phar -O $HOME/.cache/composer/phpstan-0.11.8.phar; fi

matrix:
allow_failures:
- php: hhvm
- php: nightly
fast_finish: true

script:
- ./vendor/bin/phpunit -v --configuration phpunit.xml --coverage-text --coverage-clover clover.xml
- if [[ $(phpenv version-name) =~ 7.2 ]] ; then php $HOME/.composer/cache/phpstan.phar analyze -l 7 -c phpstan.neon ./src; fi
- php -derror_reporting="E_ALL & ~E_DEPRECATED" ./vendor/bin/phpunit -v --configuration phpunit.xml --coverage-text --coverage-clover=coverage.xml
- if [[ $(phpenv version-name) =~ 7.2 ]] ; then php $HOME/.cache/composer/phpstan-0.11.8.phar analyze -l 7 -c phpstan.neon ./src; fi

after_script:
- if [[ $(phpenv version-name) =~ 7.2 ]] ; then php $HOME/.composer/cache/ocular.phar code-coverage:upload --format=php-clover clover.xml; fi
- if [[ $(phpenv version-name) =~ 7.2 ]] ; then $HOME/.composer/cache/cctr after-build --exit-code $TRAVIS_TEST_RESULT; fi
- if [[ $(phpenv version-name) =~ 7.3 ]] ; then bash <(curl -s https://codecov.io/bash); fi
15 changes: 15 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
deps:
@git submodule init && git submodule update

lint:
@test -f $$HOME/.cache/composer/phpstan-0.11.8.phar || wget https://github.com/phpstan/phpstan/releases/download/0.11.8/phpstan.phar -O $$HOME/.cache/composer/phpstan-0.11.8.phar
@php $$HOME/.cache/composer/phpstan-0.11.8.phar analyze -l 7 -c phpstan.neon ./src

docker-lint:
@docker run -v $$PWD:/app --rm phpstan/phpstan analyze -l 7 -c phpstan.neon ./src

test:
@php -derror_reporting="E_ALL & ~E_DEPRECATED" vendor/bin/phpunit

test-coverage:
@php -derror_reporting="E_ALL & ~E_DEPRECATED" -dzend_extension=xdebug.so vendor/bin/phpunit --coverage-text
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# Swaggest JSON-schema implementation for PHP

[![Build Status](https://travis-ci.org/swaggest/php-json-schema.svg?branch=master)](https://travis-ci.org/swaggest/php-json-schema)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/swaggest/php-json-schema/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/swaggest/php-json-schema/?branch=master)
[![Code Climate](https://codeclimate.com/github/swaggest/php-json-schema/badges/gpa.svg)](https://codeclimate.com/github/swaggest/php-json-schema)
[![Code Coverage](https://scrutinizer-ci.com/g/swaggest/php-json-schema/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/swaggest/php-json-schema/code-structure/master/code-coverage/src/)
[![codecov](https://codecov.io/gh/swaggest/php-json-schema/branch/master/graph/badge.svg)](https://codecov.io/gh/swaggest/php-json-schema)

High definition PHP structures with JSON-schema based validation.

Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
"require": {
"php": ">=5.4",
"ext-json": "*",
"ext-mbstring": "*",
"phplang/scope-exit": "^1.0",
"swaggest/json-diff": "^3.5.1"
},
"require-dev": {
"phpunit/phpunit": "4.8.35",
"phpunit/php-code-coverage": "2.2.4",
"codeclimate/php-test-reporter": "0.4.0"
"phpunit/php-code-coverage": "2.2.4"
},
"license": "MIT",
"authors": [
Expand Down
Loading

0 comments on commit e4a5429

Please sign in to comment.