-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (77 loc) · 2.21 KB
/
test.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: Matrix Test
on:
push:
jobs:
build-matrix:
runs-on: windows-latest
defaults:
run:
shell: powershell
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Matrix
id: create-matrix
run: |
$params = Get-Content -Path ./params.txt
$aliases = "["
$persons = $params.split("|")
foreach ($person in $persons)
{
$attributes = $person.split(",")
foreach ($attribute in $attributes)
{
# Split the key from the value
$keyAndValue = $attribute.split("=")
$key = $keyAndValue[0]
$value = $keyAndValue[1]
if($key.ToLower() -eq "alias")
{
echo "Testing the following person: $value"
$aliases += '"'
$aliases += $value.Trim()
$aliases += '",'
}
}
}
$aliases = $aliases.Substring(0, $aliases.Length-1)
$aliases += "]"
echo $aliases
echo aliases=$aliases >> $env:GITHUB_OUTPUT
outputs:
aliases: ${{ steps.create-matrix.outputs.aliases }}
build-matrix-matrix:
runs-on: windows-latest
defaults:
run:
shell: powershell
needs:
- build-matrix
strategy:
fail-fast: false
matrix:
product: ${{ fromJson(needs.build-matrix.outputs.aliases) }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Matrix
id: create-matrix-matrix
run: |
$params = Get-Content -Path ./params.txt
$persons = $params.split("|")
foreach ($person in $persons)
{
$attributes = $person.split(",")
foreach ($attribute in $attributes)
{
# Split the key from the value
$keyAndValue = $attribute.split("=")
$key = $keyAndValue[0]
$value = $keyAndValue[1]
if($value.ToLower() -eq "${{ matrix.product }}")
{
echo "Testing the following person: $value"
echo "Person is: $person"
}
}
}