The results of PHP Parallel Lint can also be used in combination with cs2pr to show any issues in-line in the GH (PR) code view.
GH Actions: cache downloads for Composer
... for faster builds and to be kind to the resources which GH provides freely.
The caching is handled by using a predefined GH action specifically created for this purpose.
The alternative would be to handle the caching manually, which would add three extra steps to the script.
GH Actions: selectively run tests with code coverage
As it was, the setup-php action would always install with xdebug enabled, making all PHP tasks slower and tests would always be run with code coverage being generated, while the coverage report was only used (uploaded to CodeCov) on PHP 7.4.
This commit changes that to:
Only enable Xdebug for the PHP 7.4 build.
Only run the tests with code coverage on PHP 7.4.
GH Actions: run tests against highest/lowest versions of dependencies
Run tests against the highest and lowest versions of the dependencies.
To do so, this commit:
Expands the matrix to include a new dependency-versions key.
It also special cases the build against PHP 8.2, as running PHP against lowest won't be any use for the time being.
Passes the new dependency-versions key to the composer-install action to allow composer to install either with --prefer-lowest or to install via composer update and get the highest available versions of dependencies.
Ref: https://github.com/ramsey/composer-install/#dependency-versions
Adds (extra) conditions to the linting and PHPCompat tasks as those only need to be run once per PHP version / once per build, respectively.
Adjusts the conditions for the test runs so that the code coverage is only generated and uploaded for the PHP 7.4 + highest build.
GH Actions: auto-cancel previous builds for same branch
When the same branch is pushed again (and again), builds queues can start piling up.
The configuration now added, will auto-cancel any builds from previous pushes, whether already running or still waiting.
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.
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.
GH Actions: another ini tweak
Follow up on #99: also enable assertions, which are turned off by default when using
setup-php@v2
.GH Actions: use PHP Parallel Lint
... for faster linting results.
Ref: https://github.com/php-parallel-lint/PHP-Parallel-Lint/
The results of PHP Parallel Lint can also be used in combination with cs2pr to show any issues in-line in the GH (PR) code view.
GH Actions: cache downloads for Composer
... for faster builds and to be kind to the resources which GH provides freely.
The caching is handled by using a predefined GH action specifically created for this purpose. The alternative would be to handle the caching manually, which would add three extra steps to the script.
Refs:
GH Actions: selectively run tests with code coverage
As it was, the
setup-php
action would always install withxdebug
enabled, making all PHP tasks slower and tests would always be run with code coverage being generated, while the coverage report was only used (uploaded to CodeCov) on PHP 7.4.This commit changes that to:
GH Actions: run tests against highest/lowest versions of dependencies
Run tests against the highest and lowest versions of the dependencies.
To do so, this commit:
dependency-versions
key. It also special cases the build against PHP 8.2, as running PHP againstlowest
won't be any use for the time being.dependency-versions
key to thecomposer-install
action to allow composer to install either with--prefer-lowest
or to install viacomposer update
and get the highest available versions of dependencies. Ref: https://github.com/ramsey/composer-install/#dependency-versionsPHP 7.4 + highest
build.GH Actions: auto-cancel previous builds for same branch
When the same branch is pushed again (and again), builds queues can start piling up.
The configuration now added, will auto-cancel any builds from previous pushes, whether already running or still waiting.
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: 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/