Skip to content

Commit

Permalink
Add Travis (Lint & CS)
Browse files Browse the repository at this point in the history
  • Loading branch information
Vrtak-CZ committed Mar 6, 2015
1 parent 65e3005 commit 5f485b4
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 1 deletion.
21 changes: 21 additions & 0 deletions .travis.composer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

$version = getenv('NETTE');

if (!$version || $version == 'default') {
exit;
}

echo "Nette version " . $version . PHP_EOL;

$file = __DIR__ . '/composer.json';
$content = file_get_contents($file);
$composer = json_decode($content, TRUE);
if (!isset($composer['require']['nette/di'])) {
exit(255);
}
$composer['require']['tracy/tracy'] = $version;
$composer['require']['nette/di'] = $version;
$composer['require']['nette/application'] = $version;
$content = json_encode($composer);
file_put_contents($file, $content);
30 changes: 30 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
language: php

sudo: false

env:
- NETTE=default
- NETTE=~2.2.0
- NETTE=~2.2.0 PREFER_LOWEST=true
- NETTE=~2.3.0
- NETTE=~2.3.0 PREFER_LOWEST=true

php:
- 5.4
- 5.5
- 5.6

matrix:
fast_finish: true

before_install:
- composer self-update
- php .travis.composer.php

install:
- composer install --no-interaction --prefer-source
- if [ $PREFER_LOWEST = 'true' ]; then composer update --prefer-lowest --prefer-stable; fi

script:
- vendor/bin/parallel-lint -e php,phpt src
- vendor/bin/phpcs -sp --standard=vendor/nella/coding-standard/Nella/ruleset.xml src
16 changes: 15 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,19 @@
"nette/di": "~2.2,<2.4.0",
"nette/application": "~2.2,<2.4.0",
"vrtak-cz/newrelic-tracy": "~5.0.0"
}
},
"require-dev": {
"jakub-onderka/php-console-highlighter": "~0.3.1",
"jakub-onderka/php-parallel-lint": "~0.8.0",
"nella/coding-standard": "~2.0.0"
},
"archive": {
"exclude": [
".gitignore",
"/.travis.yml",
"/.travis.composer.php"
]
},
"minimum-stability": "dev",
"prefer-stable": true
}

0 comments on commit 5f485b4

Please sign in to comment.