Skip to content

Commit

Permalink
Shell-based CI with lint scans
Browse files Browse the repository at this point in the history
  • Loading branch information
dktapps committed Oct 17, 2016
1 parent 8f3b951 commit 707847b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ before_script:
- echo | pecl install channel://pecl.php.net/yaml-2.0.0RC7

script:
- php tests/TravisTest.php
- ./tests/lint.sh && ./tests/run.sh

notifications:
email: false
Expand Down
8 changes: 8 additions & 0 deletions tests/lint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
echo Running PHP lint scans...
shopt -s globstar
for file in src/pocketmine/*.php src/pocketmine/**/*.php; do
OUTPUT=`php -l "$file"`
[ $? -ne 0 ] && echo -n "$OUTPUT" && exit 1
done
echo Lint scan completed successfully.
8 changes: 8 additions & 0 deletions tests/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
echo -e "version\nmakeserver\nstop\n" | php src/pocketmine/PocketMine.php --no-wizard --disable-ansi
if ls plugins/DevTools/PocketMine*.phar >/dev/null 2>&1; then
echo Server phar created successfully.
else
echo No phar created!
exit 1
fi

0 comments on commit 707847b

Please sign in to comment.