Skip to content

Commit

Permalink
Update build
Browse files Browse the repository at this point in the history
  • Loading branch information
mabar committed Mar 31, 2019
1 parent e1750bd commit 56fcd1b
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 41 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Expand Up @@ -5,6 +5,7 @@ tests export-ignore
.gitattributes export-ignore
.gitignore export-ignore
.travis.yml export-ignore
Makefile export-ignore
phpstan.neon export-ignore
README.md export-ignore
ruleset.xml export-ignore
31 changes: 13 additions & 18 deletions .travis.yml
Expand Up @@ -3,47 +3,40 @@ php:
- 7.1
- 7.2
- 7.3
- 7.4snapshot
- nightly

before_install:
# Turn off XDebug
- phpenv config-rm xdebug.ini || return 0
- phpenv config-rm xdebug.ini || return 0 # Turn off XDebug

install:
# Composer
- travis_retry composer install --no-progress --prefer-dist
- travis_retry composer install --no-progress --prefer-dist # Install dependencies

script:
# Tests
- composer run-script tests
- make tests # Tests

after_failure:
# Print *.actual content
- for i in $(find tests -name \*.actual); do echo "--- $i"; cat $i; echo; echo; done
- for i in $(find tests -name \*.actual); do echo "--- $i"; cat $i; echo; echo; done # Print *.actual content

jobs:
include:
- env: title="Lowest Dependencies 7.1"
php: 7.1
install:
- travis_retry composer update --no-progress --prefer-dist --prefer-lowest
- travis_retry composer update --no-progress --prefer-dist --prefer-lowest --prefer-stable
script:
- composer run-script tests
- make tests

- stage: Quality Assurance
php: 7.1
script:
- composer run-script qa

- stage: Phpstan
php: 7.1
script:
- composer run-script phpstan
- make qa

- stage: Test Coverage
if: branch = master AND type = push
php: 7.1
script:
- composer run-script coverage
- make coverage
after_script:
- composer global require php-coveralls/php-coveralls ^2.1.0
- ~/.composer/vendor/bin/php-coveralls --verbose --config tests/.coveralls.yml
Expand All @@ -52,10 +45,12 @@ jobs:
if: branch = master AND type = cron
php: 7.1
script:
- composer outdated --direct --strict
- composer outdated --direct

allow_failures:
- stage: Test Coverage
- php: 7.4snapshot
- php: nightly

sudo: false

Expand Down
27 changes: 27 additions & 0 deletions Makefile
@@ -0,0 +1,27 @@
.PHONY: qa lint cs csf phpstan tests coverage

all:
@$(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | sort | egrep -v -e '^[^[:alnum:]]' -e '^$@$$' | xargs

vendor: composer.json composer.lock
composer install

qa: lint phpstan cs

lint: vendor
vendor/bin/linter src tests

cs: vendor
vendor/bin/codesniffer src tests

csf: vendor
vendor/bin/codefixer src tests

phpstan: vendor
vendor/bin/phpstan analyse -l max -c phpstan.neon src

tests: vendor
vendor/bin/tester -s -p php --colors 1 -C tests/cases

coverage: vendor
vendor/bin/tester -s -p phpdbg --colors 1 -C --coverage ./coverage.xml --coverage-src ./src tests/cases
31 changes: 9 additions & 22 deletions composer.json
Expand Up @@ -22,41 +22,28 @@
"tracy/tracy": "~2.4.14 || ~2.5.0 || ~2.6.0"
},
"require-dev": {
"ninjify/qa": "^0.8.0",
"ninjify/nunjuck": "^0.2.0",
"apitte/negotiation": "^0.5.0",
"nette/di": "~2.4.12",
"phpstan/phpstan-shim": "^0.11",
"ninjify/nunjuck": "^0.2.0",
"ninjify/qa": "^0.8.0",
"phpstan/phpstan-deprecation-rules": "^0.11",
"phpstan/phpstan-nette": "^0.11",
"phpstan/phpstan-shim": "^0.11",
"phpstan/phpstan-strict-rules": "^0.11"
},
"conflict": {
"apitte/negotiation": "<0.5.0",
"nette/di": "<2.4.12"
},
"autoload": {
"psr-4": {
"Apitte\\Debug\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\Fixtures\\": "tests/fixtures"
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"scripts": {
"qa": [
"linter src tests",
"codesniffer src tests"
],
"tests": [
"tester -s -p php --colors 1 -C tests/cases"
],
"coverage": [
"tester -s -p phpdbg --colors 1 -C --coverage ./coverage.xml --coverage-src ./src tests/cases"
],
"phpstan": [
"vendor/bin/phpstan analyse -l max -c phpstan.neon src"
]
"config": {
"sort-packages": true
},
"extra": {
"branch-alias": {
Expand Down
2 changes: 1 addition & 1 deletion ruleset.xml
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<ruleset name="Contributte">
<ruleset>
<!-- Contributte Coding Standard -->
<rule ref="./vendor/ninjify/coding-standard/contributte.xml">
<exclude name="Squiz.Commenting.FunctionComment.InvalidTypeHint"/>
Expand Down

0 comments on commit 56fcd1b

Please sign in to comment.