Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Sep 5, 2024
Merged
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
18 changes: 12 additions & 6 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -19,7 +25,7 @@ jobs:
shell: bash
env:
NODE_ENV: test
DEBUG: "pw:webserver"
DEBUG: 'pw:webserver'

steps:
- name: 🛑 Cancel Previous Runs
Expand All @@ -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

Expand All @@ -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.
Expand Down
125 changes: 31 additions & 94 deletions .github/workflows/test.yaml → .github/workflows/test_be.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
Expand All @@ -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]
Expand All @@ -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
Expand Down Expand Up @@ -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]
8 changes: 7 additions & 1 deletion .github/workflows/test_cli.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
84 changes: 84 additions & 0 deletions .github/workflows/test_fe.yaml
Original file line number Diff line number Diff line change
@@ -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
15 changes: 15 additions & 0 deletions .github/workflows/test_typos.yaml
Original file line number Diff line number Diff line change
@@ -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]
Loading