defenseunicorns / maru-runner

The Unicorn Task Runner
Apache License 2.0
8 stars 0 forks source link

UDS Runner Looping/Matrix functionality on tasks. #82

Open zachariahmiller opened 8 months ago

zachariahmiller commented 8 months ago

Is your feature request related to a problem? Please describe

When building out a task in uds runner, often there could be a need to repeat a set of tasks based on certain criteria, for example package versions, platform or architecture. To facilitate this, the UDS task runner should support some sort of looping or matrix functionality.

Describe the solution you'd like

- and have the same end result executed as in the former example, except based on the vars provided in `matrix` the tasks should execute in parallel 

### Describe alternatives you've considered

We could keep duplicating code and running tasks that could be parallelized, serially.

Additionally, this example should be more than just the flat example i provided above, although this might be fine for an MVP. The functionality should support multiple inputs for example:

```yaml
tasks:
  - name: packages
    matrix:
      ARCH: [amd64, arm64]
      PLATFORM:
        - Darwin
        - Linux
        - Windows
    actions:
      - description: "Create the UDS Core Standard Zarf Package"
        cmd: echo "pretend example task"
        ....

This should run six parallel jobs with the possible combinations of ARCH and PLATFORM provided underneath the matrix key

Additional context

Examples of similar functionality in other technologies: gitlab matrix jobs github matrix jobs taskfile loops

jeff-mccoy commented 8 months ago

If we do this right it will be AMAZING