-
Notifications
You must be signed in to change notification settings - Fork 18
180 lines (144 loc) · 4.54 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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
name: test
on:
push:
branches: ["master"]
pull_request:
branches: ["master"]
workflow_dispatch:
jobs:
directory:
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v4
- name: Test on affected directory
uses: ./
with:
directory: "tests/directory/affected"
- name: Assert not affected result does not exist
run: |
! test -e tests/directory/not-affected/main.min.js
- name: Assert affected result matches expected
run: |
git diff --exit-code --no-index \
tests/directory/affected/main.expected.js \
tests/directory/affected/main.min.js
maxdepth:
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v4
- name: Test on shallow maxdepth
uses: ./
with:
directory: "tests/maxdepth"
maxdepth: 1
- name: Assert shallow result matches expected
run: |
git diff --exit-code --no-index \
tests/maxdepth/main.expected.js \
tests/maxdepth/main.min.js
- name: Assert deep result does not exist
run: |
! test -e tests/maxdepth/not-affected/main.min.js
overwrite:
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v4
- name: Test overwrite
uses: ./
with:
directory: "tests/overwrite"
overwrite: true
- name: Assert overwrite result matches expected
run: |
git diff --exit-code --no-index \
tests/overwrite/main.expected.js \
tests/overwrite/main.js
output:
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v4
- name: Test output
uses: ./
with:
directory: "tests/output"
output: "tests/output/prod/js"
- name: Assert output directory is created
run: |
test -d tests/output/prod/js
- name: Assert output result matches expected
run: |
git diff --exit-code --no-index \
tests/output/main.expected.js \
tests/output/prod/js/main.min.js
js_engine_babel:
name: "js_engine / babel"
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v4
- name: Test js_engine babel
uses: ./
with:
directory: "tests/js_engine"
output: "tests/js_engine/babel"
js_engine: "babel"
- name: Assert js_engine babel result matches expected
run: |
git diff --exit-code --no-index \
tests/js_engine/babel/main.expected.js \
tests/js_engine/babel/main.min.js
js_engine_uglify_js:
name: "js_engine / uglify-js"
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v4
- name: Test js_engine uglify-js
uses: ./
with:
directory: "tests/js_engine"
output: "tests/js_engine/uglify-js"
js_engine: "uglify-js"
- name: Assert js_engine uglify-js result matches expected
run: |
git diff --exit-code --no-index \
tests/js_engine/uglify-js/main.expected.js \
tests/js_engine/uglify-js/main.min.js
css_engine_lightning:
name: "css_engine / lightning"
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v4
- name: Test css_engine lightning
uses: ./
with:
directory: "tests/css_engine"
output: "tests/css_engine/lightning"
css_engine: "lightning"
- name: Assert css_engine lightning result matches expected
run: |
git diff --exit-code --no-index \
tests/css_engine/lightning/main.expected.css \
tests/css_engine/lightning/main.min.css
css_engine_clean_css:
name: "css_engine / clean-css"
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v4
- name: Test css_engine clean-css
uses: ./
with:
directory: "tests/css_engine"
output: "tests/css_engine/clean-css"
css_engine: "clean-css"
- name: Assert css_engine clean-css result matches expected
run: |
git diff --exit-code --no-index \
tests/css_engine/clean-css/main.expected.css \
tests/css_engine/clean-css/main.min.css