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
Translate build and test workflow to Kotlin DSL #106
Translate build and test workflow to Kotlin DSL #106
Conversation
b04984e
to
5293ea3
Compare
5293ea3
to
cad2502
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And what about another workflow file?
My though regarding deduplication was quite opposite: merge to the single file. However, that would include some error-prone conditions based on the file input (like workflow_dispatch or push). You way is better that we can have linear workflows. And I generally love the DSL :)
run: | | ||
python/experiments/generate-box-tests-reports.main.kts \ | ||
--test-task=${{ matrix.testTask }} \ | ||
--failed-tests-report-path=failed-tests.txt \ | ||
--box-tests-report-path=box-tests-report.tsv \ | ||
--failure-count-report-path=failure-count.tsv |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, I was OK with long lines ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually found them hard to work with. Horizontal scrolling is painful :)
I'll tackle it in a separate PR, will experiment with having both in one file VS separated :) |
Part of typesafegithub/github-workflows-kt#3.
The workflows in kotlin-python are the main inspiration to me to create https://github.com/krzema12/github-actions-kotlin-dsl/.
That's why I'd like to use it in this project, so that we have a real-life scenario and "customer zero".
I'm migrating just one workflow as an experiment, and once it's merged, I'll do the same with the other one. By having them in the same Kotlin file or sharing common Kotlin file, we'll manage to remove some across-workflows duplication.
Testing
I compared workflows in runtime, before and after this change:
pythonTest
: before and aftermicroPythonTest
: before and afterI also checked how it works in case of forgetting to regenerate the YAML. It now fails at runtime:
and in the future we can e.g. add auto-generated job that regenerates the YAML. The golden grail is GitHub supporting such Kotlin DSL, without any (semi)manual generation steps.