Skip to content

GH Actions: various improvements#63

Merged
jrfnl merged 3 commits into
developfrom
feature/ghactions-various-improvements
Nov 3, 2021
Merged

GH Actions: various improvements#63
jrfnl merged 3 commits into
developfrom
feature/ghactions-various-improvements

Conversation

@jrfnl

@jrfnl jrfnl commented Nov 3, 2021

Copy link
Copy Markdown
Collaborator

GH Actions: split off lint workflow

Execute linting in a separate workflow from running the tests.

GH Actions: further improve PHP ini settings

  • E_ALL does not really contain ALL PHP notices across all PHP versions, in some E_STRICT, for instance, is excluded from E_ALL, so using -1 is the better choice as that will always contain everything.
  • While assertions are (as far as I'm aware) not currently used in the code base, it's still a good idea to enable zend_assertions in case something would be changed in the test tooling used.
    This is one of the other ini settings which is not turned on by default in the setup-php action.
    Ref: https://www.php.net/manual/en/ini.core.php#ini.zend.assertions

GH Actions: auto-cancel previous builds for same branch

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:

jrfnl added 3 commits November 3, 2021 15:29
Execute linting in a separate workflow from running the tests.
* `E_ALL` does not really contain **ALL** PHP notices across all PHP versions, in some `E_STRICT`, for instance, is excluded from `E_ALL`, so using `-1` is the better choice as that will always contain everything.
* While assertions are (as far as I'm aware) not currently used in the code base, it's still a good idea to enable `zend_assertions` in case something would be changed in the test tooling used.
    This is one of the other ini settings which is not turned on by default in the `setup-php` action.
    Ref: https://www.php.net/manual/en/ini.core.php#ini.zend.assertions
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
@jrfnl jrfnl added this to the 1.x Next Release milestone Nov 3, 2021
@jrfnl jrfnl enabled auto-merge November 3, 2021 14:34
@jrfnl jrfnl merged commit 33024ff into develop Nov 3, 2021
@jrfnl jrfnl deleted the feature/ghactions-various-improvements branch November 3, 2021 14:35
@jrfnl jrfnl removed the yoastcs/qa label Nov 23, 2021
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