9
9
10
10
workflow_dispatch :
11
11
12
- jobs :
13
- # ======== calculate changes ========
14
- changes :
15
- runs-on : ubuntu-latest
16
- outputs :
17
- changed : ${{ steps.changes.outputs.changed }}
18
- strategy :
19
- matrix :
20
- node-version : [18]
21
-
22
- steps :
23
- - name : Checkout
24
- uses : actions/checkout@v4
25
- with :
26
- fetch-depth : 10
27
-
28
- - name : Install pnpm
29
- run : |
30
- npm install -g corepack@latest --force
31
- corepack enable
32
-
33
-
34
- id : changes
35
- with :
36
- predicate-quantifier : ' every'
37
- filters : |
38
- changed:
39
- - "!**/*.md"
40
- - "!**/*.mdx"
41
- - "!**/_meta.json"
42
- - "!**/dictionary.txt"
12
+ permissions :
13
+ contents : read
43
14
15
+ jobs :
44
16
# ======== ut ========
45
17
ut :
46
18
runs-on : ${{ matrix.os }}
47
- needs : changes
48
- if : ${{ needs.changes.outputs.changed == 'true' }}
49
19
strategy :
50
20
matrix :
51
21
os : [ubuntu-latest]
58
28
- name : Checkout
59
29
uses : actions/checkout@v4
60
30
with :
61
- fetch-depth : 10
31
+ fetch-depth : 1
62
32
63
33
- name : Git config
64
34
if : ${{ matrix.os == 'windows-latest' }}
@@ -71,26 +41,39 @@ jobs:
71
41
npm install -g corepack@latest --force
72
42
corepack enable
73
43
44
+ - uses : dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
45
+ id : changes
46
+ with :
47
+ predicate-quantifier : ' every'
48
+ filters : |
49
+ changed:
50
+ - "!**/*.md"
51
+ - "!**/*.mdx"
52
+ - "!**/_meta.json"
53
+ - "!**/dictionary.txt"
54
+
74
55
- name : Setup Node.js ${{ matrix.node-version }}
56
+ if : steps.changes.outputs.changed == 'true'
75
57
uses : actions/setup-node@v4
76
58
with :
77
59
node-version : ${{ matrix.node-version }}
78
60
cache : ' pnpm'
79
61
80
62
- name : Install Dependencies
63
+ if : steps.changes.outputs.changed == 'true'
81
64
run : pnpm install
82
65
83
66
- name : Type Check
67
+ if : steps.changes.outputs.changed == 'true'
84
68
run : pnpm run type-check
85
69
86
70
- name : Unit Test
71
+ if : steps.changes.outputs.changed == 'true'
87
72
run : pnpm run test:unit
88
73
89
74
# ======== integration && e2e ========
90
75
integration-e2e :
91
76
runs-on : ${{ matrix.os }}
92
- needs : changes
93
- if : ${{ needs.changes.outputs.changed == 'true' }}
94
77
strategy :
95
78
matrix :
96
79
os : [ubuntu-latest]
@@ -100,42 +83,48 @@ jobs:
100
83
os : windows-latest
101
84
102
85
steps :
86
+ - name : Checkout
87
+ uses : actions/checkout@v4
88
+ with :
89
+ fetch-depth : 1
90
+
103
91
- name : Git config
104
92
if : ${{ matrix.os == 'windows-latest' }}
105
93
shell : bash
106
94
run : |
107
95
git config --system core.longpaths true
108
96
109
- - name : Checkout
110
- uses : actions/checkout@v4
111
- with :
112
- fetch-depth : 10
113
-
114
97
- name : Install pnpm
115
98
run : |
116
99
npm install -g corepack@latest --force
117
100
corepack enable
118
101
102
+ - uses : dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
103
+ id : changes
104
+ with :
105
+ predicate-quantifier : ' every'
106
+ filters : |
107
+ changed:
108
+ - "!**/*.md"
109
+ - "!**/*.mdx"
110
+ - "!**/_meta.json"
111
+ - "!**/dictionary.txt"
112
+
119
113
- name : Setup Node.js ${{ matrix.node-version }}
114
+ if : steps.changes.outputs.changed == 'true'
120
115
uses : actions/setup-node@v4
121
116
with :
122
117
node-version : ${{ matrix.node-version }}
123
118
cache : ' pnpm'
124
119
125
120
- name : Install Dependencies
121
+ if : steps.changes.outputs.changed == 'true'
126
122
run : pnpm install && cd ./tests && pnpm playwright install chromium
127
123
128
124
- name : Integration Test (Vitest)
125
+ if : steps.changes.outputs.changed == 'true'
129
126
run : pnpm run test:integration
130
127
131
128
- name : E2E Test (Playwright)
129
+ if : steps.changes.outputs.changed == 'true'
132
130
run : pnpm run test:e2e
133
-
134
- # ======== exit ========
135
- pr-check-required :
136
- if : (!cancelled() && !failure())
137
- needs : [ut, integration-e2e]
138
- runs-on : ubuntu-latest
139
- name : Test passed or skipped
140
- steps :
141
- - run : echo "All tests passed or skipped."
0 commit comments