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

Allow start of job dependent upon completion of one specific matrix job #2

Open
omus opened this issue Aug 13, 2024 · 0 comments
Open

Comments

@omus
Copy link
Member

omus commented Aug 13, 2024

At this time GitHub Actions job dependency system via needs requires that all jobs in a matrix must be completed before the dependent job has started (GitHub discussion: https://github.com/orgs/community/discussions/42335).

For users of the matrix-output action this means we're not being as efficient as we could be with parallelized work. In certain scenarios it is possible to use reusable workflows to solve the output and dependency problem. However, scenarios where a dependent job has multiple dependencies from the matrix wouldn't work.

We could extend matrix-output to be more efficient with dependencies by introducing another action which could be used a wait-for-dependency step as part of another job.

Here are some of the known challenges with implementing this additional action:

  • We cannot rely on using the artifacts created by matrix-output to determine when a job completes as a failed job typically not produce an artifact. We should instead use the API call /repos/{owner}/{repo}/actions/runs/{run_id}/jobs for determining the completed state of a job.
  • The user needs to specify some identifying information so we can identify the specific job's completion state as well as determining which matrix-output artifact to download.
    • We can use the GitHub API numeric job id to monitor the completion state of a job.
    • The job_id (I'll refer to this a the "job key") referred to by github.job (the YAML key used in jobs) is not a field within the GitHub API response for jobs.
    • The GitHub API numeric job id is not available within a GHA context: https://github.com/orgs/community/discussions/8945
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant