How to run in paraller GitLab CI stages

Hello everyone!

I have one strange question because I’m unsure if it’s possible.
Is there a way I can run in parallel CI stages? I’m triggering a downstream that has multiple stages, and I want them to run ideally in parallel. So basically, if someone is failing to continue to the next one but for overall, if some job fails, it should report everything as failed.
The reason why I need it like this is because I’m running some automated tests.

Hey there!

Yes, this is possible! Please check out the needs keyword in the docs. Basically, you can add

needs: [] 

to all of your jobs that should run ASAP, or

needs:
  - job_name

When your job depends on the job_name (and/or needs artifacts from it).

If you want the downstream pipeline result to be reflected in the parent pipeline (not sure what you meant by “everything” - only whole downstream pipeline or the parent as well), you’d need to add strategy: depend, to your trigger job - something like this:

downstream-pipeline:
  stage: test
  trigger:
    strategy: depend

You’ll find more info on the same docs page :slight_smile:

Hope this helps!

1 Like

Paula,

Thank you so much! That is what I was looking for.

1 Like