Merge pull request #1087 from IanDelMar/patch-1

Fix travis config file
This commit is contained in:
UnderstrapFramework 2019-12-17 09:37:23 +00:00 committed by GitHub
commit 4f3918c725
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 7 deletions

View File

@ -29,6 +29,12 @@ env:
# e.g. copy database configurations, environment variables, etc. # e.g. copy database configurations, environment variables, etc.
# Failures in this section will result in build status 'errored'. # Failures in this section will result in build status 'errored'.
before_script: before_script:
# Speed up build time by disabling Xdebug.
- phpenv config-rm xdebug.ini || echo 'No xdebug config.'
# Set up temporary paths.
- export PHPCS_DIR=/tmp/phpcs
- export WPCS_DIR=/tmp/wpcs
- export PHPCOMPAT_DIR=/tmp/phpcompatibility
# Set up WordPress installation. # Set up WordPress installation.
- export WP_DEVELOP_DIR=/tmp/wordpress/ - export WP_DEVELOP_DIR=/tmp/wordpress/
- mkdir -p $WP_DEVELOP_DIR - mkdir -p $WP_DEVELOP_DIR
@ -49,14 +55,14 @@ before_script:
# Create WordPress database. # Create WordPress database.
#- mysql -u root -e "CREATE DATABASE wordpress_test;" #- mysql -u root -e "CREATE DATABASE wordpress_test;"
# Install CodeSniffer for WordPress Coding Standards checks. # Install CodeSniffer for WordPress Coding Standards checks.
- mkdir php-codesniffer && curl -L https://github.com/squizlabs/PHP_CodeSniffer/archive/3.5.0.tar.gz | tar xz --strip-components=1 -C php-codesniffer - git clone -b master --depth 1 https://github.com/squizlabs/PHP_CodeSniffer.git $PHPCS_DIR
# Install WordPress Coding Standards. # Install WordPress Coding Standards.
- mkdir wordpress-coding-standards && curl -L https://github.com/WordPress/WordPress-Coding-Standards/archive/2.1.1.tar.gz | tar xz --strip-components=1 -C wordpress-coding-standards - git clone -b master --depth 1 https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards.git $WPCS_DIR
# Hop into CodeSniffer directory. # Install PHP Compatibility sniffs.
- cd php-codesniffer - git clone -b master --depth 1 https://github.com/wimg/PHPCompatibility.git $PHPCOMPAT_DIR
# Set install path for WordPress Coding Standards # Set install path for PHPCS sniffs.
# @link https://github.com/squizlabs/PHP_CodeSniffer/blob/4237c2fc98cc838730b76ee9cee316f99286a2a7/CodeSniffer.php#L1941 # @link https://github.com/squizlabs/PHP_CodeSniffer/blob/4237c2fc98cc838730b76ee9cee316f99286a2a7/CodeSniffer.php#L1941
- bin/phpcs --config-set installed_paths ../wordpress-coding-standards - $PHPCS_DIR/bin/phpcs --config-set installed_paths $WPCS_DIR,$PHPCOMPAT_DIR
# Hop into themes directory. # Hop into themes directory.
- cd $theme_dir - cd $theme_dir
# After CodeSniffer install you should refresh your path. # After CodeSniffer install you should refresh your path.
@ -88,4 +94,4 @@ script:
# -n flag: Do not print warnings (shortcut for --warning-severity=0) # -n flag: Do not print warnings (shortcut for --warning-severity=0)
# --standard: Use WordPress as the standard. # --standard: Use WordPress as the standard.
# --extensions: Only sniff PHP files. # --extensions: Only sniff PHP files.
- $WP_DEVELOP_DIR/php-codesniffer/scripts/phpcs -p -s -v -n . --standard=./codesniffer.ruleset.xml --extensions=php --ignore=*/woocommerce/*,*/src/* - $PHPCS_DIR/bin/phpcs -p -s -v -n . --extensions=php --ignore=*/woocommerce/*,*/src/*