krzema12 / kotlin-python

Python target for the Kotlin Programming Language. See https://github.com/krzema12/kotlin-python/tree/python-backend/python
https://discuss.kotlinlang.org/t/idea-python-backend/19852
47 stars 1 forks source link

Translate build and test workflow to Kotlin DSL #106

Closed krzema12 closed 2 years ago

krzema12 commented 2 years ago

Part of https://github.com/krzema12/github-actions-kotlin-dsl/issues/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:

I also checked how it works in case of forgetting to regenerate the YAML. It now fails at runtime:

Screenshot from 2022-01-19 12-25-59

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.

krzema12 commented 2 years ago

And what about another workflow file?

I'll tackle it in a separate PR, will experiment with having both in one file VS separated :)