Skip to content
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

[Core feature request] Model matrix context #368

Open
Vampire opened this issue Jul 28, 2022 · 9 comments
Open

[Core feature request] Model matrix context #368

Vampire opened this issue Jul 28, 2022 · 9 comments
Labels
enhancement New feature or request

Comments

@Vampire
Copy link
Collaborator

Vampire commented Jul 28, 2022

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"))
@Vampire Vampire added the enhancement New feature or request label Jul 28, 2022
@krzema12 krzema12 added this to the v1 (stable) milestone Sep 28, 2022
jmfayard added a commit that referenced this issue Oct 30, 2022
I can't run the project for now because of a timeout
@jmfayard
Copy link
Contributor

I've started designing this but I have an outage that prevents me to go further for now

3567714

@krzema12
Copy link
Member

krzema12 commented Jan 17, 2023

@krzema12
Copy link
Member

@jmfayard do you plan to work on this? I'm asking because you're still assigned here.

@Vampire
Copy link
Collaborator Author

Vampire commented Mar 23, 2023

You closed his PR and deleted his branch in January, saying you are drafting it yourself, so, ... :-D

@krzema12 krzema12 removed this from the v1 (stable) milestone Mar 23, 2023
@krzema12
Copy link
Member

Ok, so I'm deprioritizing it for v1, to be able to release a "good enough" stable version faster.

@Vampire
Copy link
Collaborator Author

Vampire commented Apr 19, 2023

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.

@tangdev-w3
Copy link

just curious if there have been any updates regarding the priority of this?

@krzema12
Copy link
Member

krzema12 commented Nov 7, 2023

@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.

@krzema12
Copy link
Member

krzema12 commented Nov 7, 2023

@tangdev-w3 could you share your exact use case? It will be helpful when deciding on the scope of support to be added.

krzema12 added a commit to krzema12/snakeyaml-engine-kmp that referenced this issue Aug 6, 2024
Use
[github-workflows-kt](https://github.com/typesafegithub/github-workflows-kt)
to implement the workflow in Kotlin, increasing maintainability and
readability.

Note: proper, type-safe matrix strategy support is yet to be
implemented, it's tracked in
typesafegithub/github-workflows-kt#368.

# Testing done
1. Compared what's logged in the "Store benchmark result" step as
"Data", and there are no differences.
* version from `main` branch:
https://github.com/krzema12/snakeyaml-engine-kmp/actions/runs/10187305280/job/28181268567
* version from this branch:
https://github.com/krzema12/snakeyaml-engine-kmp/actions/runs/10244555647/job/28338076917?pr=221
2. Compared with https://www.yamldiff.com/. Most important differences:
* the new version has a consistency check which is required to ensure
that the YAML reflects what's described in Kotlin
* the new version doesn't have the reports preprocessing step
implemented directly, and instead delegates it to the Kotlin script
itself
* instead of using step outputs or env vars (so effectively to not
repeat ourselves with the file paths), I just used Kotlin's constants
* github-workflows-kt proactively adds step IDs to be able to refer to
them whenever needed

![SemanticDiff](https://github.com/user-attachments/assets/d77eb0fc-9129-4121-92a7-e3bc822a1318)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants