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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH Actions: fiddle the PHP versions and line endings for Windows builds #677

Merged
merged 2 commits into from
Nov 13, 2024

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented Nov 13, 2024

Description

Follow up on #663

GH Actions/quicktest: fiddle the PHP versions

Installing on PHP 5.4 with Composer on Windows runs into issues a lot of the time. Considering PHP 5.4 is ancient, let's just side-step this problem by using PHP 5.5.

Also see PHPCSStandards/composer-installer#213 for a little more context (yes, I've seen this issue before).

GH Actions: don't convert line endings

By default the actions/checkout runner uses the default git settings for line ending normalization, which is true.
For Windows, this means that lf line endings in files get converted to crlf on checkout.

In the case of PHPCS, this is problematic as this means that the integration test, which runs PHPCS over the code in PHPCS itself, would fail on hundreds of End of line character is invalid; expected "\n" but found "\r\n" CS errors.

Now, this line ending normalization can be undone via some config in .gitattributes, but that could negatively impact contributors who may prefer to have the line ending conversion when working on files in their local editors.

So instead of that, this commit just turns it off in CI alone. The core.autocrlf input setting should leave the line-endings "as-is" when it gets checked out.

Refs:

Suggested changelog entry

N/A

Installing on PHP 5.4 with Composer on Windows runs into issues a lot of time. Considering PHP 5.4 is ancient, let's just side-step this problem by using PHP 5.5.

Also see PHPCSStandards/composer-installer 213 for a little more context (yes, I've seen this issue before).
By default the `actions/checkout` runner uses the default git settings for line ending normalization, which is `true`.
For Windows, this means that `lf` line endings in files get converted to `crlf` on checkout.

In the case of PHPCS, this is problematic as this means that the integration test, which runs PHPCS over the code in PHPCS itself, would fail on hundreds of `End of line character is invalid; expected "\n" but found "\r\n"` CS errors.

Now, this line ending normalization can be undone via some config in `.gitattributes`, but that could negatively impact contributors who may prefer to have the line ending conversion when working on files in their local editors.

So instead of that, this commit just turns it off in CI alone. The `core.autocrlf input` setting should leave the line-endings "as-is" when it gets checked out.

Refs:
* https://git-scm.com/book/en/v2/Customizing-Git-Git-Configuration#_formatting_and_whitespace
* actions/checkout#135
* actions/checkout#226
@jrfnl jrfnl added this to the 3.11.1 milestone Nov 13, 2024
@jrfnl jrfnl merged commit 76b2aa7 into master Nov 13, 2024
73 checks passed
@jrfnl jrfnl deleted the feature/ghactions-tweak-quicktest-windows branch November 13, 2024 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant