-
Notifications
You must be signed in to change notification settings - Fork 0
96 lines (87 loc) · 2.53 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
on:
push:
paths:
- '.github/workflows/test.yaml'
- 'dist/main.js'
- 'fixtures/**'
jobs:
main:
runs-on: ubuntu-latest
outputs:
matches: ${{ steps.for-each.outputs.matches }}
steps:
- uses: actions/checkout@v4
- name: Run colpal/actions-for-each
id: for-each-1
uses: ./
with:
patterns: 'fixtures/*'
- if: steps.for-each-1.outputs.matches != '["fixtures/function-a/","fixtures/function-b/","fixtures/function-c/","fixtures/run-a/","fixtures/run-b/"]'
run: exit 1
- name: Run colpal/actions-for-each
id: for-each-2
uses: ./
with:
patterns: |
fixtures/*
!fixtures/*-b
- if: steps.for-each-2.outputs.matches != '["fixtures/function-a/","fixtures/function-c/","fixtures/run-a/"]'
run: exit 1
- name: Run colpal/actions-for-each
id: for-each-3
uses: ./
with:
patterns: |
fixtures/**/file.txt
!fixtures/function-*/**
- if: steps.for-each-3.outputs.matches != '["fixtures/run-a/file.txt","fixtures/run-b/file.txt"]'
run: exit 1
- name: Run colpal/actions-for-each
id: for-each-4
uses: ./
with:
root-patterns: '*/'
filter-patterns: '**/main.*'
- if: steps.for-each-4.outputs.matches != '["dist/"]'
run: exit 1
- name: Run colpal/actions-for-each
id: for-each-5
uses: ./
with:
root-patterns: |
./
**/
filter-patterns: '**/main.*'
- if: steps.for-each-5.outputs.matches != '["./","dist/"]'
run: exit 1
- name: Run colpal/actions-for-each
id: for-each-6
uses: ./
with:
root-patterns: |
**/*-b/
filter-patterns: '**/file.txt'
- if: steps.for-each-6.outputs.matches != '["fixtures/function-b/","fixtures/run-b/"]'
run: exit 1
- name: Run colpal/actions-for-each
id: for-each
uses: ./
with:
patterns: 'fixtures/run-*'
parallel:
needs: main
runs-on: ubuntu-latest
strategy:
matrix:
path: ${{ fromJSON(needs.main.outputs.matches) }}
include:
- path: fixtures/run-a/
value: 4
- path: fixtures/run-b/
value: 5
steps:
- uses: actions/checkout@v4
- run: test "$VALUE" = "$(cat $FILE)"
env:
VALUE: ${{ matrix.value }}
FILE: ${{ matrix.path }}file.txt