Skip to content

A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.

chore: split up test workflow so they only run when changed (#2241)

Myles Scolnick91fdc6ef6eb6
diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml
index 5f259a1fca..96f473035e 100644
--- a/.github/workflows/playwright.yml
+++ b/.github/workflows/playwright.yml
@@ -3,7 +3,13 @@ name: playwright
on:
push:
branches: [main]
- pull_request: {}
+ paths-ignore:
+ - 'docs/**'
+ - README.md
+ pull_request:
+ paths-ignore:
+ - 'docs/**'
+ - README.md
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
@@ -19,7 +25,7 @@ jobs:
shell: bash
env:
NODE_ENV: test
- DEBUG: "pw:webserver"
+ DEBUG: 'pw:webserver'
steps:
- name: 🛑 Cancel Previous Runs
@@ -41,8 +47,8 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: 20
- cache: "pnpm"
- cache-dependency-path: "**/pnpm-lock.yaml"
+ cache: 'pnpm'
+ cache-dependency-path: '**/pnpm-lock.yaml'
- uses: turbocache-build/turbocache-action@v1
@@ -52,8 +58,8 @@ jobs:
- name: 🐍 Setup Python 3.10
uses: actions/setup-python@v5
with:
- python-version: "3.10"
- cache: "pip"
+ python-version: '3.10'
+ cache: 'pip'
# We tried to add uv, but marimo is unable to
# start when installed.
diff --git a/.github/workflows/test.yaml b/.github/workflows/test_be.yaml
similarity index 57%
rename from .github/workflows/test.yaml
rename to .github/workflows/test_be.yaml
index 613f51dafa..2603a38f3a 100644
--- a/.github/workflows/test.yaml
+++ b/.github/workflows/test_be.yaml
@@ -1,78 +1,24 @@
-name: test
+name: Test BE
+# Run on push to main and pull requests
+# only for backend changes
on:
push:
branches: [main]
- pull_request: {}
+ paths:
+ - 'marimo/**'
+ - 'tests/**'
+ - 'pyproject.toml'
+ pull_request:
+ paths:
+ - 'marimo/**'
+ - 'tests/**'
+ - 'pyproject.toml'
env:
- TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
- TURBO_TEAM: marimo
MARIMO_SKIP_UPDATE_CHECK: 1
jobs:
- test_frontend:
- name: 🖥️ Lint, test, build frontend
- runs-on: ubuntu-latest
- timeout-minutes: 15
- defaults:
- run:
- working-directory: ./frontend
- shell: bash
-
- steps:
- - name: 🛑 Cancel Previous Runs
- uses: styfle/[email protected]
-
- - name: ⬇️ Checkout repo
- uses: actions/checkout@v4
- with:
- fetch-depth: 0 # so we can run --since on the main branch and turbo can do faster cache hashing
-
- - uses: pnpm/action-setup@v2
- with:
- version: 8
-
- - name: ⎔ Setup Node.js
- uses: actions/setup-node@v4
- with:
- node-version: 20
- cache: "pnpm"
- cache-dependency-path: "**/pnpm-lock.yaml"
-
- - uses: turbocache-build/turbocache-action@v1
-
- - name: 📥 Install dependencies
- run: pnpm install
-
- - name: 📦 pnpm dedupe
- if: github.event_name == 'pull_request'
- run: pnpm dedupe --check
-
- - name: 🧹 Lint
- run: pnpm turbo lint
-
- - name: 🔎 Type check
- run: pnpm turbo typecheck
-
- - name: 🧪 Test
- run: pnpm test
-
- - name: 📦 Build
- run: pnpm turbo build
- env:
- NODE_ENV: production
-
- - name: 📦 Build islands frontend
- env:
- NODE_ENV: production
- VITE_MARIMO_ISLANDS: "true"
- VITE_MARIMO_VERSION: "0.0.0"
- run: |
- npm version 0.0.0 --no-git-tag-version
- pnpm turbo build:islands
- ./islands/validate.sh
-
test_python:
name: Tests on ${{ matrix.os }}, Python ${{ matrix.python-version }} with ${{ matrix.dependencies }} dependencies
runs-on: ${{ matrix.os }}
@@ -84,33 +30,33 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
- dependencies: ["core", "core,optional"]
- python-version: ["3.8"]
+ dependencies: ['core', 'core,optional']
+ python-version: ['3.8']
include:
- os: ubuntu-latest
- python-version: "3.9"
- dependencies: "core"
+ python-version: '3.9'
+ dependencies: 'core'
- os: ubuntu-latest
- python-version: "3.10"
- dependencies: "core"
+ python-version: '3.10'
+ dependencies: 'core'
- os: ubuntu-latest
- python-version: "3.11"
- dependencies: "core"
+ python-version: '3.11'
+ dependencies: 'core'
- os: ubuntu-latest
- python-version: "3.12"
- dependencies: "core"
+ python-version: '3.12'
+ dependencies: 'core'
- os: ubuntu-latest
- python-version: "3.9"
- dependencies: "core,optional"
+ python-version: '3.9'
+ dependencies: 'core,optional'
- os: ubuntu-latest
- python-version: "3.10"
- dependencies: "core,optional"
+ python-version: '3.10'
+ dependencies: 'core,optional'
- os: ubuntu-latest
- python-version: "3.11"
- dependencies: "core,optional"
+ python-version: '3.11'
+ dependencies: 'core,optional'
- os: ubuntu-latest
- python-version: "3.12"
- dependencies: "core,optional"
+ python-version: '3.12'
+ dependencies: 'core,optional'
steps:
- name: 🛑 Cancel Previous Runs
uses: styfle/[email protected]
@@ -119,7 +65,7 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- cache: "pip"
+ cache: 'pip'
- name: 🐍 Setup uv
uses: yezz123/setup-uv@v4
# This step is needed since some of our tests rely on the index.html file
@@ -184,12 +130,3 @@ jobs:
uv pip install --upgrade pip
uv pip install .[testcore,testoptional]
pytest -v tests/ -k "not test_cli"
-
- typos:
- name: Check for typos
- runs-on: ubuntu-latest
- steps:
- - name: 🛑 Cancel Previous Runs
- uses: styfle/[email protected]
- - uses: actions/checkout@v4
- - uses: crate-ci/[email protected]
diff --git a/.github/workflows/test_cli.yaml b/.github/workflows/test_cli.yaml
index ff1ba6e674..9f4bdaee87 100644
--- a/.github/workflows/test_cli.yaml
+++ b/.github/workflows/test_cli.yaml
@@ -3,7 +3,13 @@ name: cli test
on:
push:
branches: [main]
- pull_request: {}
+ paths-ignore:
+ - 'docs/**'
+ - README.md
+ pull_request:
+ paths-ignore:
+ - 'docs/**'
+ - README.md
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
diff --git a/.github/workflows/test_fe.yaml b/.github/workflows/test_fe.yaml
new file mode 100644
index 0000000000..e7b00dece5
--- /dev/null
+++ b/.github/workflows/test_fe.yaml
@@ -0,0 +1,84 @@
+name: Test FE
+
+# Run on push to main and pull requests
+# only for changes in the frontend directory
+on:
+ push:
+ branches: [main]
+ paths:
+ - 'frontend/**'
+ - 'lsp/**'
+ - 'openapi/**'
+ pull_request:
+ paths:
+ - 'frontend/**'
+ - 'lsp/**'
+ - 'openapi/**'
+
+env:
+ TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
+ TURBO_TEAM: marimo
+ MARIMO_SKIP_UPDATE_CHECK: 1
+
+jobs:
+ test_frontend:
+ name: 🖥️ Lint, test, build frontend
+ runs-on: ubuntu-latest
+ timeout-minutes: 15
+ defaults:
+ run:
+ working-directory: ./frontend
+ shell: bash
+
+ steps:
+ - name: 🛑 Cancel Previous Runs
+ uses: styfle/[email protected]
+
+ - name: ⬇️ Checkout repo
+ uses: actions/checkout@v4
+ with:
+ fetch-depth: 0 # so we can run --since on the main branch and turbo can do faster cache hashing
+
+ - uses: pnpm/action-setup@v2
+ with:
+ version: 8
+
+ - name: ⎔ Setup Node.js
+ uses: actions/setup-node@v4
+ with:
+ node-version: 20
+ cache: 'pnpm'
+ cache-dependency-path: '**/pnpm-lock.yaml'
+
+ - uses: turbocache-build/turbocache-action@v1
+
+ - name: 📥 Install dependencies
+ run: pnpm install
+
+ - name: 📦 pnpm dedupe
+ if: github.event_name == 'pull_request'
+ run: pnpm dedupe --check
+
+ - name: 🧹 Lint
+ run: pnpm turbo lint
+
+ - name: 🔎 Type check
+ run: pnpm turbo typecheck
+
+ - name: 🧪 Test
+ run: pnpm test
+
+ - name: 📦 Build
+ run: pnpm turbo build
+ env:
+ NODE_ENV: production
+
+ - name: 📦 Build islands frontend
+ env:
+ NODE_ENV: production
+ VITE_MARIMO_ISLANDS: 'true'
+ VITE_MARIMO_VERSION: '0.0.0'
+ run: |
+ npm version 0.0.0 --no-git-tag-version
+ pnpm turbo build:islands
+ ./islands/validate.sh
diff --git a/.github/workflows/test_typos.yaml b/.github/workflows/test_typos.yaml
new file mode 100644
index 0000000000..cff819242c
--- /dev/null
+++ b/.github/workflows/test_typos.yaml
@@ -0,0 +1,15 @@
+name: Typos
+
+# Run on pull requests
+on:
+ pull_request: {}
+
+jobs:
+ typos:
+ name: Check for typos
+ runs-on: ubuntu-latest
+ steps:
+ - name: 🛑 Cancel Previous Runs
+ uses: styfle/[email protected]
+ - uses: actions/checkout@v4
+ - uses: crate-ci/[email protected]