Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 58 additions & 14 deletions .github/workflows/ci-demos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,50 @@ on:
pull_request:
paths:
- 'demos/**'
- 'packages/superdoc/**'
- 'packages/react/**'
- 'packages/super-editor/**'
- 'packages/layout-engine/**'
- 'shared/**'
Comment thread
caio-pizzol marked this conversation as resolved.
Comment thread
caio-pizzol marked this conversation as resolved.
- 'package.json'
- 'pnpm-lock.yaml'
- 'pnpm-workspace.yaml'
workflow_dispatch:

jobs:
validate:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6

- uses: pnpm/action-setup@v4

- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: '20'
cache: 'pnpm'

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Build superdoc
run: pnpm build:superdoc

- name: Install Playwright
working-directory: demos/__tests__
run: npx playwright install chromium

- name: Cache workspace
uses: actions/cache/save@v4
with:
path: |
.
~/.cache/ms-playwright
key: demos-workspace-${{ github.sha }}

smoke-test:
needs: build
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand All @@ -32,21 +72,25 @@ jobs:
- vanilla
- vue
steps:
- uses: actions/checkout@v6

- name: Setup Node.js
uses: actions/setup-node@v6
- name: Restore workspace
uses: actions/cache/restore@v4
with:
node-version: '20'

- name: Install demo dependencies
working-directory: demos/${{ matrix.demo }}
run: npm install

- name: Install smoke test dependencies
working-directory: demos/__tests__
run: npm install && npx playwright install chromium
path: |
.
~/.cache/ms-playwright
key: demos-workspace-${{ github.sha }}

- name: Run smoke test
working-directory: demos/__tests__
run: DEMO=${{ matrix.demo }} npx playwright test

validate:
if: always()
needs: [smoke-test]
runs-on: ubuntu-latest
steps:
- name: Check results
run: |
if [[ "${{ contains(needs.*.result, 'failure') }}" == "true" ]]; then
exit 1
fi
2 changes: 1 addition & 1 deletion demos/__tests__/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default defineConfig({
webServer: {
command,
url: `http://localhost:${port}`,
timeout: 30_000,
timeout: 120_000,
reuseExistingServer: !process.env.CI,
},
use: {
Expand Down
4 changes: 3 additions & 1 deletion demos/__tests__/smoke.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ test('demo loads without errors', async ({ page }) => {
);

await page.goto('/');
await expect(page.locator('body')).toBeVisible();
// SPA frameworks (e.g. Next.js) may hide the body during hydration;
// give them enough time to mount before checking visibility.
await expect(page.locator('body')).toBeVisible({ timeout: 30_000 });

// Give the app a moment to initialize (SuperDoc is async)
await page.waitForTimeout(2000);
Expand Down
1 change: 1 addition & 0 deletions demos/toolbar/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"dev": "vite"
},
"dependencies": {
"prosemirror-state": "^1.4.3",
"superdoc": "latest"
},
"devDependencies": {
Expand Down
15 changes: 10 additions & 5 deletions pnpm-lock.yaml

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

Loading