Skip to content

Commit

Permalink
Merge pull request #56 from sanmai/pr/master/psalm-update
Browse files Browse the repository at this point in the history
Update Psalm to 2.0 and sort packages
  • Loading branch information
sanmai committed Oct 17, 2018
2 parents b55e924 + ab45b7a commit 3e67ba1
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 22 deletions.
2 changes: 2 additions & 0 deletions .coveralls.yml
@@ -0,0 +1,2 @@
coverage_clover:
- build/logs/clover.xml
33 changes: 26 additions & 7 deletions .travis.yml
Expand Up @@ -8,23 +8,42 @@ php:
- nightly

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

stages:
- analyze
- test

jobs:
exclude:
- php: 7.2
include:
- stage: analyze
php: 7.2
install:
- pecl install ast
- phpenv config-rm xdebug.ini
- composer install --prefer-dist
script:
- make ci-analyze --keep-going
- composer validate

cache:
directories:
- $HOME/.composer
- build/cache

install:
- pecl install ast
- if [[ "$TRAVIS_PHP_VERSION" == "nightly" ]]; then COMPOSER_ARGS='--ignore-platform-reqs'; fi
- composer install --prefer-dist $COMPOSER_ARGS
- phpenv config-rm xdebug.ini || true
- composer remove --no-update --dev
phan/phan phpstan/phpstan vimeo/psalm
infection/infection friendsofphp/php-cs-fixer
- composer install --prefer-dist

script:
- if [[ "$TRAVIS_PHP_VERSION" == "nightly" ]]; then vendor/bin/phpunit; else make ci --keep-going COMPOSER='/bin/sh -c composer'; fi
- composer validate
- make ci-test --keep-going

after_success:
- travis_retry php vendor/bin/php-coveralls
- travis_retry php vendor/bin/codacycoverage clover build/logs/clover.xml
33 changes: 24 additions & 9 deletions Makefile
Expand Up @@ -2,6 +2,7 @@

# Use any most recent PHP version
PHP=$(shell which php7.2 || which php7.1 || which php)
PHPDBG=phpdbg -qrr

# Default parallelism
JOBS=$(shell nproc)
Expand All @@ -16,7 +17,9 @@ export PHP_CS_FIXER_IGNORE_ENV=1

# PHPUnit
PHPUNIT=vendor/bin/phpunit
PHPUNIT_ARGS=--coverage-xml=coverage/coverage-xml --log-junit=coverage/phpunit.junit.xml
PHPUNIT_COVERAGE_CLOVER=--coverage-clover=build/logs/clover.xml
PHPUNIT_GROUP=default
PHPUNIT_ARGS=--coverage-xml=build/logs/coverage-xml --log-junit=build/logs/phpunit.junit.xml $(PHPUNIT_COVERAGE_CLOVER)

# Phan
PHAN=vendor/bin/phan
Expand All @@ -39,25 +42,34 @@ COMPOSER=$(PHP) $(shell which composer)
INFECTION=vendor/bin/infection
MIN_MSI=90
MIN_COVERED_MSI=100
INFECTION_ARGS=--min-msi=$(MIN_MSI) --min-covered-msi=$(MIN_COVERED_MSI) --threads=$(JOBS) --coverage=coverage
INFECTION_ARGS=--min-msi=$(MIN_MSI) --min-covered-msi=$(MIN_COVERED_MSI) --threads=$(JOBS) --coverage=build/logs --log-verbosity=default --show-mutations

all: test

##############################################################
# Continuous Integration #
##############################################################

ci: SILENT=
ci: prerequisites ci-phpunit ci-analyze
$(SILENT) $(COMPOSER) validate --strict
ci-test: SILENT=
ci-test: prerequisites
$(SILENT) $(PHPDBG) $(PHPUNIT) $(PHPUNIT_COVERAGE_CLOVER) --group=$(PHPUNIT_GROUP)

ci-analyze: SILENT=
ci-analyze: prerequisites ci-phpunit ci-infection ci-phan ci-phpstan ci-psalm

ci-phpunit: ci-cs
$(SILENT) $(PHP) $(PHPUNIT) $(PHPUNIT_ARGS)
$(SILENT) $(PHPDBG) $(PHPUNIT) $(PHPUNIT_ARGS)

ci-infection: ci-phpunit
$(SILENT) $(PHP) $(INFECTION) $(INFECTION_ARGS)

ci-analyze: ci-cs
ci-phan: ci-cs
$(SILENT) $(PHP) $(PHAN) $(PHAN_ARGS)

ci-phpstan: ci-cs
$(SILENT) $(PHP) $(PHPSTAN) $(PHPSTAN_ARGS) --no-progress

ci-psalm: ci-cs
$(SILENT) $(PHP) $(PSALM) $(PSALM_ARGS) --no-cache

ci-cs: prerequisites
Expand All @@ -67,14 +79,17 @@ ci-cs: prerequisites
# Development Workflow #
##############################################################

test: phpunit analyze
test: phpunit analyze composer-validate

.PHONY: composer-validate
composer-validate: test-prerequisites
$(SILENT) $(COMPOSER) validate --strict

test-prerequisites: prerequisites composer.lock

phpunit: cs
$(SILENT) $(PHP) $(PHPUNIT) $(PHPUNIT_ARGS) --verbose
$(SILENT) $(PHP) $(INFECTION) $(INFECTION_ARGS) --log-verbosity=2 --show-mutations
$(SILENT) $(PHP) $(INFECTION) $(INFECTION_ARGS)

analyze: cs
$(SILENT) $(PHP) $(PHAN) $(PHAN_ARGS) --color
Expand Down
15 changes: 9 additions & 6 deletions composer.json
Expand Up @@ -13,16 +13,16 @@
"symfony/polyfill-php71": "^1.7"
},
"require-dev": {
"phpunit/phpunit": ">=6",
"php-coveralls/php-coveralls": "^2.0",
"friendsofphp/php-cs-fixer": "^2.11",
"codacy/coverage": "^1.4",
"friendsofphp/php-cs-fixer": "^2.11",
"infection/infection": "~0.8",
"league/pipeline": "^1.0|^0.3",
"mockery/mockery": "^1.0",
"phan/phan": "^0.12",
"infection/infection": "~0.8",
"php-coveralls/php-coveralls": "^2.0",
"phpstan/phpstan": "~0.9",
"mockery/mockery": "^1.0",
"vimeo/psalm": ">=1.1"
"phpunit/phpunit": ">=6",
"vimeo/psalm": "^2.0"
},
"license": "Apache-2.0",
"minimum-stability": "dev",
Expand All @@ -40,5 +40,8 @@
"dev-master": "2.x-dev",
"dev-future": "3.x-dev"
}
},
"config": {
"sort-packages": true
}
}

0 comments on commit 3e67ba1

Please sign in to comment.