GH Actions: turn on tests against PHP 8.1 & various other tweaks #210
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
TL;DR: these are largely the same CI changes which I made, and which have been merged, in the other repos.
As I cloned this repo now for the CS update anyway, figured I may as well bring the CI in line as well.
The build will fail until PR #209 has been merged, but should pass without issue after that.
Commit details
GH Actions: allow for manually triggering a workflow
Triggering a workflow for a branch manually is not supported by default in GH Actions, but has to be explicitly allowed.
This is useful if, for instance, an external action script or composer dependency has broken.
Once a fix is available, failing builds for open PRs can be retriggered manually instead of having to be re-pushed to retrigger the workflow.
Ref: https://github.blog/changelog/2020-07-06-github-actions-manual-triggers-with-workflow_dispatch/
GH Actions: simplify Composer caching
... by using the
ramsey/composer-install
action.Ref: https://github.com/marketplace/actions/install-composer-dependencies
GH Actions: fail the build if a test run fails
The way things were set up now in the
phpunit
job, no matter whether tests passed or failed, the workflow would always continue.I suspect this may have been set-up this way to make sure that all variations of test runs will actually be run ?
The downside is that, while you will see a ❌ for the individual build, the workflow will not be marked as failed if a test runs fails.
I'm proposing to change this now by:
continue-on-error
for the test run.fail-fast
key and setting it tofalse
.By default this key is set to
true
, which means that if any individual build within the job fails, all other builds within the job will be cancelled.By setting it to
false
, all builds in the matrix will still be run, but if any of them fail, the workflow will be marked as "failed".Phive: upgrade used version of PHPUnit
GH Actions: start testing against PHP 8.1
As the tests currently pass, I see no reason to allow them to fail.