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: various improvements & tweaks #70

Merged
merged 6 commits into from
Nov 10, 2023

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented Nov 10, 2023

Description

GH Actions: don't ignore markdown-only changes

... on pull requests as it doesn't play nice with required statuses.

GH Actions: auto-cancel previous builds for same branch

Previously, in Travis, when the same branch was pushed again and the "Auto cancellation" option on the "Settings" page had been turned on (as it was for most repos), any still running builds for the same branch would be stopped in favour of starting the build for the newly pushed version of the branch.

To enable this behaviour in GH Actions, a concurrency configuration needs to be added to each workflow for which this should applied to.

More than anything, this is a way to be kind to GitHub by not wasting resources which they so kindly provide to us for free.

Refs:

GH Actions: remove the composer validate step

... as Composer will always validate when installing anyway.

GH Actions: harden the workflow against PHPCS ruleset errors

If there is a ruleset error, the cs2pr action doesn't receive an xml report and exits with a 0 error code, even though the PHPCS run failed (though not on CS errors, but on a ruleset error).

This changes the GH Actions workflow to allow for that situation and still fail the build in that case.

Note: not really all that important on this repo as the step is also run on the other PHP versions without cs2pr, but still good to showcase best practices for using PHPCS with cs2pr.

GH Actions: skip fewer tests

Install some external tooling which is required for certain tests to be able to run.

GH Actions: various other small tweaks

Suggested changelog entry

N/A

... on pull requests as it doesn't play nice with required statuses.
Previously, in Travis, when the same branch was pushed again and the "Auto cancellation" option on the "Settings" page had been turned on (as it was for most repos), any still running builds for the same branch would be stopped in favour of starting the build for the newly pushed version of the branch.

To enable this behaviour in GH Actions, a `concurrency` configuration needs to be added to each workflow for which this should applied to.

More than anything, this is a way to be kind to GitHub by not wasting resources which they so kindly provide to us for free.

Refs:
* https://github.blog/changelog/2021-04-19-github-actions-limit-workflow-run-or-job-concurrency/
* https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#concurrency
... as Composer will always validate when installing anyway.
If there is a ruleset error, the `cs2pr` action doesn't receive an `xml` report and exits with a `0` error code, even though the PHPCS run failed (though not on CS errors, but on a ruleset error).

This changes the GH Actions workflow to allow for that situation and still fail the build in that case.
Install some external tooling which is required for certain tests to be able to run.
* Ensure all steps have a name.
* Update a few links in inline comments as the old URLs are no longer valid.
* Fix a non-LF line ending.
* Small indentation fix.
* Be more specific about what Composer can ignore when installing.
    Ref: https://blog.packagist.com/composer-2-2/#-ignore-platform-req-improvements
@jrfnl jrfnl added this to the 3.8.0 milestone Nov 10, 2023
@jrfnl jrfnl marked this pull request as ready for review November 10, 2023 22:21
@jrfnl jrfnl merged commit dd98e20 into master Nov 10, 2023
54 checks passed
@jrfnl jrfnl deleted the feature/ghactions-various-improvements branch November 10, 2023 22:24
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