-
Notifications
You must be signed in to change notification settings - Fork 101
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
Run build-cs composer install/update via post-install/update-cmd scripts #962
Conversation
Naturally running So in 3df9c5d I made the install/update conditional if the system is on PHP 8+. That made the jobs pass, but for some reason it still seems like https://github.com/WordPress/performance/actions/runs/7716757155/job/21034333302#step:5:78 I was expecting to see:
|
@westonruter @swissspidy not sure if it's related issue but Error:
|
@mukeshpanchal27 ah, well it seems that is obsolete now anyway. I think we should delete this: Line 34 in 3df9c5d
That was slowing down linting anyway. No need to re-install with every call. Does it work for you with that removed? |
@mukeshpanchal27 I've removed those pre scripts in 2591052. The Prerequisites section of the handbook page indicates that Composer is optional but the Set up the development environment section does not. I think contributors should have to always do |
.github/workflows/php-test.yml
Outdated
- uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.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.
Oh, I guess this isn't needed because it's running unit tests in the container.
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.
But it would allow composer install
to work properly without having to run it in the container?
…est" This reverts commit cfd3276.
7ec2787
to
eb91014
Compare
eb91014
to
1783ec2
Compare
I don't get it. The On my local machine, I'm supposed to be able to do:
And it should output:
But it isn't. It's outputting instead:
As if the @mukeshpanchal27 As for the error you're seeing in #962 (comment), that makes sense because the Remove the So it makes sense that this wouldn't have worked anymore and should be removed (or at least updated): Line 34 in 4396a84
But again I don't get why Update: An additional |
Converting to draft because this needs some more work, namely to fix running |
Co-authored-by: Joe McGill <[email protected]>
627bf8f
to
9e926dd
Compare
OK, I see why
This being said, I wonder if we should even be committing the |
OK, I'm seeing it now: https://github.com/WordPress/performance/actions/runs/7733545501/job/21085843025#step:7:99 |
Alright, I think it's in a good state now. As can be seen in the PHP 7.0 job for running PHPUnit, if you run
|
Summary
Fixes #961
This fixes the composer scripts for
lint
,phpstan
, andformat
ifcomposer install
has not been run in thebuild-cs
directory before. It also speeds up running those scripts by avoiding runningcomposer update
with each call.Relevant technical choices
Adds a
post-install-cmd
in the rootcomposer.json
which runscomposer install
in thebuild-cs
directory if the PHP version is at least 8.1. Likewise adds apost-update-cmd
to call runcomposer update
in that directory. Additionally, when running PHPUnit tests on the various versions of PHP in the GHA workflow, instead of callingcomposer update
directly it instead callscomposer update
viawp-env
.This fixes an issue which was introduced in #544.
Checklist
[Focus]
orInfrastructure
label.[Type]
label.no milestone
label.