Parallel Steps #14484
Replies: 36 comments 63 replies
-
|
I'd like that too. There are scenarios where it doesn't make sense juggling artifacts between jobs. An idea how it could be used: steps:
- uses: actions/checkout@v3
- run: echo "Sequential step"
- parallel:
branch_id_1:
steps:
- run: echo "branch 1 sequential step 1"
- run: echo "branch 1 sequential step 2"
# Executes steps in parallel to branch1
branch_id_2:
steps:
- run: echo "branch 2 sequential step 1"
- run: echo "branch 2 sequential step 2"
- run: echo "More sequential steps after the whole parallel part is done." |
Beta Was this translation helpful? Give feedback.
-
|
Alternative solution: |
Beta Was this translation helpful? Give feedback.
-
Alternative solution: |
Beta Was this translation helpful? Give feedback.
-
|
Logging into docker in parallel is probably going to result in things exploding. Each docker login command tries to mutate Today, you could probably do something like: (To make these work, you'd want to have them rely on env vars and set the env vars using your workflow based on secrets)
HOME=$HOME/.docker-docker
mkdir -p $HOME
docker login ...
HOME=$HOME/.docker-gcr
mkdir -p $HOME
docker login ...
HOME=$HOME/.docker-ghcr
mkdir -p $HOME
docker login ...
for task in ./log-into-*.sh; do
$task &
done
wait
jq '. * input' ~/.docker*/config.js > my.config.js && mv my.config.js ~/.docker/config.js
jq '. * input' ~/.docker*/plaintext-credentials.config.json > my.plaintext.js && mv my.plaintext.js ~/.docker/plaintext-credentials.config.json |
Beta Was this translation helpful? Give feedback.
-
|
can we have the parallel steps please |
Beta Was this translation helpful? Give feedback.
-
|
The BitBucket has parallel step options. Why not add this option to GitHub actions? |
Beta Was this translation helpful? Give feedback.
-
|
This is the biggest pain point we've run into coming from Jenkins. You can approximate this feature with |
Beta Was this translation helpful? Give feedback.
-
|
Need parallel steps support for our scenario: deploy multi clusters concurrently within the same VPN environment. So it is convinient to achive in steps rather than actions or jobs |
Beta Was this translation helpful? Give feedback.
-
|
Using a yarn monorepo I'd like to:
yarn install is slow, and I currently have to repeat it for every workflow like |
Beta Was this translation helpful? Give feedback.
-
|
If its easier, GitHub could also allow sharing jobs workdirs |
Beta Was this translation helpful? Give feedback.
-
|
I just want to start a resource in a background, which needs some time to start, eg a docker container or a simulator. This resource should start during the job start. My test step should wait until the test resource is available, or fail after an (optional) timeout. - jobs:
- build
- resources:
- test-db
run: docker start someSlowImage
- steps:
- run: assemble
- run: test
resources:
- test-db
timeout: 5min |
Beta Was this translation helpful? Give feedback.
-
Just add a
|
Beta Was this translation helpful? Give feedback.
-
|
As a workaround I was able to use this ` name: Distributed Tasks This way I was able to run our tests parallel |
Beta Was this translation helpful? Give feedback.
This comment was marked as off-topic.
This comment was marked as off-topic.
-
|
Hi. Are there any updates on this topic from a Github team member ? |
Beta Was this translation helpful? Give feedback.
-
|
Don't know much about Actions as I'm new to this (trying to find alternatives to Drone CI), but a simple feature like this took so long time to implement, maybe the design of Actions has some fundamental flaws on create DAG of steps. Drone steps are by default parallel, unless you add a 'depends_on' list to steps, which would transform them to a DAG. |
Beta Was this translation helpful? Give feedback.
-
|
Would love this feature as well. We already have quite long running pipelines and saving some time would be great. We build our .NET backend then pack it as docker image. While creating the image takes significant time we also need to upload our symbols to Sentry for better error analysis. While docker images are being created we could parallelize the upload to Sentry. A new job is no option as we lose the symbol files we require. Right now we run a separate job which fetches git, compiles, etc. all just to upload already built symbols. Please implement this! :) |
Beta Was this translation helpful? Give feedback.
-
|
I have 5 small steps (10-30sec), each runs a docker container with different arguments. Ideally I would have first step to build docker image and then run those five steps in parallel. Doing this with workflows seems cumbersome and would possibly prolong the total run time with artifact upload and artifact downloads added to share the image between jobs. |
Beta Was this translation helpful? Give feedback.
-
|
Hey y'all! We are still gathering all the high engagement feedback items and triaging them for our work this year. Sorry I haven't commented on this one already. Thank you for all engaging and staying engaged for such a long period of time - please keep voting up on the top request and sharing your feedback with us |
Beta Was this translation helpful? Give feedback.
-
|
💬 Your Product Feedback Has Been Submitted 🎉 Thank you for taking the time to share your insights with us! Your feedback is invaluable as we build a better GitHub experience for all our users. Here's what you can expect moving forward ⏩
Where to look to see what's shipping 👀
What you can do in the meantime 💻
As a member of the GitHub community, your participation is essential. While we can't promise that every suggestion will be implemented, we want to emphasize that your feedback is instrumental in guiding our decisions and priorities. Thank you once again for your contribution to making GitHub even better! We're grateful for your ongoing support and collaboration in shaping the future of our platform. ⭐ |
Beta Was this translation helpful? Give feedback.
-
|
I just released https://github.com/qoomon/actions--parallel-steps This action supports basically all types of steps. |
Beta Was this translation helpful? Give feedback.
-
|
Just adding my voice so maybe by the time my grandkids are coding, GitHub Actions will support parallel steps. |
Beta Was this translation helpful? Give feedback.
-
|
Implementing parallel steps in GitHub Actions would significantly enhance CI/CD workflows, especially for tasks like deploying to multiple environments or managing dependencies across various services. For instance, in a mobile app development company, managing Docker containers and parallelizing tasks can help eliminate the complexity of sequential executions. This approach not only speeds up the development cycle but also ensures more efficient use of resources. Incorporating a feature that allows for parallel execution of steps within a single job, while maintaining access to the same environment and cache, would be a valuable addition. It would streamline processes and reduce the overhead associated with managing multiple jobs. Looking forward to seeing this feature implemented, as it would greatly improve the flexibility and efficiency of workflows in GitHub Actions. |
Beta Was this translation helpful? Give feedback.
-
|
Kinda reminder |
Beta Was this translation helpful? Give feedback.
-
|
https://github.blog/news-insights/product-news/lets-talk-about-github-actions/
|
Beta Was this translation helpful? Give feedback.
-
|
Hi everyone 👋 This discussion has received over 2,400 upvotes and 70+ comments, making it one of the most requested features for GitHub Actions. We've reviewed the feedback carefully and want to share a proposal that we believe addresses the core scenarios you've described and get community feedback on this proposal. What We're ProposingWe're exploring three new primitives for running steps concurrently, plus syntactic sugar for the most common pattern:
We plan to release the first three primitives initially and have the The Core PrimitivesNOTE: These are the names we are currently thinking about using, we're certainly open to reconsidering the specific names or syntax used.
|
| Pattern | Example | Solution |
|---|---|---|
| True parallel | Build 3 packages simultaneously | parallel: or background: + wait-all: |
| Background server | Start server, run tests, stop server | background: + cancel: |
| Fire-and-forget | Upload telemetry while build continues | background: (no wait needed) |
A simple parallel block only handles the first pattern. The background/wait/cancel primitives handle all three.
Mirrors Shell Behavior
This design follows how shells work: & to background a process, wait to synchronize. Workflow authors already understand this mental model.
Better Logging Than '&' Workarounds
Many of you are already using & and nohup workarounds:
- run: |
./start-server.sh &
SERVER_PID=$!
npm test
kill $SERVER_PIDThe problem: no log visibility. Output from backgrounded processes is interleaved or lost. In addition, it is difficult to gracefully terminate these long running processes.
With native background: true, each step gets its own log stream in the Actions UI: collapsible, searchable, and tied to the step that produced it. It can also be terminated more gracefully with cancel
Why aren't you just building a parallel block?
We started investigating a parallel block and we realized two things:
- The concept of a background step was more powerful, solving more challenges than just parallelism
- Building
parallelprobably would have used something very similar to a background step as part of the implementation.
We believe the better option is to start with more powerful primitive to give users a way to solve the parallelism problem (and others). At the same time, we recognize the user experience value of a parallel block, so we want to built it on top of these new primitives. We believe this will help us keep with the philosophy of "make the simple things easy and the complex things possible".
Will I be able to have background steps within composite actions?
Initially, no. You would be able to run a composite action as a background step within a workflow, but you would not be able to author composite actions that use background steps. Supporting these cases will need UI/logging work to visualize properly. We wouldn't want to block an initial release which would help a large portion of the community on this, so we'd probably defer it as a next step.
Examples from Your Comments
E2E Testing with Background Server
From @hfhbd: "I just want to start a resource in a background, which needs some time to start"
NOTE: The specific example @hfhbd gave was about starting Docker containers which can currently be done with service containers. However, service containers don't work if you wanted to do something that isn't containerized, requires mid-job startup, or need to run something that isn't compatible with services like a Mac or Windows runner. Background steps would enable those use cases.
steps:
- run: npm install
- name: Start dev server
id: server
run: npm run dev
background: true
# Health check to make sure server is up and ready before running tests
- name: Wait for server ready
run: curl --retry 10 --retry-delay 1 http://localhost:3000/health
- name: Run E2E tests
run: npm run test:e2e
- cancel: server # this Parallel set of sequential steps
From @lukasz-mitka: parallel branches example (100+ reactions)
Handling sets of sequential steps in parallel would be done with composite actions which could be run in parallel
With parallel: block:
#
# Composite action 1
#
name: 'First Set Steps'
description: 'Handle first set of steps'
runs:
using: "composite"
steps:
- run: echo "step 1"
shell: bash
- run: echo "step 2"
shell: bash#
# Composite action 2
#
name: 'Second Set Steps'
description: 'Handle second set of steps'
runs:
using: "composite"
steps:
- run: echo "step A"
shell: bash
- run: echo "step B"
shell: bash#
# Workflow.yml
#
...
steps:
- uses: actions/checkout@v3
- run: echo "Sequential step"
- parallel:
- uses: octo-org/octo-repo/composite-step-1@v1
- uses: octo-org/octo-repo/composite-step-2@v1
- run: echo "More sequential steps after the whole parallel part is done."
Equivalent with background:
#
# Workflow.yml
#
...
steps:
- uses: actions/checkout@v3
- run: echo "Sequential step"
# Parallel steps
- uses: ocot-org/octo-repo/composite-step-1@v1
background: true
- uses: ocot-org/octo-repo/composite-step-2@v1
background: true
- wait-all:
- run: echo "More sequential steps after the whole parallel part is done."Parallel Uploads During Build
From @Skyppid: "While creating the image takes significant time we also need to upload our symbols to Sentry for better error analysis. While docker images are being created we could parallelize the upload to Sentry. A new job is no option as we lose the symbol files we require. Right now we run a separate job which fetches git, compiles, etc. all just to upload already built symbols."
steps:
- run: npm run build
- name: Upload source maps to Sentry
run: sentry-cli sourcemaps upload ./dist
background: true # Fire-and-forget
- run: docker build -t myimage . # Continues immediately
- run: docker push myimageKey Behaviors
| Aspect | Behavior |
|---|---|
| Logging | Each background step gets its own log stream in the UI |
| Timeouts | timeout-minutes works normally on background steps |
| Outputs | $GITHUB_OUTPUT from background steps available after wait |
| Failure | By default, background step failure fails the job (at the implicit wait point) |
| Job end | Implicit wait-all before post hooks run |
| Concurrency | Up to 10 concurrent background steps per job |
Below is a mockup of what the UI might look like for a job with background steps:

We think our initial propsal would resolve most of the use cases highlighted in the discussion but we want your feedback. What concerns do you have? What did we miss or get wrong? Are there scenarios you are concerned about?
The GitHub Actions Team
Beta Was this translation helpful? Give feedback.
-
|
This is an excellent proposal! The approach of introducing A few thoughts on the design:
The examples provided really help illustrate the use cases this would solve. Looking forward to seeing this feature ship before mid-2026! |
Beta Was this translation helpful? Give feedback.
-
|
This looks great, I would add a (more niche) use case: having a background step that can wait for another step without blocking the "main thread" of foreground steps. steps:
- name: Starts A in background
id: a
run: ...
background: true
- name: Does not wait for A
id: b
run: ...
background: true
- name: Waits for A but not B
run: |
wait-step a
...
background: true
- name: Wait for A and B but no C
run: |
wait-step a b
... |
Beta Was this translation helpful? Give feedback.
-
|
What I really miss in the parallel step design is to have the matrix strategy on step level like this (I create sometimes ca. 30 matrix jobs that run only < 30s) - run: echo Process the following in parallel / generate the matrix in this step dynamically
- strategy:
max-parallel: 2
matrix:
artifacts:
- name: pkg1
path: pkg1/out
- name: pkg2
path: pkg2/out
steps:
# Here you could also add the build command to run sequentially before the upload artifact
# upload-artifact usually only uploads all files into a single artifacts this is bad if you want to download only a single package
- uses: actions/upload-artifacts@v6
with:
name: ${{ stepMatrix.artifacts.name }}
path: ${{ stepMatrix.artifacts.path }}Yes I can do this example with javascript and the @actions/artifact package, but then I need much more code (On the other hand the runner needs more code for this) In my opinion Parallel Syntactic Sugar weakness is that the count of parallel steps is constant, with a matrix strategy you can adjust the called actions count and parallelism depending on the reusable workflow input parameters. Just like in job.strategy. |
Beta Was this translation helpful? Give feedback.
-
|
+1 |
Beta Was this translation helpful? Give feedback.

Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
Can you please raise a request to engineering for parallel steps support?
Eg. for logging in to multiple docker registries in parallel, or other actions which cannot be done in separate jobs because you require the local cache / side effects.
Uploading/downloading artifacts from adjacent jobs is not suitable for this use case.
Thanks
Hari
Beta Was this translation helpful? Give feedback.
All reactions