Replies: 18 comments 6 replies
-
|
I've been missing this for a long time now. My use-case is a bit more complicated though - I have multiple matrix jobs and I'd like the dependent jobs started as soon as their dependency from another matrix finishes. TLDR: it would be great if we could use the matrix syntax with its brevity and flexibility and yet still be able to start subsequent jobs as soon as their dependency is done building, thus decreasing the overall time to feedback for the developer as well as the total CI runtime (depends on use case) To update your example @EwoutH, I'd like to see something like this working: name: build-and-test
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
variant: [develop, beta, master]
steps:
- uses: actions/checkout@v3
- run: ./build ${{ matrix.variant }}
- uses: actions/upload-artifact@v3
with:
name: test-app
path: test-app
test:
runs-on: ubuntu-latest
needs: [build:${{ matrix.variant }}] # The magic needs to happen here
strategy:
matrix:
variant: [develop, beta, master]
steps:
- uses: actions/checkout@v3[
- uses: actions/download-artifact@v3
with:
name: test-app
- run: ./test-app The gist is each matrix job should expose a name based on all the variables in the matrix. In this case, there's just one but it should be generalized for any number of variables. There are other possibilities for the exact syntax of the job name (and thus what should be defined in the Another example of the possible syntax is based on how GitLab does it: https://docs.gitlab.com/ee/ci/jobs/job_control.html#fetch-artifacts-from-a-parallelmatrix-job ruby:
image: ruby:${RUBY_VERSION}
parallel:
matrix:
- RUBY_VERSION: ["2.5", "2.6", "2.7", "3.0", "3.1"]
PROVIDER: [aws, gcp]
script: bundle install
deploy:
image: ruby:2.7
stage: deploy
dependencies:
- "ruby: [2.7, aws]"
script: echo hello
environment: production |
Beta Was this translation helpful? Give feedback.
-
|
We also have a similar use case where our workflow times would be sped up by 2-3 times if this was implemented. To me this is an obvious feature to add when you are dealing with matrices in more advanced workflows. So it would be nice to get at least an answer if this is even considered to be implemented? |
Beta Was this translation helpful? Give feedback.
-
|
This feature is a must - this increases the performance |
Beta Was this translation helpful? Give feedback.
-
|
I can do this in Jenkins. |
Beta Was this translation helpful? Give feedback.
-
|
I agree that this feature is a must-have! |
Beta Was this translation helpful? Give feedback.
-
|
I also need this feature! |
Beta Was this translation helpful? Give feedback.
-
|
I also need this feature |
Beta Was this translation helpful? Give feedback.
-
|
I need this feature too. |
Beta Was this translation helpful? Give feedback.
-
|
I also need this feature!!! |
Beta Was this translation helpful? Give feedback.
-
|
+1 |
Beta Was this translation helpful? Give feedback.
-
|
I am also in need of this feature. |
Beta Was this translation helpful? Give feedback.
-
|
I'm Spartacus. ...and like everyone else here, this feature would be killer. |
Beta Was this translation helpful? Give feedback.
-
|
Lord have mercy please just upvote, thumbs up, and subscribe to the discussion instead of spamming 50 people just to write "pLuS oNe MeE tOo I wOuLd LiKe ThIs FeAtUrE" for the 30th time. |
Beta Was this translation helpful? Give feedback.
-
|
FYI The workflow could be rewritten into one workflow and one reusable workflow without relying on missing features. These are just sketches of the OP rewritten using reusable workflows.
name: build-and-test-template
on:
workflow_call:
inputs:
os:
type: string
required: true
jobs:
build:
# add the os from the outer matrix via inputs
runs-on: ${{ inputs.os }}
test:
# If you remove this, then every matrix leg has a test job
if: inputs.os == 'ubuntu-latest'
# ${{ inputs.os }} can be used here too
runs-on: ubuntu-latest
needs: build
name: build-and-test
on: push
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
uses: ./.github/workflows/build-and-test-template.yml
with:
os: ${{ matrix.os }}
# If you might want to use a secret in the build or test job then you would need to pass secrets, inherit disables secret isolation
secrets: inheritYou might need to configure permission properties depending on what you do with github.token This might end up a bit degenerated in the workflow UI, but should work like that using existing features. |
Beta Was this translation helpful? Give feedback.
-
|
Hint: This feature is supported by GitLab CI. Suggestions: As jobs can be nested due to reusable workflows, that hierarchy should be expressible. In the following example, the job group Some possible workaround (but creating other problems).
|
Beta Was this translation helpful? Give feedback.
-
|
I have a similar need. |
Beta Was this translation helpful? Give feedback.
-
|
Recently began learning GHA after years of GitLab and Jenkins— was quite surprised to find this feature missing. |
Beta Was this translation helpful? Give feedback.
-
|
I would also need this, I dont really care what the syntax will look like, even writting |
Beta Was this translation helpful? Give feedback.


Uh oh!
There was an error while loading. Please reload this page.
-
Select Topic Area
Product Feedback
Body
In GitHub Actions, imagine I have a build configuration like this, which builds my program on 3 different OSes and tests it on Ubuntu:
I would like the
testjob to depent on the Ubuntu run from thebuildjob. However, now it depends on all three. How can I specify that thetestjob only needs the ubuntu run from thebuildjob to finish before it starts running, and not all three?TL;DR: I would like the
testjob to run as soon as the Ubuntu build job is finished, and not wait on the macOS and Windows ones.Beta Was this translation helpful? Give feedback.
All reactions