From fabbe6a3400930f99d08e22808dc98910a96203a Mon Sep 17 00:00:00 2001 From: zqran Date: Mon, 27 Nov 2023 12:21:48 +0800 Subject: [PATCH] fix: ci (#13) --- .github/workflows/daily-build.yaml | 30 ++------- package.json | 4 +- packages/esbuild/playwright.config.ts | 10 +++ packages/esbuild/tests/basic.spec.ts | 3 +- packages/next/playwright.config.ts | 10 +++ packages/next/tests/basic.spec.ts | 3 +- packages/nuxt/playwright.config.ts | 10 +++ packages/nuxt/tests/basic.spec.ts | 3 +- packages/rspack/playwright.config.ts | 10 +++ packages/rspack/tests/basic.spec.ts | 3 +- packages/webpack/playwright.config.ts | 10 +++ packages/webpack/tests/basic.spec.ts | 3 +- pnpm-lock.yaml | 87 ++++++++++++++++++++++++--- 13 files changed, 140 insertions(+), 46 deletions(-) diff --git a/.github/workflows/daily-build.yaml b/.github/workflows/daily-build.yaml index c88d64e..dab2a5d 100644 --- a/.github/workflows/daily-build.yaml +++ b/.github/workflows/daily-build.yaml @@ -26,52 +26,32 @@ jobs: - name: Install dependencies run: pnpm install - - name: Build esbuild + - name: Build and Test esbuild run: | cd packages/esbuild pnpm run build - pnpm serve - - name: Run esbuild tests - run: | - cd packages/esbuild pnpm test - - name: Build next + - name: Build and Test next run: | cd packages/next pnpm run build - pnpm start - - name: Run next tests - run: | - cd packages/next pnpm test - - name: Build nuxt + - name: Build and Test nuxt run: | cd packages/nuxt pnpm run build - pnpm preview - - name: Run nuxt tests - run: | - cd packages/nuxt pnpm test - - name: Build rspack + - name: Build and Test rspack run: | cd packages/rspack pnpm run build - pnpm serve - - name: Run rspack tests - run: | - cd packages/rspack pnpm test - - name: Build webpack + - name: Build and Test webpack run: | cd packages/webpack pnpm run build - pnpm serve - - name: Run webpack tests - run: | - cd packages/webpack pnpm test diff --git a/package.json b/package.json index 956bb09..6547506 100644 --- a/package.json +++ b/package.json @@ -9,9 +9,9 @@ "dependencies": { "@blocksuite/blocks": "nightly", "@blocksuite/editor": "nightly", - "@blocksuite/global": "^0.9.0", + "@blocksuite/global": "nightly", "@blocksuite/store": "nightly", - "@blocksuite/virgo": "^0.9.0" + "@blocksuite/virgo": "nightly" }, "devDependencies": { "@playwright/test": "^1.40.0", diff --git a/packages/esbuild/playwright.config.ts b/packages/esbuild/playwright.config.ts index dad3255..da58c53 100644 --- a/packages/esbuild/playwright.config.ts +++ b/packages/esbuild/playwright.config.ts @@ -5,6 +5,16 @@ import { defineConfig } from '@playwright/test'; export default defineConfig({ testDir: 'tests', fullyParallel: true, + webServer: { + command: 'pnpm serve', + port: 3000, + // command: process.env.CI ? 'pnpm preview' : 'pnpm dev', + // port: process.env.CI ? 4173 : 5173, + reuseExistingServer: !process.env.CI, + env: { + COVERAGE: process.env.COVERAGE ?? '', + }, + }, use: { browserName: (process.env.BROWSER as PlaywrightWorkerOptions['browserName']) ?? diff --git a/packages/esbuild/tests/basic.spec.ts b/packages/esbuild/tests/basic.spec.ts index 7d67062..93d91d9 100644 --- a/packages/esbuild/tests/basic.spec.ts +++ b/packages/esbuild/tests/basic.spec.ts @@ -8,8 +8,7 @@ import { } from '../../../tests/utils/keyboard'; import { assertText, assertEmpty } from '../../../tests/utils/asserts'; -const PORT = 3000; -const TEST_URL = `http://localhost:${PORT}`; +const TEST_URL = `http://localhost:3000`; test.describe('webpack build test', () => { test('basic input & undo/redo', async ({ page }) => { diff --git a/packages/next/playwright.config.ts b/packages/next/playwright.config.ts index dad3255..01ca719 100644 --- a/packages/next/playwright.config.ts +++ b/packages/next/playwright.config.ts @@ -5,6 +5,16 @@ import { defineConfig } from '@playwright/test'; export default defineConfig({ testDir: 'tests', fullyParallel: true, + webServer: { + command: 'pnpm start', + port: 3001, + // command: process.env.CI ? 'pnpm preview' : 'pnpm dev', + // port: process.env.CI ? 4173 : 5173, + reuseExistingServer: !process.env.CI, + env: { + COVERAGE: process.env.COVERAGE ?? '', + }, + }, use: { browserName: (process.env.BROWSER as PlaywrightWorkerOptions['browserName']) ?? diff --git a/packages/next/tests/basic.spec.ts b/packages/next/tests/basic.spec.ts index 0b29958..46d95eb 100644 --- a/packages/next/tests/basic.spec.ts +++ b/packages/next/tests/basic.spec.ts @@ -8,8 +8,7 @@ import { } from '../../../tests/utils/keyboard'; import { assertText, assertEmpty } from '../../../tests/utils/asserts'; -const PORT = 3002; -const TEST_URL = `http://localhost:${PORT}`; +const TEST_URL = `http://localhost:3001`; test.describe('webpack build test', () => { test('basic input & undo/redo', async ({ page }) => { diff --git a/packages/nuxt/playwright.config.ts b/packages/nuxt/playwright.config.ts index dad3255..01ac91c 100644 --- a/packages/nuxt/playwright.config.ts +++ b/packages/nuxt/playwright.config.ts @@ -5,6 +5,16 @@ import { defineConfig } from '@playwright/test'; export default defineConfig({ testDir: 'tests', fullyParallel: true, + webServer: { + command: 'pnpm preview', + port: 3002, + // command: process.env.CI ? 'pnpm preview' : 'pnpm dev', + // port: process.env.CI ? 4173 : 5173, + reuseExistingServer: !process.env.CI, + env: { + COVERAGE: process.env.COVERAGE ?? '', + }, + }, use: { browserName: (process.env.BROWSER as PlaywrightWorkerOptions['browserName']) ?? diff --git a/packages/nuxt/tests/basic.spec.ts b/packages/nuxt/tests/basic.spec.ts index 0b29958..4b2d1d2 100644 --- a/packages/nuxt/tests/basic.spec.ts +++ b/packages/nuxt/tests/basic.spec.ts @@ -8,8 +8,7 @@ import { } from '../../../tests/utils/keyboard'; import { assertText, assertEmpty } from '../../../tests/utils/asserts'; -const PORT = 3002; -const TEST_URL = `http://localhost:${PORT}`; +const TEST_URL = `http://localhost:3002`; test.describe('webpack build test', () => { test('basic input & undo/redo', async ({ page }) => { diff --git a/packages/rspack/playwright.config.ts b/packages/rspack/playwright.config.ts index dad3255..bc00a39 100644 --- a/packages/rspack/playwright.config.ts +++ b/packages/rspack/playwright.config.ts @@ -5,6 +5,16 @@ import { defineConfig } from '@playwright/test'; export default defineConfig({ testDir: 'tests', fullyParallel: true, + webServer: { + command: 'pnpm serve', + port: 3003, + // command: process.env.CI ? 'pnpm preview' : 'pnpm dev', + // port: process.env.CI ? 4173 : 5173, + reuseExistingServer: !process.env.CI, + env: { + COVERAGE: process.env.COVERAGE ?? '', + }, + }, use: { browserName: (process.env.BROWSER as PlaywrightWorkerOptions['browserName']) ?? diff --git a/packages/rspack/tests/basic.spec.ts b/packages/rspack/tests/basic.spec.ts index 135026c..58df829 100644 --- a/packages/rspack/tests/basic.spec.ts +++ b/packages/rspack/tests/basic.spec.ts @@ -8,8 +8,7 @@ import { } from '../../../tests/utils/keyboard'; import { assertText, assertEmpty } from '../../../tests/utils/asserts'; -const PORT = 3003; -const TEST_URL = `http://localhost:${PORT}`; +const TEST_URL = `http://localhost:3003`; test.describe('webpack build test', () => { test('basic input & undo/redo', async ({ page }) => { diff --git a/packages/webpack/playwright.config.ts b/packages/webpack/playwright.config.ts index dad3255..26bcc18 100644 --- a/packages/webpack/playwright.config.ts +++ b/packages/webpack/playwright.config.ts @@ -5,6 +5,16 @@ import { defineConfig } from '@playwright/test'; export default defineConfig({ testDir: 'tests', fullyParallel: true, + webServer: { + command: 'pnpm serve', + port: 3004, + // command: process.env.CI ? 'pnpm preview' : 'pnpm dev', + // port: process.env.CI ? 4173 : 5173, + reuseExistingServer: !process.env.CI, + env: { + COVERAGE: process.env.COVERAGE ?? '', + }, + }, use: { browserName: (process.env.BROWSER as PlaywrightWorkerOptions['browserName']) ?? diff --git a/packages/webpack/tests/basic.spec.ts b/packages/webpack/tests/basic.spec.ts index 0f053ae..b80ac22 100644 --- a/packages/webpack/tests/basic.spec.ts +++ b/packages/webpack/tests/basic.spec.ts @@ -8,8 +8,7 @@ import { } from '../../../tests/utils/keyboard'; import { assertText, assertEmpty } from '../../../tests/utils/asserts'; -const PORT = 3004; -const TEST_URL = `http://localhost:${PORT}`; +const TEST_URL = `http://localhost:3004`; test.describe('webpack build test', () => { test('basic input & undo/redo', async ({ page }) => { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9bc7e20..7d7ccbe 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -30,6 +30,9 @@ importers: '@types/node': specifier: ^20.8.10 version: 20.10.0 + express: + specifier: ^4.18.2 + version: 4.18.2 serve: specifier: ^14.2.1 version: 14.2.1 @@ -1929,7 +1932,7 @@ packages: perfect-debounce: 1.0.0 pkg-types: 1.0.3 postcss: 8.4.31 - rollup-plugin-visualizer: 5.9.2(rollup@3.29.4) + rollup-plugin-visualizer: 5.9.2(rollup@4.5.2) std-env: 3.5.0 strip-literal: 1.3.0 ufo: 1.3.2 @@ -2353,7 +2356,7 @@ packages: rollup: optional: true dependencies: - '@rollup/pluginutils': 5.0.5(rollup@3.29.4) + '@rollup/pluginutils': 5.0.5(rollup@4.5.2) magic-string: 0.30.5 dev: true @@ -3154,7 +3157,7 @@ packages: optional: true dependencies: '@babel/types': 7.23.3 - '@rollup/pluginutils': 5.0.5(rollup@3.29.4) + '@rollup/pluginutils': 5.0.5(rollup@4.5.2) '@vue/compiler-sfc': 3.3.8 ast-kit: 0.11.2 local-pkg: 0.4.3 @@ -3778,7 +3781,7 @@ packages: engines: {node: '>=16.14.0'} dependencies: '@babel/parser': 7.23.3 - '@rollup/pluginutils': 5.0.5(rollup@3.29.4) + '@rollup/pluginutils': 5.0.5(rollup@4.5.2) pathe: 1.1.1 transitivePeerDependencies: - rollup @@ -3789,7 +3792,7 @@ packages: engines: {node: '>=16.14.0'} dependencies: '@babel/parser': 7.23.3 - '@rollup/pluginutils': 5.0.5(rollup@3.29.4) + '@rollup/pluginutils': 5.0.5(rollup@4.5.2) pathe: 1.1.1 transitivePeerDependencies: - rollup @@ -3901,6 +3904,26 @@ packages: - supports-color dev: true + /body-parser@1.20.1: + resolution: {integrity: sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==} + engines: {node: '>= 0.8', npm: 1.2.8000 || >= 1.4.16} + dependencies: + bytes: 3.1.2 + content-type: 1.0.5 + debug: 2.6.9 + depd: 2.0.0 + destroy: 1.2.0 + http-errors: 2.0.0 + iconv-lite: 0.4.24 + on-finished: 2.4.1 + qs: 6.11.0 + raw-body: 2.5.1 + type-is: 1.6.18 + unpipe: 1.0.0 + transitivePeerDependencies: + - supports-color + dev: true + /bonjour-service@1.1.1: resolution: {integrity: sha512-Z/5lQRMOG9k7W+FkeGTNjh7htqn/2LMnfOvBZ8pynNZCM9MwkQkI3zeI4oz09uWdcgmgHugVvBqxGg4VQJ5PCg==} dependencies: @@ -5186,6 +5209,45 @@ packages: - supports-color dev: true + /express@4.18.2: + resolution: {integrity: sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==} + engines: {node: '>= 0.10.0'} + dependencies: + accepts: 1.3.8 + array-flatten: 1.1.1 + body-parser: 1.20.1 + content-disposition: 0.5.4 + content-type: 1.0.5 + cookie: 0.5.0 + cookie-signature: 1.0.6 + debug: 2.6.9 + depd: 2.0.0 + encodeurl: 1.0.2 + escape-html: 1.0.3 + etag: 1.8.1 + finalhandler: 1.2.0 + fresh: 0.5.2 + http-errors: 2.0.0 + merge-descriptors: 1.0.1 + methods: 1.1.2 + on-finished: 2.4.1 + parseurl: 1.3.3 + path-to-regexp: 0.1.7 + proxy-addr: 2.0.7 + qs: 6.11.0 + range-parser: 1.2.1 + safe-buffer: 5.2.1 + send: 0.18.0 + serve-static: 1.15.0 + setprototypeof: 1.2.0 + statuses: 2.0.1 + type-is: 1.6.18 + utils-merge: 1.0.1 + vary: 1.1.2 + transitivePeerDependencies: + - supports-color + dev: true + /extend@3.0.2: resolution: {integrity: sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==} dev: false @@ -8461,6 +8523,13 @@ packages: side-channel: 1.0.4 dev: true + /qs@6.11.0: + resolution: {integrity: sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==} + engines: {node: '>=0.6'} + dependencies: + side-channel: 1.0.4 + dev: true + /queue-microtask@1.2.3: resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} dev: true @@ -9726,7 +9795,7 @@ packages: /unimport@3.5.0: resolution: {integrity: sha512-0Ei1iTeSYxs7oxxUf79/KaBc2dPjZxe7qdVpw7yIz5YcdTZjmBYO6ToLDW+fX9QOHiueZ3xtwb5Z/wqaSfXx6A==} dependencies: - '@rollup/pluginutils': 5.0.5(rollup@3.29.4) + '@rollup/pluginutils': 5.0.5(rollup@4.5.2) escape-string-regexp: 5.0.0 fast-glob: 3.3.2 local-pkg: 0.5.0 @@ -9837,7 +9906,7 @@ packages: optional: true dependencies: '@babel/types': 7.23.3 - '@rollup/pluginutils': 5.0.5(rollup@3.29.4) + '@rollup/pluginutils': 5.0.5(rollup@4.5.2) '@vue-macros/common': 1.8.0(vue@3.3.8) ast-walker-scope: 0.5.0 chokidar: 3.5.3 @@ -10186,7 +10255,7 @@ packages: dependencies: '@antfu/utils': 0.7.6 '@nuxt/kit': 3.8.1 - '@rollup/pluginutils': 5.0.5(rollup@3.29.4) + '@rollup/pluginutils': 5.0.5(rollup@4.5.2) debug: 4.3.4 error-stack-parser-es: 0.1.1 fs-extra: 11.1.1 @@ -10211,7 +10280,7 @@ packages: dependencies: '@antfu/utils': 0.7.6 '@nuxt/kit': 3.8.2 - '@rollup/pluginutils': 5.0.5(rollup@3.29.4) + '@rollup/pluginutils': 5.0.5(rollup@4.5.2) debug: 4.3.4 error-stack-parser-es: 0.1.1 fs-extra: 11.1.1