`brew install actionlint` is a static analyser of ...
# github-workflows-kt
j
brew install actionlint
is a static analyser of GitHub workflows and could be incredibly help to test that the workflow we generate are actually valid cc @Piotr Krzemiński https://github.com/rhysd/actionlint
p
I’m wondering what this tool uses as a reference point to tell if the workflow YAML is valid. I’d rather make our DSL return a correct YAML instead of generating + validating with some non-JVM tool that we’d have to somehow bundle with the lib
j
Correct YAML of course. But it can be a valid YAML and incorrect GitHub Workflow syntax. Because YAML is just a way to represent an arbitrary tree of data.
I’m wondering what this tool uses as a reference point to tell if the workflow YAML is valid.
My guess is that they painfully reviewed the github documentation and tried to write the sanity checker that Github didn’t bother to write.
I’m not mentionning
actionlint
as a replacement of github-workflow.kt My idea was that we can validate the yaml workflow produced by our integration test with it. Probably not perfect. Probably a much faster iteration loop than running everything on GitHub Action
p
hmm, how would the workflow look like with actionlint? would we have to run it locally?
j
locally it looks like that. not sure why you couldn’t run it on GitHub Actions .... or as part of an integration test
p
but integration tests already test the integration with the GitHub itself, without any third-party tool
true that it’s tricky to catch the failures somehow (due to a bug in GitHub), but I’d rather not introduce an extra tool if it’s not strictly needed
j
oh I think I didn’t realize that s much workflows are being run on GitHub https://github.com/krzema12/github-actions-kotlin-dsl/tree/main/.github/workflows
p
this linter looks like a good tool to hook up in some pre-commit hook if someone doesn’t use our lib 😄
j
and that’s great
it would be kind of a test pyramid much faster iteration on many more workflows with
actionlint
which we can keep optional some full fledged workflows being run on GitHub Actions as the ultimate proof of life the universe and eerything
p
(sorry, gotta go back to work 😅 )
is it really a problem in your development workflow? in practice, it’s not a big deal for myself
we have many other problems to deal with 😅
(and so little time)
what we should always consider with such improvements is the extra complexity added to the code base. If the cost associated with the extra complexity (both introducing and maintaining it) is lower than the benefits, then it’s worth considering the change. Here I have some doubts
j
I will try to contribute a small PR to find out what would make sense