rakles / matrix-lock

a GitHub Action that allows for sequential execution of matrix runners by utilizing the artifact system to share a lock
MIT License
3 stars 1 forks source link

Does it allow to run things in paralell? #1

Open fjtrujy opened 3 weeks ago

fjtrujy commented 3 weeks ago

Let me explain properly, imagine we have the next matrix

jobs:
  my_matrix_job:
    strategy:
      matrix:
        include:
          - id: libogg
            name: "libogg"
          - id: theora
            name: "theora"
          - id: tremor
            name: "tremor"

These 3 things, are libraries libogg, theora and tremor the interesting thing here, is that theora and tremor they both require libogg to be finished first. So the wished scenario should be something as:

  1. Execute libogg job
  2. Execute in parallel theora and tremor jobs.

Is your action allowing such kinds of things?

Cheers

rakles commented 3 weeks ago

Hi,

Unfortunately, it is not possible to do that, as the action was designed to run matrix jobs sequential in a specific order.

But it would be possible with a second job and the "needs" statement.

As an example:

jobs:
  buildLibogg:
    # Steps to build your libogg library here

  matrix_job:
    needs: [buildLibogg]
    strategy:
      matrix:
        include:
          - id: theora
            name: "theora"
          - id: tremor
            name: "tremor"
    # Steps to build your libraries that depend on libogg here

In this configuration, the "matrix_job" will wait until "buildLibogg" has finished building. Once buildLibogg completes, the matrix jobs for "theora" and "tremor" will run in parallel.

I hope this helps! If you have any further questions or need additional assistance, please feel free to ask.

fjtrujy commented 3 weeks ago

That solution is not valid for me at it must be dynamic, I can’t really know the whole dependency tree, as it is huge and several levels of dependencies… Thanks