-
Notifications
You must be signed in to change notification settings - Fork 3
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
Resolve the vendor/wordpress-autoload.php file on Windows, add PHP 8.1-8.2 support #29
Changes from all commits
9fd341e
38ede0a
022cdb8
9dbbbf8
b5feb00
11902db
a18a3e3
6f7ac29
11c27b4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,19 @@ | ||
name: Tests | ||
|
||
on: [push, pull_request] | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
jobs: | ||
test: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
os: [ubuntu-latest] | ||
php: [7.4, 8.0, 8.1] | ||
os: [ubuntu-latest, windows-2019] | ||
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. 😮 |
||
php: [8.0, 8.1, 8.2, 8.3] | ||
stability: [prefer-lowest, prefer-stable] | ||
|
||
name: P${{ matrix.php }} - ${{ matrix.stability }} - ${{ matrix.os }} | ||
|
@@ -48,5 +52,9 @@ jobs: | |
- name: Install vendor-dir test dependencies | ||
run: cd tests/fixtures/vendor-dir && composer install | ||
|
||
- name: Execute tests | ||
run: composer run test | ||
- name: Execute phpcs | ||
if: matrix.os != 'windows-2019' | ||
run: composer run phpcs | ||
|
||
- name: Execute phpunit | ||
run: composer run phpunit |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -7,7 +7,17 @@ | |||||
*/ | ||||||
|
||||||
$autoloadFiles = [ | ||||||
// Attempt to translate the /vendor/ in the directory path to the vendor directory. | ||||||
preg_replace('#/vendor/.*$#', '/vendor/wordpress-autoload.php', __DIR__), | ||||||
preg_replace('/\\\vendor\\\.*$/', '/vendor/wordpress-autoload.php', __DIR__), | ||||||
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. This looks like one too many backslashes - shouldn't it be like this?
Suggested change
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. I'm not a regex pro to know but in testing with four slashes: two slashes: /shrug |
||||||
|
||||||
// Assuming this file is located at | ||||||
// vendor/alleyinteractive/composer-wordpress-autoloader/src/autoload.php, | ||||||
// hop up a few directories and try to load the file from there. | ||||||
dirname(__DIR__, 3) . '/wordpress-autoload.php', | ||||||
|
||||||
// Handle local development of the package where vendor directory is closer | ||||||
// to the root. | ||||||
'../../../vendor/wordpress-autoload.php', | ||||||
'../../vendor/wordpress-autoload.php', | ||||||
]; | ||||||
|
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.
This will also trigger after the PR is merged. Is that intentional?
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.
Yes, I prefer to always have a status check on the
main
branch to get a valid status badge.