Skip to content

Commit 4ebbaa5

Browse files
authored
ci: fix playwright executable does not exist (#51)
1 parent 82ef441 commit 4ebbaa5

File tree

4 files changed

+76
-32
lines changed

4 files changed

+76
-32
lines changed

.github/workflows/ci.yml

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
name: CI
22

3+
env:
4+
CI: true
5+
# install playwright binary manually (because pnpm only runs install script once)
6+
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: '1'
7+
38
on:
49
push:
510
branches:
@@ -10,12 +15,12 @@ on:
1015

1116
jobs:
1217
lint:
18+
runs-on: ${{ matrix.os }}
1319
strategy:
1420
matrix:
1521
os: [ubuntu-latest]
1622
node: [18.x]
17-
18-
runs-on: ${{ matrix.os }}
23+
timeout-minutes: 10
1924

2025
steps:
2126
- name: Checkout codes
@@ -29,24 +34,24 @@ jobs:
2934
version: 8.6.2
3035

3136
- name: Setup node
32-
uses: actions/setup-node@v3
37+
uses: actions/setup-node@v4
3338
with:
3439
node-version: ${{ matrix.node }}
3540
cache: 'pnpm'
3641

3742
- name: Install dependencies
38-
run: pnpm install --no-frozen-lockfile --ignore-scripts
43+
run: pnpm install --no-frozen-lockfile
3944

4045
- name: Lint codes
4146
run: pnpm lint
4247

4348
e2e:
49+
runs-on: ${{ matrix.os }}
4450
strategy:
4551
matrix:
4652
os: [ubuntu-latest]
4753
node: [18.x]
48-
49-
runs-on: ${{ matrix.os }}
54+
timeout-minutes: 10
5055

5156
steps:
5257
- name: Checkout codes
@@ -60,7 +65,7 @@ jobs:
6065
version: 8.6.2
6166

6267
- name: Setup node
63-
uses: actions/setup-node@v3
68+
uses: actions/setup-node@v4
6469
with:
6570
node-version: ${{ matrix.node }}
6671
cache: 'pnpm'
@@ -107,6 +112,7 @@ jobs:
107112
bridge: [vue-i18n-bridge, vue-router-bridge]
108113
type: [commonjs, module]
109114
fail-fast: false
115+
timeout-minutes: 10
110116

111117
runs-on: ${{ matrix.os }}
112118

@@ -117,7 +123,7 @@ jobs:
117123
fetch-depth: 0
118124

119125
- name: Setup node
120-
uses: actions/setup-node@v3
126+
uses: actions/setup-node@v4
121127
with:
122128
node-version: ${{ matrix.node }}
123129

@@ -138,6 +144,7 @@ jobs:
138144
bridge: [vue-i18n-bridge, vue-router-bridge]
139145
type: [commonjs, module]
140146
fail-fast: false
147+
timeout-minutes: 10
141148

142149
runs-on: ${{ matrix.os }}
143150

@@ -148,7 +155,7 @@ jobs:
148155
fetch-depth: 0
149156

150157
- name: Setup node
151-
uses: actions/setup-node@v3
158+
uses: actions/setup-node@v4
152159
with:
153160
node-version: ${{ matrix.node }}
154161

@@ -170,6 +177,7 @@ jobs:
170177
vue: [2.6, 2.7, 3]
171178
type: [commonjs, module]
172179
fail-fast: false
180+
timeout-minutes: 10
173181

174182
runs-on: ${{ matrix.os }}
175183

@@ -180,7 +188,7 @@ jobs:
180188
fetch-depth: 0
181189

182190
- name: Setup node
183-
uses: actions/setup-node@v3
191+
uses: actions/setup-node@v4
184192
with:
185193
node-version: ${{ matrix.node }}
186194

@@ -218,7 +226,7 @@ jobs:
218226
version: 8.6.2
219227

220228
- name: Setup node
221-
uses: actions/setup-node@v3
229+
uses: actions/setup-node@v4
222230
with:
223231
node-version: ${{ matrix.node }}
224232
cache: 'pnpm'

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"npm-run-all": "^4.1.5",
2929
"pathe": "^1.1.1",
3030
"pkg-types": "^1.0.2",
31+
"playwright": "^1.40.1",
3132
"prettier": "^3.0.3",
3233
"rimraf": "^3.0.2",
3334
"secretlint": "^7.0.7",

pnpm-lock.yaml

Lines changed: 46 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/replaceDeps.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,21 @@ async function main() {
3232
}
3333
}
3434
const examplesPath = resolve(__dirname, '../examples')
35+
const projectPkgJson = await readPackageJSON(resolve(__dirname, 'package.json'))
3536
for (const ex of await fs.readdir(examplesPath)) {
3637
const examplePath = resolve(examplesPath, ex, 'package.json')
3738
const pkgJson = await readPackageJSON(examplePath)
3839
const pkg = PKG_MAP[ex]
3940
const tgzPath = TGZ_MAP.get(pkg)
40-
if (tgzPath && pkgJson.dependencies) {
41-
pkgJson.dependencies[`@intlify/${pkg}`] = `file:${tgzPath}`
41+
42+
if (pkgJson.dependencies) {
43+
if (tgzPath) {
44+
pkgJson.dependencies[`@intlify/${pkg}`] = `file:${tgzPath}`
45+
}
46+
47+
if (projectPkgJson && projectPkgJson.devDependencies?.playwright) {
48+
pkgJson.devDependencies['playwright'] = projectPkgJson.devDependencies.playwright
49+
}
4250
await writePackageJSON(examplePath, pkgJson)
4351
}
4452
}

0 commit comments

Comments
 (0)