Merge main into stable #2549
Workflow file for this run
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 Demos | |
| on: | |
| pull_request: | |
| paths: | |
| - 'demos/**' | |
| - 'packages/superdoc/**' | |
| - 'packages/react/**' | |
| - 'packages/super-editor/**' | |
| - 'packages/layout-engine/**' | |
| - 'shared/**' | |
| - 'package.json' | |
| 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 @superdoc-dev/react | |
| # custom-ui imports the React wrapper from its dist/. | |
| # Other demos don't need this; cheap enough to run unconditionally. | |
| run: pnpm --filter @superdoc-dev/react run build | |
| - 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 | |
| matrix: | |
| demo: | |
| - contract-templates | |
| - custom-ui | |
| - docx-from-html | |
| - fields-source | |
| - grading-papers | |
| # - html-editor # broken: imports unpublished superdoc/super-editor/style.css subpath | |
| - linked-sections | |
| - nextjs-ssr | |
| steps: | |
| - name: Restore workspace | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: | | |
| . | |
| ~/.cache/ms-playwright | |
| key: demos-workspace-${{ github.sha }} | |
| - uses: pnpm/action-setup@v4 | |
| - name: Run smoke test | |
| working-directory: demos/__tests__ | |
| run: DEMO=${{ matrix.demo }} npx playwright test | |
| validate: | |
| name: CI Demos / validate | |
| if: always() | |
| needs: [smoke-test] | |
| 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 |