Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
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
220 changes: 220 additions & 0 deletions .github/workflows/ci-python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,220 @@
name: CI (Python)

on:
push:
branches: [main]
paths:
- ".github/workflows/ci-python.yml"
- "packages/control-plane/src/image-builds/timeouts.ts"
- "packages/daytona-infra/**"
- "packages/e2b-infra/**"
- "packages/modal-infra/**"
- "packages/sandbox-runtime/**"
- "packages/shared/src/types/integrations.ts"
- "ruff.toml"
- "terraform/environments/production/modal.tf"
- "terraform/modules/modal-app/scripts/deploy.sh"
- "!**/*.md"
pull_request:
branches: [main]
paths:
- ".github/workflows/ci-python.yml"
- "packages/control-plane/src/image-builds/timeouts.ts"
- "packages/daytona-infra/**"
- "packages/e2b-infra/**"
- "packages/modal-infra/**"
- "packages/sandbox-runtime/**"
- "packages/shared/src/types/integrations.ts"
- "ruff.toml"
- "terraform/environments/production/modal.tf"
- "terraform/modules/modal-app/scripts/deploy.sh"
- "!**/*.md"

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
lint-python-sandbox-runtime:
name: Lint & Format (Python - sandbox-runtime)
runs-on: ubuntu-latest
timeout-minutes: 5
defaults:
run:
working-directory: packages/sandbox-runtime
steps:
- name: Checkout
uses: actions/checkout@v6
with:
persist-credentials: false

- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: "3.12"
cache: "pip"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[dev]"

- name: Run Ruff linter
run: ruff check src/ tests/

- name: Run Ruff formatter check
run: ruff format --check src/ tests/

lint-python:
name: Lint & Format (Python - provider infra)
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@v6
with:
persist-credentials: false

- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: "3.12"
cache: "pip"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e packages/sandbox-runtime
pip install -e "packages/modal-infra[dev]"

- name: Run Ruff linter
run: ruff check packages/modal-infra/ packages/e2b-infra/ packages/daytona-infra/

- name: Run Ruff formatter check
run: ruff format --check packages/modal-infra/ packages/e2b-infra/ packages/daytona-infra/

typecheck-python:
name: TypeCheck (Python)
runs-on: ubuntu-latest
timeout-minutes: 5
defaults:
run:
working-directory: packages/modal-infra
steps:
- name: Checkout
uses: actions/checkout@v6
with:
persist-credentials: false

- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: "3.12"
cache: "pip"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ../sandbox-runtime
pip install -e ".[dev]"

- name: Run MyPy
run: mypy src/
continue-on-error: true # Allow failures initially as types are added

typecheck-python-sandbox-runtime:
name: TypeCheck (Python - sandbox-runtime)
runs-on: ubuntu-latest
timeout-minutes: 5
needs: [lint-python-sandbox-runtime]
defaults:
run:
working-directory: packages/sandbox-runtime
steps:
- name: Checkout
uses: actions/checkout@v6
with:
persist-credentials: false

- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: "3.12"
cache: "pip"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[dev]"

- name: Run MyPy
run: mypy src/
continue-on-error: true # Allow failures initially as types are added

test-python-sandbox-runtime:
name: Test (Python - sandbox-runtime)
runs-on: ubuntu-latest
timeout-minutes: 5
needs: [lint-python-sandbox-runtime]
defaults:
run:
working-directory: packages/sandbox-runtime
steps:
- name: Checkout
uses: actions/checkout@v6
with:
persist-credentials: false

- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: "3.12"
cache: "pip"

- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: "22"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[dev]"

- name: Run tests
run: pytest tests/ -v

- name: Run Node.js tests
run: node --test tests/*.test.mjs

test-python:
name: Test (Python - modal-infra)
runs-on: ubuntu-latest
timeout-minutes: 5
needs: [lint-python]
defaults:
run:
working-directory: packages/modal-infra
steps:
- name: Checkout
uses: actions/checkout@v6
with:
persist-credentials: false

- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: "3.12"
cache: "pip"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ../sandbox-runtime
pip install -e ".[dev]"

- name: Run tests
run: pytest tests/ -v
Loading
Loading