-
Notifications
You must be signed in to change notification settings - Fork 4
Upgrade tooling for WPCS 3.0 and PHP 8.0+ #60
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
c350348
Upgrade PHPCS sniffs to HM-flavored variant of WPCS 3.0
kadamwhite 12ae334
composer lint:fix : Predominately removes space in function return ty…
kadamwhite b141cec
Suppress PHPCS warnings we do not consider to be issues in this codebase
kadamwhite b1ff98c
Pin remaining third-party GH actions in Deploy Docs action
kadamwhite eb4c7c8
Add PHPUnit results cache to gitignore
kadamwhite e54f711
Add PHPCS and PHPUnit to GitHub Actions
kadamwhite 0a8b70f
Only test on recent versions of PHP
kadamwhite 3128bb3
Document changes
kadamwhite 4c273f3
Merge branch 'main' into tooling-upgrade
kadamwhite ed41d3e
Escape asset name when triggering missing-manifest error from #59
kadamwhite 5362ae7
Do not test on PHP 8.0, it is already EOL
kadamwhite 0e52862
Elaborate on Changelog entry and document update from #57
kadamwhite 22e5fef
Switch to latest Ubuntu LTS in Travis CI
kadamwhite 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
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,67 @@ | ||
| name: PHP Standards | ||
| on: | ||
| push: | ||
| branches: | ||
| - 'main' | ||
| paths: | ||
| - '**.php' | ||
| - '**.json' | ||
| pull_request: | ||
| branches: | ||
| - '**' | ||
| paths: | ||
| - '**.php' | ||
| - '**.json' | ||
|
|
||
| jobs: | ||
| build: | ||
| name: PHP Coding Standards | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
|
|
||
| - name: Install PHP | ||
| uses: shivammathur/setup-php@e6f75134d35752277f093989e72e140eaa222f35 # v2.28.0 | ||
| with: | ||
| php-version: '8.1' | ||
| coverage: none | ||
|
|
||
| - name: Echo PHP & Composer versions | ||
| run: | | ||
| php --version | ||
| php -m | ||
| composer --version | ||
| - name: Get Composer Cache Directory | ||
| id: composer-cache-dir | ||
| run: | | ||
| echo "::set-output name=dir::$(composer config cache-files-dir)" | ||
| - name: Cache PHP Dependencies | ||
| id: composer-cache | ||
| uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2 | ||
| with: | ||
| path: ${{ steps.composer-cache-dir.outputs.dir }} | ||
| key: ${{ runner.os }}-composer-7.2-${{ hashFiles('composer.lock') }} | ||
|
|
||
| - name: Install PHP Dependencies | ||
| run: | | ||
| composer install --prefer-dist --no-progress --no-suggest --no-interaction | ||
| - name: PHPCS cache | ||
| uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2 | ||
| with: | ||
| path: tests/cache | ||
| key: ${{ runner.os }}-phpcs-7.2-${{ hashFiles('plugin.php') }} | ||
|
|
||
| - name: Check the code for style issues | ||
| run: | | ||
| composer lint | ||
| - name: Run the tests | ||
| run: | | ||
| composer test | ||
| env: | ||
| MYSQL_DATABASE: wordpress | ||
| WP_TESTS_DB_PASS: root | ||
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 |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| vendor/ | ||
| docs/_site/ | ||
| .bundle | ||
| .phpunit.result.cache |
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 |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| # Travis CI Configuration File | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do we still need Travis if we have a php linting action?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unit tests! 😁 |
||
| dist: jammy | ||
|
|
||
| branches: | ||
| only: | ||
|
|
@@ -8,9 +9,8 @@ branches: | |
| language: php | ||
|
|
||
| php: | ||
| - 7.2 | ||
| - 7.3 | ||
| - 7.4 | ||
| - 8.1 | ||
| - 8.2 | ||
|
|
||
| install: composer install | ||
|
|
||
|
|
||
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
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
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.
Uh oh!
There was an error while loading. Please reload this page.