Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH Actions: selectively use fail-fast with setup-php #240

Merged
merged 2 commits into from
Jan 2, 2023

Conversation

jrfnl
Copy link
Contributor

@jrfnl jrfnl commented Dec 11, 2022

Description

I've seen some recent build failures due to the setup-php action running into a rate limit and not downloading the required version of Composer. In the case of this action, that would make the test runs worthless.

The setup-php action runner defaults to showing these type errors in the logs, but not stopping the workflow run.

So, specifically for those jobs where the Composer version is important, I'm adding the fail-fast option to setup-php to fail the build if the action runner ran into any errors.

Ref: https://github.com/shivammathur/setup-php#fail-fast-optional

Motivation and context

How has this been tested?

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

PR checklist

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING.md document.
  • I have added tests to cover my changes.

馃啎 GH Actions: update PHP version for composer-normalize

Looks like the composer-normalize package has dropped support for PHP < 8.0 as of version 2.29.0.

Refs:

@jrfnl jrfnl requested a review from ramsey as a code owner December 11, 2022 07:00
@jrfnl
Copy link
Contributor Author

jrfnl commented Dec 11, 2022

I've added a second commit to fix the build which was failing due to an unrelated change.

I've seen some recent build failures due to the `setup-php` action running into a rate limit and not downloading the required version of Composer. In the case of this action, that would make the test runs worthless.

The `setup-php` action runner defaults to _showing_ these type errors in the logs, but not stopping the workflow run.

So, specifically for those jobs where the Composer version is important, I'm adding the `fail-fast` option to `setup-php` to fail the build if the action runner ran into any errors.

Ref: https://github.com/shivammathur/setup-php#fail-fast-optional
Looks like the `composer-normalize` package has dropped support for PHP < 8.0 as of version `2.29.0`.

Refs:
* https://github.com/ergebnis/composer-normalize/releases/tag/2.29.0
* ergebnis/composer-normalize#998
@@ -47,6 +47,7 @@ jobs:
php-version: "latest"
tools: "composer:${{ matrix.composer-version }}"
coverage: "none"
fail-fast: true
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just realized I implemented this incorrectly, it should be:

Suggested change
fail-fast: true
env:
fail-fast: true

Fixed in an updated commit.

@jrfnl jrfnl force-pushed the feature/ghactions-fail-setup-php branch from fa9935c to eecc2c0 Compare December 20, 2022 14:02
@codecov
Copy link

codecov bot commented Dec 20, 2022

Codecov Report

Merging #240 (eecc2c0) into v2 (83af392) will not change coverage.
The diff coverage is n/a.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##               v2     #240   +/-   ##
=======================================
  Coverage   97.47%   97.47%           
=======================================
  Files           5        5           
  Lines         119      119           
=======================================
  Hits          116      116           
  Misses          3        3           

@ramsey ramsey merged commit 110668c into ramsey:v2 Jan 2, 2023
@jrfnl jrfnl deleted the feature/ghactions-fail-setup-php branch January 2, 2023 22:51
@danielbachhuber
Copy link

GH Actions: update PHP version for composer-normalize
Looks like the composer-normalize package has dropped support for PHP < 8.0 as of version 2.29.0.

@jrfnl Would this break any downstream use of the ramsey/composer-install action?

Our deployments stopped working ~2 weeks ago:

image

image

https://github.com/wp-cli/wp-cli-bundle/actions/workflows/deployment.yml
https://github.com/wp-cli/wp-cli-bundle/actions/runs/3898207401/jobs/6656726095#step:13:49

@schlessera

@jrfnl
Copy link
Contributor Author

jrfnl commented Jan 16, 2023

GH Actions: update PHP version for composer-normalize
Looks like the composer-normalize package has dropped support for PHP < 8.0 as of version 2.29.0.

@jrfnl Would this break any downstream use of the ramsey/composer-install action?

Absolutely not. This change only affects the CI of the ramsey/composer-install action and has no effect on the actual functionality.

Without looking into your issue, but just based on a quick glance at error shown in the screenshots you included, I have a niggly feeling your issue may have something to do with Composer 2.x vs 2.2 LTS.

Composer 2.3 dropped support for PHP < 7.2 and the autoload files generated by Composer 2.3+ should still be compatible with PHP 5.6 - 7.1, but no guarantee. As Composer 2.5 and 2.5.1 came out about three weeks ago, there may be something in those which broke the autoload compatibility with PHP < 7.2 ?
https://github.com/composer/composer/releases

Composer 2.2 is a LTS release, so can be used if you need to be sure autoload files are PHP cross version compatible.

@danielbachhuber
Copy link

Without looking into your issue, but just based on a quick glance at error shown in the screenshots you included, I have a niggly feeling your issue may have something to do with Composer 2.x vs 2.2 LTS.

@jrfnl Looks like you are correct! composer/composer#11245 (comment)

Absolutely not. This change only affects the CI of the ramsey/composer-install action and has no effect on the actual functionality.

Thanks for being kind to my ignorance 馃槉 I'm still sorting through how all of these GitHub Actions are chained together...

@jrfnl
Copy link
Contributor Author

jrfnl commented Jan 16, 2023

@danielbachhuber No worries, hope you can sort it out and get your own CI running again soon.

@jrfnl
Copy link
Contributor Author

jrfnl commented Feb 4, 2023

@danielbachhuber FYI: I just saw that Composer 2.5.2 has been released which contains a fix for the PHP 5.6 autoloader snafu.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants