mirror of
https://github.com/Yetangitu/ampache
synced 2025-10-03 09:49:30 +02:00
Add default travis script
This commit is contained in:
parent
0461f2218f
commit
7837bb195f
4 changed files with 73 additions and 2 deletions
13
.travis.yml
Normal file
13
.travis.yml
Normal file
|
@ -0,0 +1,13 @@
|
|||
language: php
|
||||
|
||||
php:
|
||||
- 5.3
|
||||
- 5.4
|
||||
- 5.5
|
||||
|
||||
before_install:
|
||||
- wget http://cs.sensiolabs.org/get/php-cs-fixer.phar
|
||||
|
||||
script:
|
||||
- scripts/tests/syntax.sh
|
||||
- scripts/tests/codestyle.sh
|
|
@ -108,7 +108,8 @@ class Catalog_googlemusic extends Catalog {
|
|||
|
||||
$fields['email'] = array('description' => T_('Email'),'type'=>'textbox');
|
||||
$fields['password'] = array('description' => T_('Password'),'type'=>'password');
|
||||
$fields['deviceid'] = array('description' => T_('Device ID'),'type'=>'textbox');
|
||||
// Device ID not required for streaming access
|
||||
//$fields['deviceid'] = array('description' => T_('Device ID'),'type'=>'textbox');
|
||||
|
||||
return $fields;
|
||||
|
||||
|
@ -187,7 +188,7 @@ class Catalog_googlemusic extends Catalog {
|
|||
$api = new GMApi();
|
||||
$api->setDebug(Config::get('debug'));
|
||||
$api->enableRestore(false);
|
||||
$api->enableMACAddressCheck(true);
|
||||
$api->enableMACAddressCheck(false);
|
||||
$api->enableSessionFile(false);
|
||||
|
||||
if(!$api->login($this->email, $this->password, $this->deviceid)) {
|
||||
|
|
46
scripts/tests/codestyle.sh
Normal file
46
scripts/tests/codestyle.sh
Normal file
|
@ -0,0 +1,46 @@
|
|||
#!/bin/bash
|
||||
|
||||
if [ -e "php-cs-fixer.phar" ]
|
||||
then
|
||||
PHPCSFIXER="php php-cs-fixer.phar"
|
||||
elif hash php-cs-fixer
|
||||
then
|
||||
PHPCSFIXER="php-cs-fixer"
|
||||
else
|
||||
echo -e "\e[1;31mPlease install or download php-cs-fixer\e[00m";
|
||||
echo -e "\e[1;31mhttp://cs.sensiolabs.org/\e[00m";
|
||||
exit 1
|
||||
fi
|
||||
|
||||
PHPCSFIXERARGS="fix -v --fixers="
|
||||
# Mandatory fix
|
||||
FIXERS1="indentation,linefeed,trailing_spaces,short_tag,braces,php_closing_tag,controls_spaces,eof_ending,visibility"
|
||||
# Optionnal fix & false positive
|
||||
#FIXERS2="visibility"
|
||||
|
||||
EXIT=0
|
||||
|
||||
echo -e "\e[1;34mChecking mandatory formatting/coding standards\e[00m"
|
||||
$PHPCSFIXER $PHPCSFIXERARGS$FIXERS1 --dry-run .
|
||||
rc=$?
|
||||
if [[ $rc == 0 ]]
|
||||
then
|
||||
echo -e "\e[1;32mFormatting is OK\e[00m"
|
||||
else
|
||||
echo -e "\e[1;31mPlease check code Formatting\e[00m"
|
||||
echo -e "\e[1;31m$PHPCSFIXER $PHPCSFIXERARGS$FIXERS1 .\e[00m"
|
||||
EXIT=1
|
||||
fi
|
||||
|
||||
#echo -e "\e[1;34mChecking optionnal formatting/coding standards\e[00m"
|
||||
#$PHPCSFIXER $PHPCSFIXERARGS$FIXERS2 --dry-run .
|
||||
#rc=$?
|
||||
#if [[ $rc == 0 ]]
|
||||
#then
|
||||
# echo -e "\e[1;32mOptionnal formatting is OK\e[00m"
|
||||
#else
|
||||
# echo -e "\e[1;33mThere are errors in the formatting (or false positive)\e[00m"
|
||||
# echo -e "\e[1;33m$PHPCSFIXER $PHPCSFIXERARGS$FIXERS2 .\e[00m"
|
||||
#fi
|
||||
|
||||
exit $EXIT
|
11
scripts/tests/syntax.sh
Normal file
11
scripts/tests/syntax.sh
Normal file
|
@ -0,0 +1,11 @@
|
|||
#!/bin/bash
|
||||
|
||||
echo -e "\e[1;34mChecking syntax error\e[00m"
|
||||
output=$(find . -name '*.php' -exec php --syntax-check {} \; | grep -v 'No syntax errors detected in')
|
||||
if [[ $output ]]
|
||||
then
|
||||
echo -e '\e[00;31mPlease check files syntax\e[00m'
|
||||
exit 1
|
||||
else
|
||||
echo -e "\e[1;32mSyntax is OK\e[00m"
|
||||
fi
|
Loading…
Add table
Add a link
Reference in a new issue