Skip to content

feat: add upgrade command and expand SDK host allowlist #67

feat: add upgrade command and expand SDK host allowlist

feat: add upgrade command and expand SDK host allowlist #67

Workflow file for this run

name: SDK Tests (Full Matrix)
on:
# Manual trigger with option to run on specific branch
workflow_dispatch:
inputs:
branch:
description: "Branch to run tests on"
required: false
default: "main"
# Run on PR open to any branch (not on subsequent commits)
pull_request:
types: [opened]
paths:
- "sdk/**"
- ".github/workflows/sdk-tests.yml"
jobs:
test-python:
name: Python SDK Tests (Python ${{ matrix.python-version }}, ${{ matrix.os }})
runs-on: ${{ matrix.os }}
defaults:
run:
working-directory: sdk/python
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
python-version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: latest
virtualenvs-create: true
virtualenvs-in-project: true
- name: Cache Poetry dependencies
uses: actions/cache@v4
with:
path: sdk/python/.venv
key: venv-${{ runner.os }}-python-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
run: poetry install --no-interaction --no-root
- name: Install project
run: poetry install --no-interaction
# - name: Install optional integration test dependencies
# run: |
# # Install browser dependencies for browser-use tests
# poetry run playwright install chromium --with-deps
# continue-on-error: true
- name: Run unit tests with coverage
run: poetry run pytest tests/unit/ --cov --cov-report=xml --cov-report=term-missing -v
# - name: Run SDK integration tests
# env:
# OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
# ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
# run: |
# if [ -n "$OPENAI_API_KEY" ]; then
# echo "Running SDK integration tests..."
# poetry run pytest tests/integration/ -v -n auto --tb=short -ra
# else
# echo "⚠️ OPENAI_API_KEY not set - skipping integration tests"
# echo "Add OPENAI_API_KEY to repository secrets to enable integration tests"
# fi
# - name: Upload coverage reports
# uses: codecov/codecov-action@v4
# if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'
# with:
# file: ./sdk/python/coverage.xml
# flags: python-sdk
# name: python-sdk-coverage
# env:
# CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
test-typescript:
name: TypeScript SDK Tests (Node ${{ matrix.node-version }}, ${{ matrix.os }})
runs-on: ${{ matrix.os }}
defaults:
run:
working-directory: sdk/typescript
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
node-version: ["20.x", "22.x"]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
cache-dependency-path: sdk/typescript/package-lock.json
- name: Install dependencies
run: npm ci
- name: Build TypeScript
run: npm run build
- name: Run tests with coverage
run: npm run test:coverage
# - name: Upload coverage reports
# uses: codecov/codecov-action@v4
# if: matrix.os == 'ubuntu-latest' && matrix.node-version == '20.x'
# with:
# file: ./sdk/typescript/coverage/lcov.info
# flags: typescript-sdk
# name: typescript-sdk-coverage
# env:
# CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
# Summary job that other checks can depend on
all-sdk-tests:
name: All SDK Tests
needs: [test-python, test-typescript]
runs-on: ubuntu-latest
if: always()
steps:
- name: Check test results
run: |
if [ "${{ needs.test-python.result }}" != "success" ] || [ "${{ needs.test-typescript.result }}" != "success" ]; then
echo "One or more test jobs failed"
exit 1
fi
echo "All tests passed successfully!"