-
-
Notifications
You must be signed in to change notification settings - Fork 454
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
[DRAFT] Isolating bin dependencies. #1716
Changes from 2 commits
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 |
---|---|---|
|
@@ -73,6 +73,11 @@ jobs: | |
ini-values: "zend.assertions=1" | ||
extensions: "pdo_sqlite" | ||
|
||
- name: Install dependencies | ||
run: | | ||
composer update | ||
composer bin all install | ||
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. why installing all ? The psalm bin needs to be installed only for the psalm job. |
||
|
||
- name: "Globally install symfony/flex" | ||
run: "composer require --no-progress --no-scripts --no-plugins symfony/flex" | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,5 @@ phpunit.xml | |
/.phpunit.result.cache | ||
/phpcs.xml | ||
/.phpcs-cache | ||
/vendor-bin/**/vendor/ | ||
!/vendor-bin/**/composer.lock |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?php | ||
|
||
require_once __DIR__ . '/vendor/autoload.php'; | ||
require_once __DIR__ . '/../../vendor/autoload.php'; | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"require-dev": { | ||
"phpunit/phpunit": "^9.5.26", | ||
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. PHPUnit runs in the same process than our code so it cannot have different dependencies. 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. It will work fine, external tools and their dependencies should not affect application/lib dependencies. Had many occasions that phpunit dependency example symfony/process conflicts with app/lib dependencies and had to upgrade phpunit first. 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. That's the reason they must be compatible: when running tests, PHPUnit will run the tested code inside its own process. And as PHP cannot load 2 definitions of a class, your code will run against the Process class of the PHPUnit dependency instead of using its own dependency, which will break. Isolating tools is possible when the tool does not execute your own code in its process. 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. Right , phpunit is probably an exception , other tools like psalm could be moved as they don't autoload code 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. And that's why I reported the issue for PHPUnit, not for Psalm 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. reverted phpunit. |
||
"symfony/phpunit-bridge": "^6.1" | ||
} | ||
} |
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 should not be done here.
Instead, you need to move the command running
composer bin *
later in the workflow, after the stepInstall dependencies with Composer
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.
Composer usually complains that composer.lock is missing and performs update internally
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.
and that's the whole issue: you perform the install or update before the steps that modify the composer.json to change what will get installed.