Skip to content

Commit

Permalink
ci: fix playwright executable does not exist (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
BobbieGoede authored Nov 30, 2023
1 parent 82ef441 commit 4ebbaa5
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 32 deletions.
30 changes: 19 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
name: CI

env:
CI: true
# install playwright binary manually (because pnpm only runs install script once)
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: '1'

on:
push:
branches:
Expand All @@ -10,12 +15,12 @@ on:

jobs:
lint:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
node: [18.x]

runs-on: ${{ matrix.os }}
timeout-minutes: 10

steps:
- name: Checkout codes
Expand All @@ -29,24 +34,24 @@ jobs:
version: 8.6.2

- name: Setup node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: 'pnpm'

- name: Install dependencies
run: pnpm install --no-frozen-lockfile --ignore-scripts
run: pnpm install --no-frozen-lockfile

- name: Lint codes
run: pnpm lint

e2e:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
node: [18.x]

runs-on: ${{ matrix.os }}
timeout-minutes: 10

steps:
- name: Checkout codes
Expand All @@ -60,7 +65,7 @@ jobs:
version: 8.6.2

- name: Setup node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: 'pnpm'
Expand Down Expand Up @@ -107,6 +112,7 @@ jobs:
bridge: [vue-i18n-bridge, vue-router-bridge]
type: [commonjs, module]
fail-fast: false
timeout-minutes: 10

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

Expand All @@ -117,7 +123,7 @@ jobs:
fetch-depth: 0

- name: Setup node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}

Expand All @@ -138,6 +144,7 @@ jobs:
bridge: [vue-i18n-bridge, vue-router-bridge]
type: [commonjs, module]
fail-fast: false
timeout-minutes: 10

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

Expand All @@ -148,7 +155,7 @@ jobs:
fetch-depth: 0

- name: Setup node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}

Expand All @@ -170,6 +177,7 @@ jobs:
vue: [2.6, 2.7, 3]
type: [commonjs, module]
fail-fast: false
timeout-minutes: 10

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

Expand All @@ -180,7 +188,7 @@ jobs:
fetch-depth: 0

- name: Setup node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}

Expand Down Expand Up @@ -218,7 +226,7 @@ jobs:
version: 8.6.2

- name: Setup node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: 'pnpm'
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"npm-run-all": "^4.1.5",
"pathe": "^1.1.1",
"pkg-types": "^1.0.2",
"playwright": "^1.40.1",
"prettier": "^3.0.3",
"rimraf": "^3.0.2",
"secretlint": "^7.0.7",
Expand Down
65 changes: 46 additions & 19 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 10 additions & 2 deletions scripts/replaceDeps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,21 @@ async function main() {
}
}
const examplesPath = resolve(__dirname, '../examples')
const projectPkgJson = await readPackageJSON(resolve(__dirname, 'package.json'))
for (const ex of await fs.readdir(examplesPath)) {
const examplePath = resolve(examplesPath, ex, 'package.json')
const pkgJson = await readPackageJSON(examplePath)
const pkg = PKG_MAP[ex]
const tgzPath = TGZ_MAP.get(pkg)
if (tgzPath && pkgJson.dependencies) {
pkgJson.dependencies[`@intlify/${pkg}`] = `file:${tgzPath}`

if (pkgJson.dependencies) {
if (tgzPath) {
pkgJson.dependencies[`@intlify/${pkg}`] = `file:${tgzPath}`
}

if (projectPkgJson && projectPkgJson.devDependencies?.playwright) {
pkgJson.devDependencies['playwright'] = projectPkgJson.devDependencies.playwright
}
await writePackageJSON(examplePath, pkgJson)
}
}
Expand Down

0 comments on commit 4ebbaa5

Please sign in to comment.