Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GitHub Action workflow for running steps in parallel

I am working on a project. I need to create a workflow to run integration tests on an iOS device.

Scenario: I've to run a local server at some port and in parallel I've run integration tests.

Query:

  1. Can I achieve this in Github Actions?
  2. If yes then how?

I'll be thankful for the help.

like image 729
Dipendra Sharma Avatar asked Nov 23 '25 05:11

Dipendra Sharma


2 Answers

There's no built in solution for parallel steps at the moment.

Workarounds:

  • Run your server in the background (server &). Or as a daemon if it has it built in.
  • If it's a container you can use jobs.<job_id>.services
    • https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idservices

If you would like to have this feature you can try voting on this feedback thing: https://github.com/github-community/community/discussions/14484

like image 102
lukee Avatar answered Nov 25 '25 20:11

lukee


Just found an Github action to achieve run steps in parallel. You just configure steps as usual but the will run in parallel.

jobs:
  run:
    runs-on: ubuntu-latest
    steps:
      - uses: qoomon/actions--parallel-steps@v1
        id: parallel-steps
        with:
          steps: |
            - run: actions/checkout@v4
            - run: echo Step1
            - uses: actions/github-script@v7
              id: greetings
              with:
                script: |
                  const recipient = 'world'
                  console.log(`Hello ${recipient}!`)
                  core.setOutput('recipient', recipient)

      # access parallel steps outputs            
      - run: echo Hello $RECIPIENT
        env:
          RECIPIENT: ${{ steps.parallel-steps.outputs.greetings-recipient }}

https://github.com/qoomon/actions--parallel-steps

like image 22
Void Avatar answered Nov 25 '25 20:11

Void



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!