https://kotlinlang.org logo
#github-workflows-kt
Title
# github-workflows-kt
n

Nikky

02/26/2022, 7:37 PM
thinking of adding a utility for multi workflow outputs, could use arguments passed to the script to have it print out the correct workflow and without args it will just write all the yaml files
p

Piotr Krzemiński

02/26/2022, 9:45 PM
Sounds interesting, happy to see a PoC :)
n

Nikky

02/26/2022, 10:09 PM
thinks this needs to happen as a PR though as it needs to modify how the script is invoked in the self-verification.. i will try to do that over the next days/week
👍 1
i made this a function that you pass
*args
into it decides whether to write the workflows or print out the yaml of a specific workflow the consistency check now looks like so:
Copy code
run: |
  diff -u '.github/workflows/some_workflow_1.yaml' \
  <('.github/workflows/some_workflow.main.kts' 'Test workflow 1')
the multiple lines ONLY because detekt throws a fit otherwise.. because the line in the multiline string in the tests would be too long
to test it i also added a few helpers like capturing stdout and stderr.. and the tests write to
build/
and check the content of the files..
you use it like so:
Copy code
writeWorkflows(
    addConsistencyCheck = true,
    workflows = listOf(
        workflow
    ),
    args
)
p

Piotr Krzemiński

02/27/2022, 6:47 PM
thanks, will take a look within a few days, busy time here
3 Views