@@ -16,31 +16,21 @@ concurrency:
1616 cancel-in-progress : ${{ github.ref != 'main' }}
1717
1818jobs :
19- test-jest :
20- name : Jest Tests
19+ test-vitest :
20+ name : Vitest Tests
2121 runs-on : ubuntu-latest
2222
2323 steps :
24- - name : Checkout
25- uses : actions/checkout@v6
26-
27- - name : Setup Node.js
28- uses : actions/setup-node@v6
24+ - uses : actions/checkout@v6
25+ - uses : actions/setup-node@v6
2926 with :
3027 node-version-file : .node-version
3128 cache : npm
3229
33- - name : Install Dependencies
34- run : npm ci
35-
36- - name : Check Format
37- run : npm run format:check
38-
39- - name : Lint
40- run : npm run lint
41-
42- - name : Test
43- run : npm run ci-test
30+ - run : npm ci
31+ - run : npm run format:check
32+ - run : npm run lint
33+ - run : npm test
4434
4535 test-action-basic :
4636 name : GitHub Actions Test (Basic)
5141 BRANCH : test-action-basic
5242
5343 steps :
54- - name : Checkout
55- uses : actions/checkout@v6
44+ - uses : actions/checkout@v6
5645
5746 - name : Test Action
5847 id : test-action
@@ -68,16 +57,10 @@ jobs:
6857 run : echo "${{ steps.test-action.outputs.commit-sha }}"
6958
7059 - name : Clean up test action environment
71- shell : bash
7260 if : always()
73- run : |
74- test_branch=$(git ls-remote --heads origin refs/heads/$BRANCH)
75- if [[ -n $test_branch ]]; then
76- echo "test branch $BRANCH existed"
77- git push -d origin refs/heads/$BRANCH
78- else
79- echo "test branch $BRANCH does not exist"
80- fi
61+ uses : ./.github/actions/cleanup
62+ with :
63+ branch : ${{ env.BRANCH }}
8164
8265 test-action-branch :
8366 name : GitHub Actions Test (Custom Branch)
8972 BRANCH : test-action-branch
9073
9174 steps :
92- - name : Checkout
93- uses : actions/checkout@v6
75+ - uses : actions/checkout@v6
9476
9577 - name : generate dummy content
9678 shell : bash
@@ -113,16 +95,10 @@ jobs:
11395 run : echo "${{ steps.test-action.outputs.commit-sha }}"
11496
11597 - name : Clean up test action environment
116- shell : bash
11798 if : always()
118- run : |
119- test_branch=$(git ls-remote --heads origin refs/heads/$BRANCH)
120- if [[ -n $test_branch ]]; then
121- echo "test branch $BRANCH existed"
122- git push -d origin refs/heads/$BRANCH
123- else
124- echo "test branch $BRANCH does not exist"
125- fi
99+ uses : ./.github/actions/cleanup
100+ with :
101+ branch : ${{ env.BRANCH }}
126102
127103 test-action-workspace :
128104 name : GitHub Actions Test (Workspace)
@@ -134,8 +110,7 @@ jobs:
134110 BRANCH : test-action-workspace
135111
136112 steps :
137- - name : Checkout
138- uses : actions/checkout@v6
113+ - uses : actions/checkout@v6
139114
140115 - name : generate dummy content
141116 shell : bash
@@ -159,16 +134,10 @@ jobs:
159134 run : echo "${{ steps.test-action.outputs.commit-sha }}"
160135
161136 - name : Clean up test action environment
162- shell : bash
163137 if : always()
164- run : |
165- test_branch=$(git ls-remote --heads origin refs/heads/$BRANCH)
166- if [[ -n $test_branch ]]; then
167- echo "test branch $BRANCH existed"
168- git push -d origin refs/heads/$BRANCH
169- else
170- echo "test branch $BRANCH does not exist"
171- fi
138+ uses : ./.github/actions/cleanup
139+ with :
140+ branch : ${{ env.BRANCH }}
172141
173142 test-action-glob :
174143 name : GitHub Actions Test (Glob)
@@ -180,8 +149,7 @@ jobs:
180149 BRANCH : test-action-glob
181150
182151 steps :
183- - name : Checkout
184- uses : actions/checkout@v6
152+ - uses : actions/checkout@v6
185153
186154 - name : generate dummy content
187155 shell : bash
@@ -204,16 +172,10 @@ jobs:
204172 run : echo "${{ steps.test-action.outputs.commit-sha }}"
205173
206174 - name : Clean up test action environment
207- shell : bash
208175 if : always()
209- run : |
210- test_branch=$(git ls-remote --heads origin refs/heads/$BRANCH)
211- if [[ -n $test_branch ]]; then
212- echo "test branch $BRANCH existed"
213- git push -d origin refs/heads/$BRANCH
214- else
215- echo "test branch $BRANCH does not exist"
216- fi
176+ uses : ./.github/actions/cleanup
177+ with :
178+ branch : ${{ env.BRANCH }}
217179
218180 test-action-tag :
219181 name : GitHub Actions Test (Tag)
@@ -226,8 +188,7 @@ jobs:
226188 BRANCH : test-action-tag
227189
228190 steps :
229- - name : Checkout
230- uses : actions/checkout@v6
191+ - uses : actions/checkout@v6
231192
232193 - name : Test Action
233194 id : test-action
@@ -244,23 +205,11 @@ jobs:
244205 echo "[tag] ${{ steps.test-action.outputs.tag }}"
245206
246207 - name : Clean up test action environment
247- shell : bash
248208 if : always()
249- run : |
250- test_branch=$(git ls-remote --heads origin refs/heads/$BRANCH)
251- if [[ -n $test_branch ]]; then
252- echo "test branch $BRANCH existed"
253- git push -d origin refs/heads/$BRANCH
254- else
255- echo "test branch $BRANCH does not exist"
256- fi
257- test_tag=$(git ls-remote --tags origin refs/tags/$TAG)
258- if [[ -n $test_tag ]]; then
259- echo "test tag $TAG existed"
260- git push -d origin refs/tags/$TAG
261- else
262- echo "test tag $TAG does not exist"
263- fi
209+ uses : ./.github/actions/cleanup
210+ with :
211+ branch : ${{ env.BRANCH }}
212+ tag : ${{ env.TAG }}
264213
265214 test-action-file-tag :
266215 name : GitHub Actions Test (File & Tag)
@@ -273,9 +222,7 @@ jobs:
273222 TAG : 4.5.6
274223
275224 steps :
276- - name : Checkout
277- id : checkout
278- uses : actions/checkout@v6
225+ - uses : actions/checkout@v6
279226
280227 - name : generate dummy content
281228 shell : bash
@@ -301,23 +248,11 @@ jobs:
301248 echo "[tag] ${{ steps.test-action.outputs.tag }}"
302249
303250 - name : Clean up test action environment
304- shell : bash
305251 if : always()
306- run : |
307- test_branch=$(git ls-remote --heads origin refs/heads/$BRANCH)
308- if [[ -n $test_branch ]]; then
309- echo "test branch $BRANCH existed"
310- git push -d origin refs/heads/$BRANCH
311- else
312- echo "test branch $BRANCH does not exist"
313- fi
314- test_tag=$(git ls-remote --tags origin refs/tags/$TAG)
315- if [[ -n $test_tag ]]; then
316- echo "test tag $TAG existed"
317- git push -d origin refs/tags/$TAG
318- else
319- echo "test tag $TAG does not exist"
320- fi
252+ uses : ./.github/actions/cleanup
253+ with :
254+ branch : ${{ env.BRANCH }}
255+ tag : ${{ env.TAG }}
321256
322257 test-action-no-file-changes-tag :
323258 name : GitHub Actions Test (No File Changes & Tag)
@@ -330,8 +265,7 @@ jobs:
330265 TAG : 7.8.9
331266
332267 steps :
333- - name : Checkout
334- uses : actions/checkout@v6
268+ - uses : actions/checkout@v6
335269
336270 - name : Test Action
337271 id : test-action
@@ -350,20 +284,8 @@ jobs:
350284 echo "[tag] ${{ steps.test-action.outputs.tag }}"
351285
352286 - name : Clean up test action environment
353- shell : bash
354287 if : always()
355- run : |
356- test_branch=$(git ls-remote --heads origin refs/heads/$BRANCH)
357- if [[ -n $test_branch ]]; then
358- echo "test branch $BRANCH existed"
359- git push -d origin refs/heads/$BRANCH
360- else
361- echo "test branch $BRANCH does not exist"
362- fi
363- test_tag=$(git ls-remote --tags origin refs/tags/$TAG)
364- if [[ -n $test_tag ]]; then
365- echo "test tag $TAG existed"
366- git push -d origin refs/tags/$TAG
367- else
368- echo "test tag $TAG does not exist"
369- fi
288+ uses : ./.github/actions/cleanup
289+ with :
290+ branch : ${{ env.BRANCH }}
291+ tag : ${{ env.TAG }}
0 commit comments