Skip to content
Closed
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
213 changes: 167 additions & 46 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,62 @@ jobs:
- name: Run ruff
run: uv run ruff check

BuildWheel:
name: Build JS + Python Wheel
runs-on: depot-ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
python-version: "3.13"
prune-cache: false
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9.10.0
- name: Setup Node.js with pnpm cache
uses: actions/setup-node@v4
with:
cache: 'pnpm'
cache-dependency-path: 'packages/pnpm-lock.yaml'
- name: Install pnpm dependencies
working-directory: packages
run: pnpm install --frozen-lockfile
- name: Install the project
run: uv sync --all-extras --dev
- name: Build JS extension + Python wheel
run: ./scripts/full_build.sh
- name: Run Jest tests
run: |
cd packages/buckaroo-js-core
pnpm install && pnpm run build
pnpm run test
- name: Cache built wheel and JS
uses: actions/cache/save@v4
with:
path: |
./dist
./buckaroo/static/
./packages/buckaroo-js-core/dist/
./packages/buckaroo-widget/dist/
key: buckaroo-build-${{ github.sha }}

# ---------------------------------------------------------------------------
# Source-level tests — operate on the codebase, no wheel needed
# ---------------------------------------------------------------------------

TestPython:
name: Python / Test
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version:
# - "3.8" #other conflicts
#- "3.9"
#- "3.10"
- "3.11"
- "3.12"
- "3.13"
#- "3.14
#os: [depot-ubuntu-latest#, depot-windows-2025]
os: [depot-ubuntu-latest]
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -79,7 +120,7 @@ jobs:
run: |
uv run --with pytest-cov pytest ./tests/unit --color=yes --cov anywidget --cov-report xml
- uses: codecov/codecov-action@v5
- name: Test the JS extension
- name: Build JS extension
run: |
./scripts/full_build.sh
cd packages/buckaroo-js-core
Expand All @@ -97,20 +138,6 @@ jobs:
run: |
bash scripts/test_playwright_screenshots.sh

- name: Run Server Playwright Tests
run: |
bash scripts/test_playwright_server.sh

- name: Run Marimo Playwright Tests
continue-on-error: true
run: |
bash scripts/test_playwright_marimo.sh

- name: Run WASM Marimo Playwright Tests
continue-on-error: true
run: |
bash scripts/test_playwright_wasm_marimo.sh

- name: Upload Theme Screenshots
if: matrix.python-version == '3.13' && always()
uses: actions/upload-artifact@v4
Expand All @@ -119,32 +146,6 @@ jobs:
path: packages/buckaroo-js-core/screenshots/
if-no-files-found: ignore

# - name: Run JupyterLab Playwright Tests
# run: |
# # Ensure uv environment is set up
# uv sync --all-extras --group dev

# # Install the built buckaroo wheel
# uv pip install --force-reinstall dist/*.whl

# # Install test dependencies (polars, jupyterlab)
# uv pip install polars jupyterlab

# # Detect venv location (uv sync creates .venv by default, but check if it exists)
# if [ -d ".venv" ]; then
# VENV_LOCATION=".venv"
# else
# # Fallback: try to detect from uv's Python environment
# VENV_LOCATION=$(uv run python -c "import sys; print(sys.prefix)" 2>/dev/null || echo ".venv")
# fi

# # Run the integration test script with venv location
# bash scripts/test_playwright_jupyter.sh --venv-location="$VENV_LOCATION"
# env:
# UV_PYTHON: ${{ matrix.python-version }}



TestPythonMaxVersions:
name: Python / Test (Max Versions)
runs-on: depot-ubuntu-latest
Expand Down Expand Up @@ -203,3 +204,123 @@ jobs:
# Use .venv/bin/python directly to avoid uv run re-syncing
.venv/bin/python -m pytest ./tests/unit --color=yes --cov anywidget --cov-report xml

# ---------------------------------------------------------------------------
# Integration tests — install the pre-built wheel, simulate end-user install
# ---------------------------------------------------------------------------

TestServer:
name: Server Playwright Tests
needs: [BuildWheel]
runs-on: depot-ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
python-version: "3.13"
prune-cache: false
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9.10.0
- name: Setup Node.js with pnpm cache
uses: actions/setup-node@v4
with:
cache: 'pnpm'
cache-dependency-path: 'packages/pnpm-lock.yaml'
- name: Install pnpm dependencies
working-directory: packages
run: pnpm install --frozen-lockfile
- name: Restore built wheel and JS
uses: actions/cache/restore@v4
with:
path: |
./dist
./buckaroo/static/
./packages/buckaroo-js-core/dist/
./packages/buckaroo-widget/dist/
key: buckaroo-build-${{ github.sha }}
- name: Run Server Playwright Tests
run: |
bash scripts/test_playwright_server.sh

TestMarimo:
name: Marimo Playwright Tests
needs: [BuildWheel]
runs-on: depot-ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
python-version: "3.13"
prune-cache: false
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9.10.0
- name: Setup Node.js with pnpm cache
uses: actions/setup-node@v4
with:
cache: 'pnpm'
cache-dependency-path: 'packages/pnpm-lock.yaml'
- name: Install pnpm dependencies
working-directory: packages
run: pnpm install --frozen-lockfile
- name: Restore built wheel and JS
uses: actions/cache/restore@v4
with:
path: |
./dist
./buckaroo/static/
./packages/buckaroo-js-core/dist/
./packages/buckaroo-widget/dist/
key: buckaroo-build-${{ github.sha }}
- name: Install the project
run: uv sync --all-extras --dev
- name: Run Marimo Playwright Tests
run: |
bash scripts/test_playwright_marimo.sh

TestWASMMarimo:
name: WASM Marimo Playwright Tests
needs: [BuildWheel]
runs-on: depot-ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
python-version: "3.13"
prune-cache: false
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9.10.0
- name: Setup Node.js with pnpm cache
uses: actions/setup-node@v4
with:
cache: 'pnpm'
cache-dependency-path: 'packages/pnpm-lock.yaml'
- name: Install pnpm dependencies
working-directory: packages
run: pnpm install --frozen-lockfile
- name: Restore built wheel and JS
uses: actions/cache/restore@v4
with:
path: |
./dist
./buckaroo/static/
./packages/buckaroo-js-core/dist/
./packages/buckaroo-widget/dist/
key: buckaroo-build-${{ github.sha }}
- name: Install the project
run: uv sync --all-extras --dev
- name: Run WASM Marimo Playwright Tests
run: |
bash scripts/test_playwright_wasm_marimo.sh
4 changes: 2 additions & 2 deletions packages/buckaroo-js-core/playwright.config.marimo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ export default defineConfig({
testMatch: ['marimo.spec.ts', 'theme-screenshots-marimo.spec.ts'],
fullyParallel: false,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
retries: process.env.CI ? 1 : 0,
workers: 1,
reporter: 'html',
use: {
baseURL: `http://localhost:${PORT}`,
trace: 'on-first-retry',
...devices['Desktop Chrome'],
},
timeout: 60_000,
timeout: 30_000,

projects: [
{
Expand Down
6 changes: 3 additions & 3 deletions packages/buckaroo-js-core/playwright.config.wasm-marimo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ export default defineConfig({
testMatch: ['wasm-marimo.spec.ts'],
fullyParallel: false,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 1 : 0,
retries: 0,
workers: 1,
reporter: 'html',
use: {
baseURL: `http://localhost:${PORT}`,
trace: 'on-first-retry',
...devices['Desktop Chrome'],
},
// Longer timeout for WASM: Pyodide initialization can be slow (15-30s)
timeout: 90_000,
// Pyodide init can take 15-30s, plus widget render
timeout: 60_000,

projects: [
{
Expand Down
4 changes: 2 additions & 2 deletions packages/buckaroo-js-core/pw-tests/wasm-marimo.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ test.describe('Buckaroo in Marimo WASM (Pyodide)', () => {
sharedPage = await browser.newPage();
await sharedPage.goto('/');
// Wait for Pyodide init + buckaroo widget + AG-Grid render
await sharedPage.locator('.buckaroo_anywidget').first().waitFor({ state: 'visible', timeout: 90_000 });
await sharedPage.locator('.ag-cell').first().waitFor({ state: 'visible', timeout: 30_000 });
await sharedPage.locator('.buckaroo_anywidget').first().waitFor({ state: 'visible', timeout: 60_000 });
await sharedPage.locator('.ag-cell').first().waitFor({ state: 'visible', timeout: 15_000 });
});

test.afterAll(async () => {
Expand Down
8 changes: 4 additions & 4 deletions tests/notebooks/marimo_pw_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ def _(BuckarooWidget, pd):
'age': [30, 25, 35, 28, 32],
'score': [88.5, 92.3, 76.1, 95.0, 81.7],
})
widget = BuckarooWidget(small_df)
return small_df, widget
small_widget = BuckarooWidget(small_df)
return small_df, small_widget


@app.cell
Expand All @@ -47,8 +47,8 @@ def _(BuckarooInfiniteWidget, pd):
for i in range(200):
rows.append({'id': i, 'value': i * 10, 'label': f'row_{i}'})
large_df = pd.DataFrame(rows)
widget = BuckarooInfiniteWidget(large_df)
return large_df, rows, widget
large_widget = BuckarooInfiniteWidget(large_df)
return large_df, rows, large_widget


@app.cell
Expand Down
Loading