Skip to content

Commit

Permalink
Update build
Browse files Browse the repository at this point in the history
  • Loading branch information
mabar authored and Milan Felix Šulc committed Nov 9, 2018
1 parent dee9254 commit 24cbdb3
Show file tree
Hide file tree
Showing 9 changed files with 112 additions and 45 deletions.
6 changes: 1 addition & 5 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ indent_style = tab
indent_size = tab
tab_width = 4

[*.md]
indent_style = space
indent_size = 4

[{composer.json,package.json,.travis.yml}]
[{*.json,*.yml,*.md}]
indent_style = space
indent_size = 2
5 changes: 2 additions & 3 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ tests export-ignore
.gitattributes export-ignore
.gitignore export-ignore
.travis.yml export-ignore
LICENSE export-ignore
README.md export-ignore
phpstan.neon export-ignore
ruleset.xml
README.md export-ignore
ruleset.xml export-ignore
5 changes: 1 addition & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,5 @@
/composer.lock

# Tests
/temp/
/tests/*.log
/tests/tmp
/tests/coverage.html
/temp
/coverage.xml
103 changes: 84 additions & 19 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
language: php

php:
- 7.1
- 7.2
- 7.3

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

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

script:
# Nette/Tester
- composer run-script tester
# Tests
- composer run-script tests

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

jobs:
include:
Expand All @@ -23,41 +27,102 @@ jobs:
install:
- travis_retry composer update --no-progress --prefer-dist --prefer-lowest
script:
- composer run-script tester

- env: title="Lowest Dependencies 7.2"
php: 7.2
install:
- travis_retry composer update --no-progress --prefer-dist --prefer-lowest
script:
- composer run-script tester
- composer run-script tests

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

- stage: Phpstan
php: 7.1
script:
- composer run-script phpstan-install
- composer run-script phpstan

- stage: Test Coverage
php: 7.2
if: branch = master AND type = push
php: 7.1
script:
- composer run-script coverage
after_script:
- wget https://github.com/php-coveralls/php-coveralls/releases/download/v2.0.0/php-coveralls.phar
- wget https://github.com/php-coveralls/php-coveralls/releases/download/v2.1.0/php-coveralls.phar
- php php-coveralls.phar --verbose --config tests/.coveralls.yml

- stage: Phpstan
php: 7.2
- stage: Outdated Dependencies
if: branch = master AND type = cron
php: 7.1
script:
- composer run-script phpstan-install
- composer run-script phpstan
- composer outdated --direct --strict

allow_failures:
- stage: Test Coverage

sudo: false

cache:
directories:
- $HOME/.composer/cache
language: php
php:
- 7.1
- 7.2
- 7.3

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

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

script:
# Tests
- composer run-script tests

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

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

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

- stage: Phpstan
php: 7.1
script:
- composer run-script phpstan-install
- composer run-script phpstan

- stage: Test Coverage
if: branch = master AND type = push
php: 7.1
script:
- composer run-script coverage
after_script:
- wget https://github.com/php-coveralls/php-coveralls/releases/download/v2.1.0/php-coveralls.phar
- php php-coveralls.phar --verbose --config tests/.coveralls.yml

- stage: Outdated Dependencies
if: branch = master AND type = cron
php: 7.1
script:
- composer outdated --direct --strict

allow_failures:
- stage: Test Coverage

sudo: false

cache:
Expand Down
6 changes: 3 additions & 3 deletions readme.md → README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
[![Build Status](https://img.shields.io/travis/contributte/latte-parsedown-extra.svg?style=flat-square)](https://travis-ci.org/contributte/latte-parsedown-extra)
[![Code coverage](https://img.shields.io/coveralls/contributte/latte-parsedown-extra.svg?style=flat-square)](https://coveralls.io/r/contributte/latte-parsedown-extra)
[![Licence](https://img.shields.io/packagist/l/contributte/latte-parsedown-extra.svg?style=flat-square)](https://packagist.org/packages/contributte/latte-parsedown-extra)

[![Downloads this Month](https://img.shields.io/packagist/dm/contributte/latte-parsedown-extra.svg?style=flat-square)](https://packagist.org/packages/contributte/latte-parsedown-extra)
[![Downloads total](https://img.shields.io/packagist/dt/contributte/latte-parsedown-extra.svg?style=flat-square)](https://packagist.org/packages/contributte/latte-parsedown-extra)
[![Latest stable](https://img.shields.io/packagist/v/contributte/latte-parsedown-extra.svg?style=flat-square)](https://packagist.org/packages/contributte/latte-parsedown-extra)
[![PHPStan](https://img.shields.io/badge/PHPStan-enabled-brightgreen.svg?style=flat)](https://github.com/phpstan/phpstan)

## Discussion / Help

Expand Down Expand Up @@ -50,13 +50,13 @@ composer require contributte/latte-parsedown-extra
</td>
<td align="center">
<a href="https://github.com/mabar">
<img width="150" height="150" src="https://avatars0.githubusercontent.com/u/20974277?s=400&v=4">
<img width="150" height="150" src="https://avatars0.githubusercontent.com/u/20974277?s=150&v=4">
</a>
</br>
<a href="https://github.com/mabar">Marek Bartoš</a>
</td>
</tr>
<tbody>
</tbody>
</table>

---
Expand Down
17 changes: 8 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@
"name": "contributte/latte-parsedown-extra",
"description": "ParsedownExtra parser for Latte",
"type": "library",
"license": [
"MIT"
],
"license": "MIT",
"homepage": "https://github.com/contributte/latte-parsedown-extra",
"authors": [
{
"name": "Milan Felix Sulc",
"name": "Milan Felix Šulc",
"homepage": "https://f3l1x.io"
}
],
Expand Down Expand Up @@ -37,17 +35,18 @@
"linter src tests",
"codesniffer src tests"
],
"tester": [
"tests": [
"tester -s -p php --colors 1 -C tests/cases"
],
"coverage": [
"tester -s -p php --colors 1 -C -d extension=xdebug.so --coverage ./coverage.xml --coverage-src ./src tests/cases"
"tester -s -p phpdbg --colors 1 -C --coverage ./coverage.xml --coverage-src ./src tests/cases"
],
"phpstan-install": [
"mkdir -p temp/phpstan",
"composer require -d temp/phpstan phpstan/phpstan:0.9.2",
"composer require -d temp/phpstan phpstan/phpstan-nette:0.9",
"composer require -d temp/phpstan phpstan/phpstan-strict-rules:0.9"
"composer require -d temp/phpstan phpstan/phpstan:^0.10",
"composer require -d temp/phpstan phpstan/phpstan-deprecation-rules:^0.10",
"composer require -d temp/phpstan phpstan/phpstan-nette:^0.10",
"composer require -d temp/phpstan phpstan/phpstan-strict-rules:^0.10"
],
"phpstan": [
"temp/phpstan/vendor/bin/phpstan analyse -l max -c phpstan.neon src"
Expand Down
3 changes: 2 additions & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
includes:
- temp/phpstan/vendor/phpstan/phpstan-strict-rules/rules.neon
- temp/phpstan/vendor/phpstan/phpstan-deprecation-rules/rules.neon
- temp/phpstan/vendor/phpstan/phpstan-nette/extension.neon
- temp/phpstan/vendor/phpstan/phpstan-nette/rules.neon
- temp/phpstan/vendor/phpstan/phpstan-strict-rules/rules.neon
2 changes: 1 addition & 1 deletion src/DI/ParsedownExtraExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function loadConfiguration(): void
$builder = $this->getContainerBuilder();

$builder->addDefinition($this->prefix('parsedown'))
->setClass(ParsedownExtraAdapter::class);
->setFactory(ParsedownExtraAdapter::class);
}

/**
Expand Down
10 changes: 10 additions & 0 deletions tests/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Folders - recursive
*.expected
*.actual

# Folders
/tmp

# Files
/*.log
/*.html

0 comments on commit 24cbdb3

Please sign in to comment.