Debian Codegraph @

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

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