Skip to content
Open
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
17 changes: 17 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Keep the e2e image build context lean and Linux-clean: never copy host
# (macOS) node_modules or build outputs — deps are installed fresh inside the
# image. What actually lands in the image is selected explicitly by the COPY
# steps in tests/Dockerfile (manifests + example apps), not by exclusions here;
# these entries just stop the heavy/irrelevant trees from bloating the context.
**/node_modules
**/dist
**/types
**/.vite
**/.vite-plus
**/*.tsbuildinfo
**/.DS_Store
.git
**/test-results
**/blob-report
**/playwright-report
tests/.vitest-attachments
91 changes: 25 additions & 66 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ jobs:
id: soft-release
run: vp dlx pkg-pr-new publish './packages/*' # TODO disabled only for AI branch--compact

playwright-build:
name: "Playwright Build"
e2e-build:
name: "E2E Build"
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
Expand All @@ -67,79 +67,36 @@ jobs:
- name: Install dependencies
run: vp install

# Example apps mounted by the e2e tests import the @blocknote/* packages'
# built dist.
- name: Build packages
run: vp run -r build
run: vp run --filter ./packages build

- name: Upload build artifacts
- name: Upload package dist
uses: actions/upload-artifact@v7
with:
name: playwright-build
path: |
packages/*/dist
playground/dist
name: e2e-package-dist
path: packages/*/dist
retention-days: 1

playwright:
name: "Playwright Tests - ${{ matrix.browser }} (${{ matrix.shardIndex }}/${{ matrix.shardTotal }})"
e2e:
# Vitest Browser Mode runs in the Playwright Linux container — the same
# environment as the local Docker run — so behaviour matches local dev.
name: "E2E - ${{ matrix.browser }}"
runs-on: ubuntu-latest
needs: playwright-build
needs: e2e-build
timeout-minutes: 30
container:
image: mcr.microsoft.com/playwright:v1.51.1-noble
strategy:
fail-fast: false
matrix:
browser: [chromium, firefox, webkit]
shardIndex: [1, 2]
shardTotal: [2]
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 100

- uses: voidzero-dev/setup-vp@v1
with:
node-version-file: ".node-version"
cache: true

- name: Download build artifacts
uses: actions/download-artifact@v8
with:
name: playwright-build

- name: Install dependencies
run: vp install

- name: Run server and Playwright tests
run: |
HOME=/root vp exec concurrently --success=first -r --kill-others \
"vp run --filter @blocknote/example-editor preview" \
"wait-on http://localhost:3000 && cd tests && vp exec playwright test --project ${{ matrix.browser }} --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }}"

- name: Upload blob report
uses: actions/upload-artifact@v7
if: ${{ !cancelled() }}
with:
name: blob-report-${{ matrix.browser }}-${{ matrix.shardIndex }}
path: tests/blob-report/
retention-days: 1

- name: Upload HTML report
uses: actions/upload-artifact@v7
if: ${{ !cancelled() }}
with:
name: playwright-report-${{ matrix.browser }}-${{ matrix.shardIndex }}
path: tests/playwright-report/
retention-days: 30

merge-reports:
name: "Merge Playwright Reports"
if: ${{ !cancelled() }}
needs: playwright
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6

- uses: voidzero-dev/setup-vp@v1
with:
node-version-file: ".node-version"
Expand All @@ -148,20 +105,22 @@ jobs:
- name: Install dependencies
run: vp install

- name: Download blob reports
- name: Download package dist
uses: actions/download-artifact@v8
with:
path: tests/all-blob-reports
pattern: blob-report-*
merge-multiple: true
name: e2e-package-dist
path: packages

- name: Merge reports
run: vp exec playwright merge-reports --reporter html ./all-blob-reports
# No preview server: Vitest Browser Mode serves the tests + mounted example
# apps itself. `--browser` selects this matrix shard's browser.
- name: Run e2e tests (${{ matrix.browser }})
run: HOME=/root vp test -c vite.config.browser.ts --run --browser ${{ matrix.browser }}
working-directory: tests

- name: Upload merged HTML report
- name: Upload failure artifacts
uses: actions/upload-artifact@v7
if: ${{ failure() }}
with:
name: playwright-report-merged
path: tests/playwright-report/
retention-days: 30
name: e2e-attachments-${{ matrix.browser }}
path: tests/.vitest-attachments/
retention-days: 7
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ examples/*/types
tsconfig.tsbuildinfo
# testing
coverage
# Vitest's attachment store (failure screenshots / diffs). Accumulates across
# runs; the HTML reporter copies what it needs into playwright-report/data,
# so the originals are unreferenced cruft.
.vitest-attachments/

# production
/build
Expand Down
Loading
Loading