Gitlab CI : templates / inputs for managing a parallel matrix

:hugs: Please help fill in this template with all the details to help others help you more efficiently. Use formatting blocks for code, config, logs and ensure to remove sensitive data.

Problem to solve

Use a parallel matrix based on inputs in a CI/CD template (component)

I tried different types values and different “injections” but without success :

# .gitlab/mytemplate.yml
spec:
  inputs:
    archs:
      default: "[amd64,arm64]"
    targets:
      default: "amd64,arm64" # alternate syntax test value
---
# .gitlab/mytemplate.yml
spec:
  inputs:
    archs:
      default: "[amd64,arm64]"
    targets:
      default: "amd64,arm64" # alternate syntax test value
---
job1:
  script:
    - echo "$ARCH"
  parallel:
    matrix:
      - ARCH: $[[ inputs.archs ]]
      # - ARCH: "$[[ inputs.archs ]]"
      # - ARCH: ["$[[ inputs.archs ]]"]
      # - ARCH: [ $[[ inputs.archs ]] ] # cant be parsed

job2:
  script:
    - echo "$TARGET"
  parallel:
    matrix:
      # - TARGET: $[[ inputs.targets ]]
      # - TARGET: "$[[ inputs.targets ]]"
      - TARGET: ["$[[ inputs.targets ]]"]
      # - TARGET: [ $[[ inputs.targets ]] ] # cant be parsed
# .gitlab-ci.yml
include:
  - local: '.gitlab/mytemplate.yml'

As long as inputs do not support the array type, I am not sure it may work.
Any help ?

Versions

Please select whether options apply, and add the version information.

  • Self-managed
  • GitLab.com SaaS
  • Self-hosted Runners