github-workflows-kt
github-workflows-kt copied to clipboard
[Core feature request] Model `matrix` context
What feature do you need? https://docs.github.com/en/actions/learn-github-actions/contexts#matrix-context
Also look at related feature requests: #287 and #297.
Do you have an example usage?
name: Test "${{ matrix.distribution.label }}" distribution on ${{ matrix.environment }}
runs-on: ${{ matrix.environment }}
with:
distribution: ${{ matrix.distribution.user-id }}
Is there a workaround for not having this feature? If yes, please describe it.
name = """Test "${expr("matrix.distribution.label")}" distribution on ${expr("matrix.environment")}"""
runsOn = Custom(expr("matrix.environment"))
distribution = Distribution.Custom(expr("matrix.distribution.user-id"))
I've started designing this but I have an outage that prevents me to go further for now
https://github.com/krzema12/github-workflows-kt/commit/35677144bf2d89f904a458b89864da465e374263
Drafting something on my own: https://github.com/krzema12/github-workflows-kt/tree/368-add-matrix-support
@jmfayard do you plan to work on this? I'm asking because you're still assigned here.
You closed his PR and deleted his branch in January, saying you are drafting it yourself, so, ... :-D
Ok, so I'm deprioritizing it for v1, to be able to release a "good enough" stable version faster.
When adressing this, please also consider being able to configure non-string matrix values.
A 2.5
float matrix value is different from a '2.5'
string matrix value.
And more importantly, a 3.0
float matrix value is different from a '3.0'
string matrix value.
If you give the latter to somewhere else using ${{ matrix.variant }}
, you get 3.0
given, if you give the former, you get 3
given as it is parsed and used as number.
just curious if there have been any updates regarding the priority of this?
@tangdev-w3 it's on hold until client-side binding generation (reducing operational effort of maintaining this library) is done.
It's also pretty tricky to implement elegantly and type-safely, which is another reason I just haven't done it yet. Open for suggestions, PoCs and any other contributions.
@tangdev-w3 could you share your exact use case? It will be helpful when deciding on the scope of support to be added.