-
-
Notifications
You must be signed in to change notification settings - Fork 23
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
RFC: Proposal for GitHub Actions continuous integration workflow #61
Comments
I really appreciate the switch to GH actions! If you want I can open a PR on one of the above repos which adds a failing test and with wrong coding standards and see what happens 🙂
I had to chuckle 😉 It's funny that even Mr Laminas himself sometimes mistypes Laminas 🙂 edt: it's |
See https://github.blog/2020-08-03-github-actions-improvements-for-fork-and-pull-request-workflows/, specifically:
|
So, it is read-only. Probably, it could interfere with coveralls? |
TBH, I wouldn't cry much if coverall disappeared :D Future scope will likely include @infection, which is a better metric of test quality. |
Yes, infection is cool 🙂 |
We are facing circular dependency issues in some packages. When a PR is created, GHA can grab the target branch from This is only necessary for PRs as they usually are not being named as semver versions. We should keep this in mind to avoid having commits in a PR which provides the target version in a way we might miss when merging PRs. |
@boesing That can be accomplished relatively easily in GHA: env:
BRANCH_NAME: ${{ github.base_ref }}
run: |
export COMPOSER_ROOT_VERSION=${BRANCH_NAME/%.x/.99}
# do other commands here I think this would be something we document, but not include by default; there's only a small number of repos where this is an issue, and I'd rather we have circular references cause errors, and force us to address them, then to put in logic that masks them from us. |
I'd be okay taking that section out of the templates. I hadn't been aware there would be issues pushing by non-maintainers, so if that's the case, we should remove that section. |
Discussed in chat: the biggest issue I see right now is having to copy massive YAML files across dozens of repositories, which is feasible, but it's gonna be extremely draining for everyone. In addition to that, depending which versions of base dependencies are needed, more complexity and small variations can flow in: that's my biggest problem with this. |
@WyriHaximus has been very creative, and did some work to abstract away things like determining which PHP versions to test: https://github.com/WyriHaximus/php-test-utilities/blob/acf6b25513aba198717ab57d4382e1677ffafcc3/.github/workflows/ci.yml#L20-L21 |
@Ocramius happy to help out with this 👍 |
Please see laminas/laminas-eventmanager#15 for a revised approach that builds on the work of @WyriHaximus . |
Closing, as this has been accepted, and we've begun rollout. |
We previously voted to migrate to GitHub Actions. Since then, Travis-CI has announced that OSS plans are limited to 10k minutes per month, and we have twice reached the limit by mid-month. On top of that, while we have requested an OSS exemption, and provided proof that we fit their criteria, the last word we had from them was that they were "revisiting the OSS policy".
Since we've now hit the limits a couple times, both Marco and myself have implemented CI via GitHub Actions on the following repositories:
At this time, I think I've hit on a workable solution; please see laminas/laminas-eventmanager#15 for details.
To get there:
wget
and/orcurl
commands in order to simplify this for those doing the work).travis.yml
, and:git rm
).Originally proposed solution (obsolete)
The solution uses a combination of the following actions:
We then create one workflow file for each task/tool we want to run. Examples include:
A generic workflow file starts like the following:
From there, we add a step for the actual check being performed:
For unit tests, we need a test matrix, and we need to vary things like composer arguments based on PHP version, whether or not to enable coverage, whether or not to upload coverage, etc.. This can be done by creating a matrix strategy, selective definition of matrix variables, and
if
step conditions and/or conditional environment variable declarations. As a full example:Things to note in this example:
TEST_COVERAGE
env variable when installing dependencies and running tests; it is conditionally set to an empty string if not present.COMPOSER_ARGS
env variable.A note on setup-php
This action is quite comprehensive in terms of allowing us to add extensions, provide INI settings, and use all the versions of PHP we need to test against; it also provides some tools (such as composer) out-of-the-box.
In the examples above, I am using the default PHP versions provided with the action, which may or may not be the latest versions released. There is a way to force the action to update to the latest version. However, when enabled, the "Setup PHP" step takes 1.5 - 2+ minutes per job (though jobs are run in parallel). When using the defaults, the step only takes 2s.
Since we are typically trying to favor speed of feedback, I argue we do not enable the flag to force updates.
How we get there
My plan is to create default versions of these workflow files, and place them in the repo-template repository. From there, I will create issues on all non-security-only repositories detailing the following:
wget
and/orcurl
commands in order to simplify this for those doing the work).travis.yml
, updating:git rm
).At that point, we can put out a call-to-action in the Slack and via Twitter to get folks to help, and those of us on the TSC can work on these as well.
The text was updated successfully, but these errors were encountered: