Debian Codegraph @

ansible_collections/community/postgresql/.azure-pipelines/templates/matrix.yml

raw
1 # This template uses the provided targets and optional groups to generate a matrix which is then passed to the test template.
2 # If this matrix template does not provide the required functionality, consider using the test template directly instead.
3
4 parameters:
5 # A required list of dictionaries, one per test target.
6 # Each item in the list must contain a "test" or "name" key.
7 # Both may be provided. If one is omitted, the other will be used.
8 - name: targets
9 type: object
10
11 # An optional list of values which will be used to multiply the targets list into a matrix.
12 # Values can be strings or numbers.
13 - name: groups
14 type: object
15 default: []
16
17 # An optional format string used to generate the job name.
18 # - {0} is the name of an item in the targets list.
19 - name: nameFormat
20 type: string
21 default: "{0}"
22
23 # An optional format string used to generate the test name.
24 # - {0} is the name of an item in the targets list.
25 - name: testFormat
26 type: string
27 default: "{0}"
28
29 # An optional format string used to add the group to the job name.
30 # {0} is the formatted name of an item in the targets list.
31 # {{1}} is the group -- be sure to include the double "{{" and "}}".
32 - name: nameGroupFormat
33 type: string
34 default: "{0} - {{1}}"
35
36 # An optional format string used to add the group to the test name.
37 # {0} is the formatted test of an item in the targets list.
38 # {{1}} is the group -- be sure to include the double "{{" and "}}".
39 - name: testGroupFormat
40 type: string
41 default: "{0}/{{1}}"
42
43 jobs:
44 - template: test.yml
45 parameters:
46 jobs:
47 - ${{ if eq(length(parameters.groups), 0) }}:
48 - ${{ each target in parameters.targets }}:
49 - name: ${{ format(parameters.nameFormat, coalesce(target.name, target.test)) }}
50 test: ${{ format(parameters.testFormat, coalesce(target.test, target.name)) }}
51 - ${{ if not(eq(length(parameters.groups), 0)) }}:
52 - ${{ each group in parameters.groups }}:
53 - ${{ each target in parameters.targets }}:
54 - name: ${{ format(format(parameters.nameGroupFormat, parameters.nameFormat), coalesce(target.name, target.test), group) }}
55 test: ${{ format(format(parameters.testGroupFormat, parameters.testFormat), coalesce(target.test, target.name), group) }}