-
Notifications
You must be signed in to change notification settings - Fork 427
[Develop] Add travis script #304
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
1851d9a
Rename PHPCS ruleset to ruleset.xml so PHPStorm can pick it up
jrfnl d406b3a
Initial stab at travis script
jrfnl 2f7894d
Fix two minor code style issues
jrfnl 25cd7fb
Updated travis script with more recent PHP versions
jrfnl ca002ea
Fix (nearly) all remaining code style issues
jrfnl 625472e
Minor efficiency fix
jrfnl 320022e
Reduce unnecessary concatenation for lower memory usage
jrfnl cd6a5ee
Really remove xss rule exclusion
jrfnl e6fe88e
Merge branch 'develop' into develop-travis
jrfnl f36e2db
Merge branch 'develop' of github.com:thomasgriffin/TGM-Plugin-Activat…
jrfnl d9001c0
Reverted ruleset back to WordPress, but exclude VIP rules
jrfnl 5deebb7
Fix additional code style errors & add some @todo's about sanitizing …
jrfnl 831753a
Merge branch 'develop' of github.com:thomasgriffin/TGM-Plugin-Activat…
jrfnl File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| # Travis CI (MIT License) configuration file | ||
| # @link https://travis-ci.org/ | ||
|
|
||
| # Use new container based environment | ||
| sudo: false | ||
|
|
||
| # Declare project language. | ||
| # @link http://about.travis-ci.org/docs/user/languages/php/ | ||
| language: php | ||
|
|
||
| # Declare versions of PHP to use. Use one decimal max. | ||
| php: | ||
| # Aliased to a recent high PHP version | ||
| - 5.6 | ||
| # Might as well test HHVM too | ||
| - hhvm | ||
| # Lowest currently possible in travis | ||
| - 5.2 | ||
|
|
||
| before_script: | ||
| # Install CodeSniffer for WordPress Coding Standards checks. | ||
| - git clone https://github.com/squizlabs/PHP_CodeSniffer.git phpcs | ||
| # Install WordPress Coding Standards. | ||
| - git clone -b master https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards.git wpcs | ||
| # Hop into CodeSniffer directory. | ||
| - cd phpcs | ||
| # Set install path for WordPress Coding Standards. | ||
| # @link https://github.com/squizlabs/PHP_CodeSniffer/blob/4237c2fc98cc838730b76ee9cee316f99286a2a7/CodeSniffer.php#L1941 | ||
| - scripts/phpcs --config-set installed_paths ../wpcs | ||
| # Hop into project dir. | ||
| - cd $TRAVIS_BUILD_DIR | ||
| # After CodeSniffer install you should refresh your path. | ||
| - phpenv rehash | ||
|
|
||
| # Run test script commands. | ||
| # All commands must exit with code 0 on success. Anything else is considered failure. | ||
| script: | ||
| # Search for PHP syntax errors. Ignore the phpcs and wpcs directories. | ||
| - find -L . -path "./*pcs" -prune -o -name '*.php' -print0 | xargs -0 -n 1 -P 4 php -l; | ||
| # WordPress Coding Standards | ||
| # @link https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards | ||
| # @link http://pear.php.net/package/PHP_CodeSniffer/ | ||
| # -p flag: Show progress of the run. | ||
| # -s flag: Show sniff codes in all reports. | ||
| # -v flag: Print verbose output. | ||
| # -n flag: Do not print warnings (shortcut for --warning-severity=0) | ||
| # --standard: Use WordPress as the standard. | ||
| # --extensions: Only sniff PHP files. | ||
| - $TRAVIS_BUILD_DIR/phpcs/scripts/phpcs -p -s -v -n . --standard=./ruleset.xml --extensions=php | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't Travis only support 5.3 min now?
What about 5.3, 5.4, 5.5? Occasionally something breaks there, and currently we would only know that it passed the low PHP level, but failed at 5.6.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm pretty sure they reverted the removal of PHP 5.2 (under pressure of the WP community).
As we're currently only doing a lint and phpcs, running it on more versions would be wasting resources as the results won't change. If it breaks on either of those two versions, we need to look at the code, everything in between is caught by this.
Once we have unit tests, we should start running it on more versions, though still only lint and phpcs on highest and lowest.