fix(presentation-editor): bail on clicks in inter-page gap (SD-2749) #2680
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: Behavior Tests | |
| permissions: | |
| contents: read | |
| on: | |
| pull_request: | |
| branches: [main, stable] | |
| merge_group: | |
| workflow_dispatch: | |
| concurrency: | |
| group: ci-behavior-${{ github.event.pull_request.number || github.run_id }} | |
| cancel-in-progress: true | |
| jobs: | |
| detect: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| pull-requests: read | |
| outputs: | |
| behavior: ${{ steps.set.outputs.behavior }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1 | |
| id: filter | |
| if: github.event_name == 'pull_request' | |
| with: | |
| filters: | | |
| behavior: | |
| - 'packages/super-editor/**' | |
| - 'packages/superdoc/**' | |
| - 'packages/layout-engine/**' | |
| - 'packages/word-layout/**' | |
| - 'packages/preset-geometry/**' | |
| - 'packages/document-api/**' | |
| - 'shared/**' | |
| - 'tests/behavior/**' | |
| - 'pnpm-lock.yaml' | |
| - 'package.json' | |
| - 'pnpm-workspace.yaml' | |
| - '.nvmrc' | |
| - 'tsconfig.base.json' | |
| - 'tsconfig.references.json' | |
| - 'vite.sourceResolve.ts' | |
| - '.github/workflows/ci-behavior.yml' | |
| - id: set | |
| run: | | |
| if [[ "${{ github.event_name }}" == "pull_request" ]]; then | |
| echo "behavior=${{ steps.filter.outputs.behavior }}" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "behavior=true" >> "$GITHUB_OUTPUT" | |
| fi | |
| test: | |
| needs: detect | |
| if: needs.detect.outputs.behavior == 'true' | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| # PRs without behavior-relevant changes are skipped entirely by the | |
| # detect gate above. When the suite does run, exercise all 3 browsers | |
| # so cross-browser regressions are caught at PR time. | |
| browser: [chromium, firefox, webkit] | |
| shard: [1, 2, 3, 4] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: pnpm/action-setup@v4 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version-file: .nvmrc | |
| cache: pnpm | |
| - name: Install dependencies | |
| run: pnpm install --ignore-scripts | |
| - name: Build SuperDoc | |
| run: pnpm build | |
| - name: Get Playwright version | |
| id: pw | |
| run: echo "version=$(node -p "require('@playwright/test/package.json').version")" >> $GITHUB_OUTPUT | |
| working-directory: tests/behavior | |
| - name: Cache Playwright browsers | |
| uses: actions/cache@v5 | |
| id: pw-cache | |
| with: | |
| path: ~/.cache/ms-playwright | |
| key: playwright-${{ runner.os }}-${{ steps.pw.outputs.version }}-${{ matrix.browser }} | |
| - name: Install Playwright browser | |
| if: steps.pw-cache.outputs.cache-hit != 'true' | |
| run: pnpm exec playwright install --with-deps ${{ matrix.browser }} | |
| working-directory: tests/behavior | |
| - name: Install Playwright system deps | |
| if: steps.pw-cache.outputs.cache-hit == 'true' | |
| run: pnpm exec playwright install-deps ${{ matrix.browser }} | |
| working-directory: tests/behavior | |
| - name: Run behavior tests (${{ matrix.browser }} shard ${{ matrix.shard }}/4) | |
| run: pnpm exec playwright test --project=${{ matrix.browser }} --shard=${{ matrix.shard }}/4 | |
| working-directory: tests/behavior | |
| validate: | |
| name: Behavior Tests / validate | |
| if: always() | |
| needs: [detect, test] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check results | |
| run: | | |
| if [[ "${{ needs.detect.result }}" != "success" ]]; then | |
| echo "Detect job did not succeed (result: ${{ needs.detect.result }})." | |
| exit 1 | |
| fi | |
| if [[ "${{ needs.detect.outputs.behavior }}" != "true" ]]; then | |
| echo "Behavior tests skipped: no relevant paths changed." | |
| exit 0 | |
| fi | |
| if [[ "${{ needs.test.result }}" != "success" ]]; then | |
| echo "Behavior tests were required but did not succeed (result: ${{ needs.test.result }})." | |
| exit 1 | |
| fi |