From e8968b4712effe484d714424f9e180b2d41cb0cc Mon Sep 17 00:00:00 2001 From: Daniel Lamb Date: Mon, 12 Feb 2018 14:57:18 -0400 Subject: [PATCH] Consolidating common checks into a single bash script to be called by all the other modules. --- .travis.yml | 6 +----- tests/scripts/travis_scripts.sh | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 5 deletions(-) create mode 100644 tests/scripts/travis_scripts.sh diff --git a/.travis.yml b/.travis.yml index 34d98c70..039e63cd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -43,12 +43,8 @@ before_install: before_script: # Mysql might time out for long tests, increase the wait timeout. - mysql -e 'SET @@GLOBAL.wait_timeout=1200' - script: - - find $TRAVIS_BUILD_DIR -type f \( -name '*.php' -o -name '*.inc' -o -name '*.module' -o -name '*.install' -o -name '*.test' \) -exec php -l {} \; - - $ISLANDORA_DIR/tests/scripts/line_endings.sh sites/all/modules/islandora - - drush coder-review --reviews=production,security,style,i18n,potx,sniffer islandora - - phpcpd --names *.module,*.inc,*.test sites/all/modules/islandora + - $ISLANDORA_DIR/tests/scripts/travis_script.sh sites/all/modules/islandora - php scripts/run-tests.sh --php `phpenv which php` --url http://localhost:8081 --verbose "Islandora" after_failure: - $ISLANDORA_DIR/tests/scripts/travis_after_failure.sh diff --git a/tests/scripts/travis_scripts.sh b/tests/scripts/travis_scripts.sh new file mode 100644 index 00000000..4fdbec61 --- /dev/null +++ b/tests/scripts/travis_scripts.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +# Common checks to get run during the 'script' section in Travis. + +# Lint +find $TRAVIS_BUILD_DIR -type f \( -name '*.php' -o -name '*.inc' -o -name '*.module' -o -name '*.install' -o -name '*.test' \) -exec php -l {} \; + +# Check line endings +$ISLANDORA_DIR/tests/scripts/line_endings.sh sites/all/modules/islandora + +# Coding standards +drush coder-review --reviews=production,security,style,i18n,potx,sniffer $TRAVIS_BUILD_DIR + +# Copy/paste detection +phpcpd --names *.module,*.inc,*.test $TRAVIS_BUILD_DIR