-
Notifications
You must be signed in to change notification settings - Fork 329
147 lines (125 loc) · 4.3 KB
/
playwright.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
name: playwright
on:
push:
branches: [main]
pull_request:
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: marimo
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:
- '**'
- '!docs/**'
- '!examples/**'
- '!README.md'
test:
needs: changes
if: ${{ needs.changes.outputs.playwright == 'true' }}
timeout-minutes: 16
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 "[experimental]" > .marimo.toml
echo "layouts=true" >> .marimo.toml
- uses: pnpm/action-setup@v2
with:
version: 9
- name: ⎔ Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
cache-dependency-path: '**/pnpm-lock.yaml'
- name: 📦 Build frontend
run: make fe
- name: 🐍 Setup Python 3.12
uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip'
# We tried to add uv, but marimo is unable to
# start when installed.
# - name: 🐍 Setup uv
# uses: yezz123/setup-uv@v4
# with:
# uv-venv: marimo-venv
- name: 🐍 Install marimo
run: |
python -m pip install --upgrade pip
pip install .
echo "MARIMO_VERSION=$(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