test notebook status #16933
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: playwright | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| permissions: | |
| contents: read | |
| env: | |
| MARIMO_SKIP_UPDATE_CHECK: 1 | |
| jobs: | |
| changes: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| playwright: ${{ steps.filter.outputs.playwright }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dorny/paths-filter@v3 | |
| id: filter | |
| with: | |
| filters: | | |
| playwright: | |
| - 'frontend/**' | |
| - 'marimo/**' | |
| - '.github/workflows/playwright.yml' | |
| test: | |
| needs: changes | |
| if: ${{ needs.changes.outputs.playwright == 'true' }} | |
| timeout-minutes: 13 # 2024-01-18 avg: 5.0m max: 7.0m | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| shell: bash | |
| env: | |
| NODE_ENV: test | |
| DEBUG: "pw:webserver" | |
| steps: | |
| - name: 🛑 Cancel Previous Runs | |
| uses: styfle/[email protected] | |
| - name: ⬇️ Checkout repo | |
| uses: actions/checkout@v4 | |
| - name: Write TOML | |
| run: | | |
| echo "[runtime]" > .marimo.toml | |
| echo "auto_instantiate=true" >> .marimo.toml | |
| echo "[experimental]" >> .marimo.toml | |
| echo "layouts=true" >> .marimo.toml | |
| # Turn on automatic instantiation for playwright tests | |
| - name: Update pyproject.toml | |
| run: | | |
| sed -i 's/auto_instantiate = false/auto_instantiate = true/' pyproject.toml | |
| - uses: pnpm/action-setup@v4 | |
| - name: ⎔ Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: "pnpm" | |
| cache-dependency-path: "**/pnpm-lock.yaml" | |
| - name: 📦 Build frontend | |
| run: make fe | |
| env: | |
| TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} | |
| TURBO_TEAM: marimo | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
| - name: 🐍 Setup uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| enable-cache: true | |
| python-version: 3.12 | |
| - name: 🐍 Install marimo | |
| run: | | |
| echo "MARIMO_VERSION=$(uv run marimo --version)" >> $GITHUB_ENV | |
| - name: 🎭 Get installed Playwright version | |
| id: playwright-version | |
| working-directory: ./frontend | |
| run: | | |
| PLAYWRIGHT_VERSION=$(pnpm ls @playwright/test | grep @playwright | sed 's/.*@//') | |
| echo "Playwright's Version: $PLAYWRIGHT_VERSION" | |
| echo "PLAYWRIGHT_VERSION=$PLAYWRIGHT_VERSION" >> $GITHUB_ENV | |
| - name: 📦 Cache playwright binaries | |
| uses: actions/cache@v4 | |
| id: playwright-cache | |
| with: | |
| path: | | |
| ~/.cache/ms-playwright | |
| key: ${{ runner.os }}-playwright-2-${{ env.PLAYWRIGHT_VERSION }} | |
| - name: 📥 Install Playwright Browsers | |
| working-directory: ./frontend | |
| if: steps.playwright-cache.outputs.cache-hit != 'true' | |
| run: pnpm playwright install chromium webkit --with-deps | |
| - name: 🎭 Run Playwright tests | |
| working-directory: ./frontend | |
| run: pnpm playwright test | |
| env: | |
| VITE_MARIMO_VERSION: ${{ env.MARIMO_VERSION }} | |
| # - name: ☁️ Google Auth | |
| # uses: google-github-actions/auth@v2 | |
| # # Skip on forks | |
| # if: github.event.pull_request.head.repo.organization == 'marimo-team' | |
| # with: | |
| # credentials_json: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }} | |
| # - name: 🌲 Get branch name | |
| # id: branch-name | |
| # uses: tj-actions/branch-names@v7 | |
| # - name: 📦 Upload to bucket (PR) | |
| # uses: google-github-actions/upload-cloud-storage@v2 | |
| # # Only on PRs and not forks | |
| # if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.organization == 'marimo-team' | |
| # with: | |
| # destination: marimo-oss-visual-snapshots/branches/${{ steps.branch-name.outputs.current_branch }} | |
| # path: frontend/e2e-tests/screenshots | |
| # - name: 📦 Upload to bucket (main) | |
| # uses: google-github-actions/upload-cloud-storage@v2 | |
| # # Only on main branch and not forks | |
| # if: github.event_name == 'push' && github.ref == 'refs/heads/main' && github.event.pull_request.head.repo.organization == 'marimo-team' | |
| # with: | |
| # destination: marimo-oss-visual-snapshots/main | |
| # path: frontend/e2e-tests/screenshots | |
| - name: 📊 Upload report | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: playwright-report | |
| path: frontend/playwright-report/ | |
| retention-days: 1 |