@@ -3,10 +3,10 @@ name: CI
3
3
on :
4
4
push :
5
5
branches :
6
- - v10
6
+ - v9
7
7
pull_request :
8
8
branches :
9
- - v10
9
+ - v9
10
10
permissions :
11
11
contents : read
12
12
env :
27
27
- name : Checkout codes
28
28
uses : actions/checkout@v4
29
29
30
- - name : Install pnpm
31
- uses : pnpm/action-setup@v4
30
+ - name : Enable corepack
31
+ run : corepack enable
32
32
33
33
- name : Setup node
34
34
uses : actions/setup-node@v4
55
55
- name : Checkout codes
56
56
uses : actions/checkout@v4
57
57
58
- - name : Install pnpm
59
- uses : pnpm/action-setup@v4
58
+ - name : Enable corepack
59
+ run : corepack enable
60
60
61
61
- name : Setup node
62
62
uses : actions/setup-node@v4
@@ -70,29 +70,29 @@ jobs:
70
70
- name : Build codes
71
71
run : |
72
72
pnpm build --all -t
73
- npx tsx ./ scripts/postprocess.ts
73
+ node -r esbuild-register scripts/postprocess.ts
74
74
75
75
- name : Cache dist
76
76
uses : actions/cache@v4
77
77
with :
78
78
path : packages/*/dist
79
- key : build-vue-i18n-os-${{ matrix.os }}-${{ github.sha }}
79
+ key : build-vue-i18n-next- os-${{ matrix.os }}-${{ github.sha }}
80
80
81
81
test-unit :
82
82
name : Unit test
83
83
strategy :
84
84
matrix :
85
85
os : [ubuntu-latest, windows-latest, macos-latest]
86
- node : [18.19, 20, 22 ]
86
+ node : [18.19, 20]
87
87
88
88
runs-on : ${{ matrix.os }}
89
89
90
90
steps :
91
91
- name : Checkout codes
92
92
uses : actions/checkout@v4
93
93
94
- - name : Install pnpm
95
- uses : pnpm/action-setup@v4
94
+ - name : Enable corepack
95
+ run : corepack enable
96
96
97
97
- name : Setup node
98
98
uses : actions/setup-node@v4
@@ -107,6 +107,34 @@ jobs:
107
107
run : |
108
108
pnpm test:cover
109
109
110
+ test-type :
111
+ name : Type checking
112
+ strategy :
113
+ matrix :
114
+ os : [ubuntu-latest]
115
+ node : [18]
116
+
117
+ runs-on : ${{ matrix.os }}
118
+
119
+ steps :
120
+ - name : Checkout codes
121
+ uses : actions/checkout@v4
122
+
123
+ - name : Enable corepack
124
+ run : corepack enable
125
+
126
+ - name : Setup node
127
+ uses : actions/setup-node@v4
128
+ with :
129
+ node-version : ${{ matrix.node }}
130
+ cache : ' pnpm'
131
+
132
+ - name : Install dependencies
133
+ run : pnpm install --no-frozen-lockfile
134
+
135
+ - name : Run type checking
136
+ run : pnpm test:type
137
+
110
138
test-e2e :
111
139
name : E2E test
112
140
@@ -116,16 +144,16 @@ jobs:
116
144
strategy :
117
145
matrix :
118
146
os : [ubuntu-latest, windows-latest, macos-latest]
119
- node : [18.19, 20, 22 ]
147
+ node : [18.19, 20]
120
148
121
149
runs-on : ${{ matrix.os }}
122
150
123
151
steps :
124
152
- name : Checkout codes
125
153
uses : actions/checkout@v4
126
154
127
- - name : Install pnpm
128
- uses : pnpm/action-setup@v4
155
+ - name : Enable corepack
156
+ run : corepack enable
129
157
130
158
- name : Setup node
131
159
uses : actions/setup-node@v4
@@ -136,14 +164,86 @@ jobs:
136
164
- name : Install dependencies
137
165
run : pnpm install --no-frozen-lockfile
138
166
167
+ # https://github.com/vitejs/vite/blob/main/.github/workflows/ci.yml#L62
168
+ # Install playwright's binary under custom directory to cache
169
+ - name : Set Playwright path
170
+ if : runner.os != 'Windows'
171
+ run : echo "PLAYWRIGHT_BROWSERS_PATH=$HOME/.cache/playwright-bin" >> $GITHUB_ENV
172
+ - name : Set Playwright path (windows)
173
+ if : runner.os == 'Windows'
174
+ run : echo "PLAYWRIGHT_BROWSERS_PATH=$HOME\.cache\playwright-bin" >> $env:GITHUB_ENV
175
+
176
+ - name : Cache Playwright's binary
177
+ uses : actions/cache@v4
178
+ with :
179
+ # Playwright removes unused browsers automatically
180
+ # So does not need to add playwright version to key
181
+ key : ${{ runner.os }}-playwright-bin-v1
182
+ path : ${{ env.PLAYWRIGHT_BROWSERS_PATH }}
183
+
139
184
- name : Install Playwright
140
- run : pnpm playwright-core install chromium
185
+ # does not need to explicitly set chromium after https://github.com/microsoft/playwright/issues/14862 is solved
186
+ run : pnpm playwright install chromium
141
187
142
188
- name : Restore dist cache
143
189
uses : actions/cache@v4
144
190
with :
145
191
path : packages/*/dist
146
- key : build-vue-i18n-os-${{ matrix.os }}-${{ github.sha }}
192
+ key : build-vue-i18n-next- os-${{ matrix.os }}-${{ github.sha }}
147
193
148
194
- name : Run e2e tests
149
195
run : pnpm test:e2e
196
+
197
+ edge-release :
198
+ if : |
199
+ github.event_name == 'push' &&
200
+ !contains(github.event.head_commit.message, '[skip-release]') &&
201
+ !contains(github.event.head_commit.message, 'chore') &&
202
+ !contains(github.event.head_commit.message, 'docs')
203
+
204
+ needs :
205
+ - lint
206
+ - build
207
+ - test-unit
208
+ - test-type
209
+ - test-e2e
210
+
211
+ strategy :
212
+ matrix :
213
+ os : [ubuntu-latest]
214
+ node : [18]
215
+
216
+ runs-on : ${{ matrix.os }}
217
+
218
+ steps :
219
+ - name : Checkout codes
220
+ uses : actions/checkout@v4
221
+
222
+ - name : Enable corepack
223
+ run : corepack enable
224
+
225
+ - name : Setup node
226
+ uses : actions/setup-node@v4
227
+ with :
228
+ node-version : ${{ matrix.node }}
229
+ cache : ' pnpm'
230
+
231
+ - name : Install dependencies
232
+ run : pnpm install --no-frozen-lockfile
233
+
234
+ - name : Restore dist cache
235
+ uses : actions/cache@v4
236
+ with :
237
+ path : packages/*/dist
238
+ key : build-vue-i18n-next-os-${{ matrix.os }}-${{ github.sha }}
239
+
240
+ - name : Upload message-compiler dist files (debug)
241
+ uses : actions/upload-artifact@v4
242
+ with :
243
+ name : message-compiler
244
+ path : packages/message-compiler/dist
245
+
246
+ - name : Release edge version
247
+ run : ./scripts/release-edge.sh
248
+ env :
249
+ NPM_AUTH_TOKEN : ${{secrets.NPM_AUTH_TOKEN}}
0 commit comments