1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-10 18:54:08 +02:00

Merge pull request #2849 from bantu/ticket/12941

[ticket/12941] Check for Sami parse errors on Travis CI.

* bantu/ticket/12941:
  [ticket/12941] Fix remaining Sami complaints.
  [ticket/12941] Check for Sami parse errors on Travis CI.
  [ticket/12941] Add sami.conf.php for Travis CI.
This commit is contained in:
Tristan Darricau
2014-08-10 01:02:27 +02:00
8 changed files with 74 additions and 3 deletions

View File

@@ -0,0 +1,33 @@
#!/bin/bash
#
# This file is part of the phpBB Forum Software package.
#
# @copyright (c) phpBB Limited <https://www.phpbb.com>
# @license GNU General Public License, version 2 (GPL-2.0)
#
# For full copyright and license information, please see
# the docs/CREDITS.txt file.
#
set -e
DB=$1
TRAVIS_PHP_VERSION=$2
if [ "$TRAVIS_PHP_VERSION" == "5.3.3" -a "$DB" == "mysqli" ]
then
# Workarounds for
# https://github.com/fabpot/Sami/issues/116
# and
# https://github.com/fabpot/Sami/issues/117
errors=$(
unbuffer phpBB/vendor/bin/sami.php parse travis/sami.conf.php -v | \
sed "s,\x1B\[[0-9;]*[a-zA-Z],,g" | \
grep "ERROR: " | \
tee /dev/tty | \
wc -l
)
if [ "$errors" != "0" ]
then
exit 1
fi
fi

19
travis/sami.conf.php Normal file
View File

@@ -0,0 +1,19 @@
<?php
/**
*
* This file is part of the phpBB Forum Software package.
*
* @copyright (c) phpBB Limited <https://www.phpbb.com>
* @license GNU General Public License, version 2 (GPL-2.0)
*
* For full copyright and license information, please see
* the docs/CREDITS.txt file.
*
*/
require __DIR__ . '/../build/' . basename(__FILE__);
// Removing the versions array key will make Sami use the current branch.
unset($config['versions']);
return new Sami\Sami($iterator, $config);

View File

@@ -17,6 +17,7 @@ TRAVIS_PHP_VERSION=$2
if [ "$TRAVIS_PHP_VERSION" == "5.3.3" -a "$DB" == "mysqli" ]
then
travis/setup-exiftool.sh
travis/setup-unbuffer.sh
fi
if [ "$DB" == "mariadb" ]

14
travis/setup-unbuffer.sh Executable file
View File

@@ -0,0 +1,14 @@
#!/bin/sh
#
# This file is part of the phpBB Forum Software package.
#
# @copyright (c) phpBB Limited <https://www.phpbb.com>
# @license GNU General Public License, version 2 (GPL-2.0)
#
# For full copyright and license information, please see
# the docs/CREDITS.txt file.
#
set -e
sudo apt-get update
sudo apt-get install -y expect-dev