-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Preparation work for Supporting matrix context in output keys #2477
Conversation
hallelujah, this is great news! Thank you.
is there a public issue we can watch? |
Hey @ajaykn 🖖 !
We just copy/paste you example as it was not working in our use case to see if we where doing something wrong but we have the same error. Are we missing something? 🤔 I guess it is still something missing due to the side-note:
Thanks for the work 🙇 |
Love it, just started getting stuck on this issue. To my untrained eye, the changes look like they only affect job outputs, not workflow outputs (for reusable workflows where the workflows are called with a matrix), is that a separate change? Because trying the same syntax on those gives me Edit: I re-checked the example and noticed it uses a hard-coded string to resolve the output, not something like |
Such a great improvement ! Do you have any ETA for this ? So that I know if I need to make a workaround or can just wait ! |
@srosell-uz , @caio-eiq Please note that there are still few more changes from server side. @griseau
We wil share more in blog post once the feature is completely baked. caller workflow
called workflow
yes currently, we will not be supporting expressions inside an expression like |
expressions inside an expression is not required to access composed output keys.
This can be rewritten to |
Could we get an update when the server-side bits have been completed and are live so that the change described here can work please? (Note I am not asking for an ETA, just a note here when it's complete so that we know we can start using this change.) |
Hi all, unfortunately the team working on this feature has been laid off. I have no information on whether or not the work will be continued by another team or if the work has stopped completely. Its quite sad as it was very close to completion. cc @mph4 |
This is a real pity as this is a pretty serious feature gap. Not being able to get matrix per intersection outputs seriously impacts the usability of the matrix feature. |
There's no design documentation linked, so I am not sure what alternative syntax was considered, but templating in the field name seems to be a bit limiting because the user of the outputs will then have to enumerate all the needed field names somehow. This will either lead to a hard-coded, manual expansion of the matrix combinations, or some convoluted code to reuse the matrix definition. Why not allow nested objects so we can use the existing [object filter] feature? For example: outputs:
my_output:
key: ${{matrix.os}}
nested:
key: ${{matrix.arch}}
value: ...
# Usage:
${{jobs.x.outputs.my_output.*.*}}
${{jobs.x.outputs.my_output.linux.*}}
${{jobs.x.outputs.my_output.*.x64}} The last two use cases are almost impossible with the current syntax |
Wouldn't that be solvable with |
Can we please get an update on this? I understand the layoffs have occurred. Is there a PM/team who still has this in the product roadmap or is this indefinitely scrapped? |
Having this feature would make dynamic CICD with github actions a 💥 If there is any help we as community could contribute please let us know! |
Just investigated parameterising a few similar jobs using matrix and I am in total disbelief this functionality wasn't provided from the get-go. It's something that every user of the matrix feature would obviously want. |
Does it work in cloud runner? Because I got error just like srosell-ut |
It will not work until Github pushes backend changes to support this 😢 |
I second this question. |
would have to jump through hoops to pass digest output between jobs given we have a testing matrix. Github is still working on implementing the functionality - actions/runner#2477
would have to jump through hoops to pass digest output between jobs given we have a testing matrix. Github is still working on implementing the functionality - actions/runner#2477
Any new update so far on this topic? |
No we're working on AI. |
While it's a bit niche, worth mentioning how Microsoft's other tool, Playwright (the E2E test runner w/ browser automation) handles the challenge of merging reports from multiple parallel tests. Since they have native support for sharding (scaling parallel test execution by running tests on multiple machines simultaneously), they've shared a GH Actions example which leverages jobs:
run-tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
shardIndex: [1, 2, 3, 4]
shardTotal: [4]
steps:
- name: Run Playwright tests
run: npx playwright test --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }}
- name: Upload blob report to GitHub Actions Artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: blob-report-${{ matrix.shardIndex }}
path: blob-report
retention-days: 1
merge-reports:
# Merge reports after run-tests, even if some shards have failed
if: always()
needs: [run-tests]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
- name: Install dependencies
run: npm ci
- name: Download blob reports from GitHub Actions Artifacts
uses: actions/download-artifact@v4
with:
path: all-blob-reports
pattern: blob-report-*
merge-multiple: true
- name: Merge into HTML Report
run: npx playwright merge-reports --reporter html ./all-blob-reports
- name: Upload HTML report
uses: actions/upload-artifact@v4
with:
name: html-report--attempt-${{ github.run_attempt }}
path: playwright-report
retention-days: 14 While the added HTML-report related steps are specific for Playwright's use-case, the It's not exactly straightforward by a long-shot, but it is an "officially" recommended method for merging outputs together cohesively from prior jobs running matrix strategy. |
well that's a bit off-topic. Uploading multiple files to a single artifact was originally possible and was only broken with release v4 of upload-artifacts. So what they do with But what we wanted to see from this PR was not about artifacts but about outputs: A job that runs in matrix and produces output variables -- e.g. the digest of the docker image it just created -- is currently useless (unless in specific circumstances where you don't care which job's output you consume because they're all going to be the same). So in the same way the upload-artifacts action accepts the input outputs:
${{ matrix.os }}_${{ matrix.arch }}_result: ${{ steps.step1.outputs.test }} It has been suggested to use artifacts as a workaround for this: Instead of using output variables, write the values into a file that is then exposed as artifact. The file will have the matrix values in its name so you can load that file specifically and use the values it defines (could be a .env file). So this isn't entirely unrelated, but only as a matter of workarounds for workaround 😉 |
I'm with you, @SvenStaehs, this is an (inconvenient) workaround that barely serves the purpose, at least until GH Actions actually begins to support multiple outputs from matrix jobs like this PR suggests it should. Between this and passing secrets between jobs, I'm hoping for a lot from the Actions team! 🤞 |
Since outputs do not support matrix strategy id deffinition (see [1]) I used artifact to store resuls and then collect them. --- [1]: actions/runner#2477
* Use test version of Docker image which prints a value * Replace uses: docker with run: docker * Test passing output between jobs * Fix: set `outputs` for first (passing) job * Attempt to use matrix to reference outputs * Can't nest actions variables references * Test actions/runner/pull/2477 syntax (though it seems to be uncompleted) * Try alternative syntax * Can't use wildcard * Can't reference full outputs mapping directly - try JSON * Test whether variables can be used as output name at all * Try using artifacts to pass matrix outputs between jobs * Path is optional for download-artifact * Only run secondary job for the platforms which we expect to return location info * Output variable syntax no longer needed * Not all platforms will produce output - let subsequent job handle it * No relevant output should be created on failure * Trailing spaces * Misplaced comma * No need for echo - echo will always succeed and overwrite actual disseminator exit code * Tidy up * No newline at end of file * No need to append, just write * We only expect output to be non-empty for the specified set of platforms
@TingluoHuang Apologies for the mention, though did anything come of this? We have a flow within our org where this would be incredibly useful. |
I'm opening a new community Question for information regarding this: |
Is this still not solved? 🤯 I've just tried the original proposed approach today: outputs:
${{ matrix.os }}_${{ matrix.arch }}_result: ${{ steps.step1.outputs.test }} only to get invalid workflow error with |
Is this still not solved? |
github, yet another ping on this. |
Any updates? |
Still looking for a resolution on this. |
I brought this up to multiple people from GitHub at GitHub Universe (a YEAR ago). And here we are...
|
Hey folks, I was leading this feature before layoffs happened at GitHub, its quite painful to see the activity on here, which I keep getting notifications for every time someone comments. While I'm no longer employed at GitHub I'm going to reach out to some folks and see if I can find someone willing to finish up this work. P.S. Don't let this get your hopes up too much. 💔 |
Please note that this is not supported yet, and Server side changes are still in-progess
we will release a changelog when supported end to end.
Currently outputs for matrix jobs are represented by a single output and only the last successful matrix job is used to populate the output. This prevents users from being able to target output from a specific job and can lead to unpredictable results since the matrix jobs don't run in a guaranteed order.
So as part of the improvements, we want to support
Allow the
matrix context
to be used to define the output variable name. This allows users to make the output completely deterministic if they choose to include all dimensions of the matrix in their key.Example using all dimensions in output key:
Please note that: Server side changes are still in-progess.