1
0
mirror of https://github.com/go-task/task.git synced 2025-06-23 00:38:19 +02:00

feat: loop over a matrix (#1767)

This commit is contained in:
Pete Davison
2024-09-02 20:29:00 +01:00
committed by GitHub
parent 1cb5daf73e
commit 281d259e6e
7 changed files with 145 additions and 18 deletions

View File

@ -7,6 +7,14 @@ tasks:
- for: ["a", "b", "c"]
cmd: echo "{{.ITEM}}"
loop-matrix:
cmds:
- for:
matrix:
OS: ["windows", "linux", "darwin"]
ARCH: ["amd64", "arm64"]
cmd: echo "{{.ITEM.OS}}/{{.ITEM.ARCH}}"
# Loop over the task's sources
loop-sources:
sources:

View File

@ -9,6 +9,16 @@ tasks:
vars:
TEXT: "{{.ITEM}}"
loop-matrix:
deps:
- for:
matrix:
OS: ["windows", "linux", "darwin"]
ARCH: ["amd64", "arm64"]
task: echo
vars:
TEXT: "{{.ITEM.OS}}/{{.ITEM.ARCH}}"
# Loop over the task's sources
loop-sources:
sources: