-
Notifications
You must be signed in to change notification settings - Fork 2
119 lines (110 loc) · 3.32 KB
/
test.yml
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
---
name: test
on:
push:
branches:
- master
pull_request:
jobs:
unit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: yarn install
- run: yarn run lint
- run: yarn test
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ./
id: object
with:
output_properties: 'true'
patterns: |
- test/assets/conf1.yml
- test/assets/a/**/conf1.yml
- test/assets/b/**/conf1.yml
- run: echo '${{ steps.object.outputs.result }}'
- if: ${{ steps.object.outputs.result != '{"test":"b1"}' }}
run: 'false'
- if: ${{ steps.object.outputs.test != 'b1' }}
run: 'false'
- uses: ./
id: array
with:
patterns: |
- test/assets/**/conf2.yml
- run: echo '${{ steps.array.outputs.result }}'
- if: ${{ steps.array.outputs.result != '["root2","a2","b2","c2"]' }}
run: 'false'
- uses: ./
id: plain
with:
patterns: test/assets/**/file.txt
- run: echo '${{ steps.plain.outputs.result }}'
- if: ${{ toJSON(steps.plain.outputs.result) != '"root\ntestA\ntestB\n"' }}
run: 'false'
- uses: ./
id: loop
with:
output_properties: 'true'
patterns: |
- test/assets/conf1.yml
- test/assets/{{ item }}/conf1.yml
loop: |
a
a/c
b
- run: echo '${{ steps.loop.outputs.result }}'
- if: ${{ steps.loop.outputs.result != '{"a":{"test":"a1"},"a/c":{"test":"c1"},"b":{"test":"b1"}}' }}
run: 'false'
- if: ${{ steps.loop.outputs.a != '{"test":"a1"}' }}
run: 'false'
- if: ${{ steps.loop.outputs.a_c != '{"test":"c1"}' }}
run: 'false'
- if: ${{ steps.loop.outputs.b != '{"test":"b1"}' }}
run: 'false'
- uses: ./
id: loop-json
with:
output_properties: 'true'
patterns: |
- test/assets/conf1.yml
- test/assets/{{ item }}/conf1.yml
loop: '["a","a/c","b"]'
loop_items_format: json
- run: echo '${{ steps.loop-json.outputs.result }}'
- if: ${{ steps.loop-json.outputs.result != '{"a":{"test":"a1"},"a/c":{"test":"c1"},"b":{"test":"b1"}}' }}
run: 'false'
- if: ${{ steps.loop-json.outputs.a != '{"test":"a1"}' }}
run: 'false'
- if: ${{ steps.loop-json.outputs.a_c != '{"test":"c1"}' }}
run: 'false'
- if: ${{ steps.loop-json.outputs.b != '{"test":"b1"}' }}
run: 'false'
- uses: ./
id: loop-deep-yaml
with:
output_properties: 'true'
patterns: |
- test/assets/{{ item.name }}.yml
- test/assets/{{ item.path }}/{{ item.name }}.yml
loop: |
- path: a
name: conf1
- path: a/c
name: conf1
- path: b
name: conf1
loop_items_format: yaml
loop_items_key: path
- run: echo '${{ steps.loop-deep-yaml.outputs.result }}'
- if: ${{ steps.loop-deep-yaml.outputs.result != '{"a":{"test":"a1"},"a/c":{"test":"c1"},"b":{"test":"b1"}}' }}
run: 'false'
- if: ${{ steps.loop-deep-yaml.outputs.a != '{"test":"a1"}' }}
run: 'false'
- if: ${{ steps.loop-deep-yaml.outputs.a_c != '{"test":"c1"}' }}
run: 'false'
- if: ${{ steps.loop-deep-yaml.outputs.b != '{"test":"b1"}' }}
run: 'false'