Replies: 7 comments 9 replies
-
Cool! I love it. |
Beta Was this translation helpful? Give feedback.
-
after lengthy research, here is the summary of label-based workflows. the key point is, all workflows that build or check something (like building examples, or running lint programs) run when a label, or labels, are added (or removed). workflows only needs to have a simple logic, does the PR have this label? if so, run the workflow. for instance, "Build doc" workflow runs if the PR has a label, with this model, the actual test workflows have very few logic, and the logic is separated from the workflows. the current CI implementations run a workflow when an event is triggered, like when a pull request is opened, or a commit is pushed to a branch. this has a drawback, that is, events are not very granular. what I want to do is, when a PR is opened, and the changes include changes under using labels has a drawback, too. another drawback is the cost of API calls. GitHub has a limit of API calls per an hour, 1000 request. this is probably enough for the moment. API calls require a GitHub Actions runner and it takes time. events are almost immediate, but adding a label requires a runner to start, and to call APIs. from my experience, the latency is acceptable. |
Beta Was this translation helpful? Give feedback.
-
also, this model will affect how you work with the repository (at least me). here is what I have been doing:
this will not work because checks are controlled by labels. you can label PRs but a branch is not a PR.
that is, you will not be able to see if the checks pass until you create a PR. you need to create a PR to see the check results. hope this is okay with others. |
Beta Was this translation helpful? Give feedback.
-
here is the first implementation. this PR introduces a labeler that labels PRs by workflow conclusion. an example label is in this PR, the new workflow does not actually run because the PR is from a fork. to see if this workflow run as intended, the PR must be merged first. |
Beta Was this translation helpful? Give feedback.
-
@UncleRus would you disable "Require status checks before merging"? the condition is not always required because, when changes in a PR is only "*.md" files, `Build examples" is not required to be successful anymore. I will propose a better solution to prevent not-tested-code from merging. |
Beta Was this translation helpful? Give feedback.
-
#374 has been merged. when #376 is also merged, the CI should work as documented. |
Beta Was this translation helpful? Give feedback.
-
Sakurai-san, I'm in awe. |
Beta Was this translation helpful? Give feedback.
-
while working on an experiment in GitHub Actions, there is quite few possibilities in GitHub Actions. in the past, you need to use Apps, GitHub Actions, or write a custom bot to automate something complicated. with recent tools available, such as github-script, you can build your own logic in workflows. writing a custom bot is another option but GitHub Actions is complicated enough for average developers. I don't want to add more complexity to the repository, and it is not very feasible to maintain another (far more complicated).
what I don't like in the CI is that the logic to skip workflow is using a GitHub Actions workflow. I introduced it, but it's quite difficult to achieve what I want to do. when the workflow does not do what I intended, the reason is not quite clear. you have to read the source and understand intentions, or ideas, of the author. in addition, the condition is not visible to PR authors.
it looks to me that many projects use labels for CI and automation. say, if a PR failed to build, then add "build:fail" to the PR. and when the PR has "build:fail", another workflow leave a comment explaining what to do to the PR author. this is easier to see the logic because all the conditions are visible in the PR, as labels.
while exploring the possibilities, I would like to hear your needs in CI. anything else you hope to be implemented?
Beta Was this translation helpful? Give feedback.
All reactions