feat: add app-chrome and variables to editor #473
Workflow file for this run
This file contains 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: {} | |
jobs: | |
test: | |
timeout-minutes: 10 | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash | |
env: | |
NODE_ENV: test | |
DEBUG: 'pw:webserver' | |
steps: | |
- name: 🛑 Cancel Previous Runs | |
uses: styfle/cancel-workflow-action@0.11.0 | |
- name: ⬇️ Checkout repo | |
uses: actions/checkout@v3 | |
- name: Write TOML | |
run: | | |
echo "[experimental]" > .marimo.toml | |
echo "layouts=true" >> .marimo.toml | |
- uses: pnpm/action-setup@v2 | |
with: | |
version: 8 | |
- name: ⎔ Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
cache: 'pnpm' | |
cache-dependency-path: '**/pnpm-lock.yaml' | |
- name: 📥 Install pnpm dependencies | |
working-directory: ./frontend | |
run: pnpm install | |
- name: 📦 Build frontend | |
run: ./scripts/buildfrontend.sh | |
- name: 🐍 Setup Python 3.10 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: 🐍 Install marimo | |
run: | | |
python -m pip install --upgrade pip | |
pip install . | |
- 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@v3 | |
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: npx playwright install chromium webkit --with-deps | |
- name: 🎭 Run Playwright tests | |
working-directory: ./frontend | |
run: npx playwright test | |
- name: 📸 Save screenshots | |
uses: getsentry/action-visual-snapshot@v2.0.0 | |
# Beta: Don't fail the build | |
# Only on main | |
if: github.ref == 'refs/heads/main' | |
continue-on-error: true | |
with: | |
save-only: true | |
snapshot-path: frontend/e2e-tests/screenshots | |
- name: 🤖 Diff screenshots | |
uses: getsentry/action-visual-snapshot@v2.0.0 | |
id: visual-snapshots-diff | |
# Only diff on PRs | |
if: github.ref != 'refs/heads/main' && github.event_name == 'pull_request' | |
# Beta: Don't fail the build | |
continue-on-error: true | |
with: | |
base-branch: main | |
api-endpoint: 'https://marimo.io/api' | |
api-token: ${{ secrets.VISUAL_SNAPSHOT_SECRET }} | |
gcs-bucket: 'marimo-oss-visual-snapshots' | |
snapshot-path: frontend/e2e-tests/screenshots | |
- name: 📊 Upload snapshots | |
uses: actions/upload-artifact@v3 | |
# Beta: Don't fail the build | |
continue-on-error: true | |
with: | |
name: visual-snapshots-diffs | |
path: | | |
${{ steps.visual-snapshots-diff.outputs.merge-base-images-path }} | |
${{ steps.visual-snapshots-diff.outputs.base-images-path }} | |
${{ steps.visual-snapshots-diff.outputs.results-path }} | |
retention-days: 1 | |
- name: 📊 Upload report | |
uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: playwright-report | |
path: frontend/playwright-report/ | |
retention-days: 1 |