@@ -143,6 +143,78 @@ jobs:
143
143
steps :
144
144
- run : echo "Build & Test Failed"
145
145
146
+ test-native-plugins :
147
+ needs : changed
148
+ if : needs.changed.outputs.should_skip != 'true'
149
+ timeout-minutes : 20
150
+ runs-on : ${{ matrix.os }}
151
+ strategy :
152
+ matrix :
153
+ os : [ubuntu-latest, macos-latest, windows-latest]
154
+ node_version : [22]
155
+ fail-fast : false
156
+
157
+ name : " Build&Test: node-${{ matrix.node_version }}, ${{ matrix.os }} (native plugins)"
158
+ steps :
159
+ - name : Checkout
160
+ uses : actions/checkout@v4
161
+
162
+ - name : Install pnpm
163
+ uses : pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
164
+
165
+ - name : Set node version to ${{ matrix.node_version }}
166
+ uses : actions/setup-node@v4
167
+ with :
168
+ node-version : ${{ matrix.node_version }}
169
+ cache : " pnpm"
170
+
171
+ - name : Install deps
172
+ run : pnpm install
173
+
174
+ # Install playwright's binary under custom directory to cache
175
+ - name : (non-windows) Set Playwright path and Get playwright version
176
+ if : runner.os != 'Windows'
177
+ run : |
178
+ echo "PLAYWRIGHT_BROWSERS_PATH=$HOME/.cache/playwright-bin" >> $GITHUB_ENV
179
+ PLAYWRIGHT_VERSION="$(pnpm ls --depth 0 --json -w playwright-chromium | jq --raw-output '.[0].devDependencies["playwright-chromium"].version')"
180
+ echo "PLAYWRIGHT_VERSION=$PLAYWRIGHT_VERSION" >> $GITHUB_ENV
181
+ - name : (windows) Set Playwright path and Get playwright version
182
+ if : runner.os == 'Windows'
183
+ run : |
184
+ echo "PLAYWRIGHT_BROWSERS_PATH=$HOME\.cache\playwright-bin" >> $env:GITHUB_ENV
185
+ $env:PLAYWRIGHT_VERSION="$(pnpm ls --depth 0 --json -w playwright-chromium | jq --raw-output '.[0].devDependencies["playwright-chromium"].version')"
186
+ echo "PLAYWRIGHT_VERSION=$env:PLAYWRIGHT_VERSION" >> $env:GITHUB_ENV
187
+
188
+ - name : Cache Playwright's binary
189
+ uses : actions/cache@v4
190
+ with :
191
+ key : ${{ runner.os }}-playwright-bin-v1-${{ env.PLAYWRIGHT_VERSION }}
192
+ path : ${{ env.PLAYWRIGHT_BROWSERS_PATH }}
193
+ restore-keys : |
194
+ ${{ runner.os }}-playwright-bin-v1-
195
+
196
+ - name : Install Playwright
197
+ # does not need to explicitly set chromium after https://github.com/microsoft/playwright/issues/14862 is solved
198
+ run : pnpm playwright install chromium
199
+
200
+ - name : Build
201
+ run : pnpm run build
202
+
203
+ - name : Test unit
204
+ run : pnpm run test-unit
205
+ env :
206
+ _VITE_TEST_NATIVE_PLUGIN : 1
207
+
208
+ - name : Test serve
209
+ run : pnpm run test-serve
210
+ env :
211
+ _VITE_TEST_NATIVE_PLUGIN : 1
212
+
213
+ - name : Test build
214
+ run : pnpm run test-build
215
+ env :
216
+ _VITE_TEST_NATIVE_PLUGIN : 1
217
+
146
218
lint :
147
219
timeout-minutes : 10
148
220
runs-on : ubuntu-latest
0 commit comments