fix(collaboration): sync comments to second collab client on export #2995
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI Examples | |
| on: | |
| pull_request: | |
| paths: | |
| - 'examples/**' | |
| - 'packages/superdoc/**' | |
| - 'packages/react/**' | |
| - 'packages/super-editor/**' | |
| - 'packages/collaboration-yjs/**' | |
| - 'packages/sdk/**' | |
| - 'packages/layout-engine/**' | |
| - 'shared/**' | |
| workflow_dispatch: | |
| jobs: | |
| 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: Build React wrapper | |
| run: pnpm --filter @superdoc-dev/react build | |
| - name: Build collaboration package | |
| run: pnpm --filter @superdoc-dev/superdoc-yjs-collaboration build | |
| - name: Install Playwright | |
| working-directory: examples/__tests__ | |
| run: npx playwright install chromium | |
| - name: Cache workspace | |
| uses: actions/cache/save@v4 | |
| with: | |
| path: | | |
| . | |
| ~/.cache/ms-playwright | |
| key: examples-workspace-${{ github.sha }} | |
| getting-started: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| example: [react, vue, vanilla, cdn, angular, nuxt, laravel, solid] | |
| steps: | |
| - name: Restore workspace | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: | | |
| . | |
| ~/.cache/ms-playwright | |
| key: examples-workspace-${{ github.sha }} | |
| - name: Setup PHP | |
| if: matrix.example == 'laravel' | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: '8.2' | |
| - name: Install Composer dependencies | |
| if: matrix.example == 'laravel' | |
| working-directory: examples/getting-started/laravel | |
| run: composer install --no-interaction --prefer-dist | |
| - name: Prepare Laravel environment | |
| if: matrix.example == 'laravel' | |
| working-directory: examples/getting-started/laravel | |
| run: cp .env.example .env && php artisan key:generate | |
| - name: Run smoke test | |
| working-directory: examples/__tests__ | |
| run: EXAMPLE=${{ matrix.example }} npx playwright test | |
| collaboration: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| example: [superdoc-yjs, hocuspocus, liveblocks] | |
| steps: | |
| - name: Restore workspace | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: | | |
| . | |
| ~/.cache/ms-playwright | |
| key: examples-workspace-${{ github.sha }} | |
| - name: Create .env for cloud providers | |
| working-directory: examples/editor/collaboration/providers/${{ matrix.example }} | |
| run: | | |
| if [ "${{ matrix.example }}" = "liveblocks" ]; then | |
| echo "VITE_LIVEBLOCKS_PUBLIC_KEY=${{ secrets.VITE_LIVEBLOCKS_PUBLIC_KEY }}" > .env | |
| fi | |
| - name: Run smoke test | |
| working-directory: examples/__tests__ | |
| run: EXAMPLE=editor/collaboration/providers/${{ matrix.example }} npx playwright test | |
| built-in-ui: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| example: [track-changes, comments, toolbar] | |
| steps: | |
| - name: Restore workspace | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: | | |
| . | |
| ~/.cache/ms-playwright | |
| key: examples-workspace-${{ github.sha }} | |
| - name: Run smoke test | |
| working-directory: examples/__tests__ | |
| run: EXAMPLE=editor/built-in-ui/${{ matrix.example }} npx playwright test | |
| custom-ui: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| example: [selection-capture, configurable-toolbar] | |
| steps: | |
| - name: Restore workspace | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: | | |
| . | |
| ~/.cache/ms-playwright | |
| key: examples-workspace-${{ github.sha }} | |
| - uses: pnpm/action-setup@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: '20' | |
| cache: 'pnpm' | |
| - name: Run smoke test | |
| working-directory: examples/__tests__ | |
| run: EXAMPLE=editor/custom-ui/${{ matrix.example }} npx playwright test | |
| ai: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| example: [redlining] | |
| steps: | |
| - name: Restore workspace | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: | | |
| . | |
| ~/.cache/ms-playwright | |
| key: examples-workspace-${{ github.sha }} | |
| - name: Run smoke test | |
| working-directory: examples/__tests__ | |
| run: EXAMPLE=ai/${{ matrix.example }} npx playwright test | |
| advanced-headless-toolbar: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| example: [react-shadcn, react-mui, vue-vuetify, svelte-shadcn, vanilla] | |
| steps: | |
| - name: Restore workspace | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: | | |
| . | |
| ~/.cache/ms-playwright | |
| key: examples-workspace-${{ github.sha }} | |
| - name: Run smoke test | |
| working-directory: examples/__tests__ | |
| run: EXAMPLE=advanced/headless-toolbar/${{ matrix.example }} npx playwright test | |
| advanced-extensions: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| example: [custom-mark, custom-node] | |
| steps: | |
| - name: Restore workspace | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: | | |
| . | |
| ~/.cache/ms-playwright | |
| key: examples-workspace-${{ github.sha }} | |
| - name: Run smoke test | |
| working-directory: examples/__tests__ | |
| run: EXAMPLE=advanced/extensions/${{ matrix.example }} npx playwright test | |
| document-engine: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Restore workspace | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: | | |
| . | |
| ~/.cache/ms-playwright | |
| key: examples-workspace-${{ github.sha }} | |
| - name: Run AI redlining (server-side) tests | |
| working-directory: examples/document-engine/ai-redlining | |
| run: npx tsx src/index.test.ts | |
| validate: | |
| name: CI Examples / validate | |
| if: always() | |
| needs: [getting-started, collaboration, built-in-ui, custom-ui, ai, advanced-headless-toolbar, advanced-extensions, document-engine] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check results | |
| run: | | |
| if [[ "${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') || contains(needs.*.result, 'skipped') }}" == "true" ]]; then | |
| echo "One or more required jobs did not succeed." | |
| exit 1 | |
| fi |