name: CPU Test permissions: contents: read on: push: branches: [ main, stable/**/* ] pull_request: branches: [ main, stable/**/* ] workflow_dispatch: schedule: # Every day at noon and midnight - cron: '0 0,12 * * *' jobs: lint: strategy: matrix: setup: [fast, slow, next] fail-fast: false name: Lint - ${{ matrix.setup }} runs-on: ubuntu-latest timeout-minutes: 10 steps: - uses: actions/checkout@v6 - uses: astral-sh/setup-uv@v7 with: enable-cache: true python-version: '3.12' - name: Sync dependencies (fast) run: uv sync --frozen --group dev --no-default-groups if: matrix.setup == 'fast' - name: Upgrade dependencies (next) run: uv lock --upgrade if: matrix.setup == 'next' - name: Sync dependencies (slow) run: | uv sync --frozen \ --extra apo \ --extra weave \ --extra verl \ --extra mongo \ --group dev \ --group torch-cpu \ --group torch-stable \ --group trl \ --group tinker \ --group agents \ --group langchain \ --no-default-groups if: matrix.setup != 'fast' # This pre-commit skips JavaScript on purpose. - name: Run pre-commit uses: pre-commit/action@v3.0.1 - name: Check Python headers run: uv run --locked --no-sync scripts/check_headers.py if: matrix.setup == 'fast' - name: Run Black run: uv run --locked --no-sync black --check . if: matrix.setup != 'next' - name: Run isort run: uv run --locked --no-sync isort --check-only . if: matrix.setup != 'next' - name: Run pyright (fast) run: uv run --locked --no-sync pyright -p pyrightconfig.fast.json if: matrix.setup == 'fast' - name: Run pyright (slow) run: uv run --locked --no-sync pyright -p pyrightconfig.json if: matrix.setup != 'fast' lint-js: name: Lint - JavaScript runs-on: ubuntu-latest timeout-minutes: 10 steps: - uses: actions/checkout@v6 - uses: actions/setup-node@v6 with: node-version: '22' cache: 'npm' cache-dependency-path: dashboard/package-lock.json - name: Install dependencies run: cd dashboard && npm ci - name: Run ESLint run: cd dashboard && npm run eslint - name: Run Prettier run: cd dashboard && npm run prettier - name: Run Stylelint run: cd dashboard && npm run stylelint - name: Run Typecheck run: cd dashboard && npm run typecheck - name: Verify build run: cd dashboard && npm run build docs: name: Build documentation runs-on: ubuntu-latest timeout-minutes: 10 steps: - uses: actions/checkout@v6 with: fetch-depth: 0 - uses: actions/setup-python@v6 with: python-version: '3.12' - uses: astral-sh/setup-uv@v7 with: enable-cache: true - name: Sync dependencies run: uv sync --frozen --no-default-groups --group dev - name: Set source commit for docs run: | echo "SOURCE_COMMIT=${{ github.sha }}" >> $GITHUB_ENV - name: Verify OpenAPI specification is up-to-date run: | uv run --locked --no-sync python scripts/export_openapi.py git diff --exit-code docs/assets/store-openapi.json - name: Build documentation run: uv run --locked --no-sync mkdocs build --strict - name: Upload docs artifact uses: actions/upload-artifact@v6 with: name: documentation-site path: site/ compression-level: 6 test: strategy: matrix: mark: # store has many tests and is a good isolated group. - id: store display-name: Store pytest-mark: 'store' # AgentOps needs to be separated because it injects tricky global state. - id: agentops display-name: AgentOps pytest-mark: 'agentops' # Similar for Weave. - id: weave display-name: Weave pytest-mark: 'weave' # litellm proxy tests are slow - id: llmproxy display-name: LLM proxy pytest-mark: 'llmproxy' # Robustness of utilities is important. There are many tests. - id: utils display-name: Utilities pytest-mark: 'utils' # unmarked tests: adapter, execution engine, etc. - id: others display-name: Others pytest-mark: 'not store and not agentops and not weave and not llmproxy and not utils' env: - python-version: '3.10' setup-script: 'legacy' - python-version: '3.11' setup-script: 'stable' - python-version: '3.12' setup-script: 'stable' - python-version: '3.13' setup-script: 'latest' fail-fast: false name: Test (${{ matrix.mark.display-name }}, ${{ matrix.env.setup-script }}, Python ${{ matrix.env.python-version }}) runs-on: ubuntu-latest timeout-minutes: 15 steps: - uses: actions/checkout@v6 - uses: astral-sh/setup-uv@v7 with: enable-cache: true python-version: ${{ matrix.env.python-version }} - name: Upgrade dependencies (latest) run: uv lock --upgrade if: matrix.env.setup-script == 'latest' - name: Sync dependencies (latest) run: uv sync --frozen --no-default-groups --extra apo --extra weave --group dev --group agents --group langchain --group core-stable if: matrix.env.setup-script == 'latest' - name: Sync dependencies (stable & legacy) run: uv sync --frozen --no-default-groups --extra apo --extra weave --group dev --group agents --group langchain --group core-${{ matrix.env.setup-script }} if: matrix.env.setup-script != 'latest' - name: Freeze dependencies run: | set -ex uv pip freeze | tee requirements-freeze.txt echo "UV_LOCKED=1" >> $GITHUB_ENV echo "UV_NO_SYNC=1" >> $GITHUB_ENV - name: Upload dependencies artifact uses: actions/upload-artifact@v6 with: name: dependencies-${{ matrix.mark.id }}-${{ matrix.env.python-version }}-${{ matrix.env.setup-script }} path: requirements-freeze.txt compression-level: 0 - uses: actions/setup-node@v6 with: node-version: '22' cache: 'npm' cache-dependency-path: dashboard/package-lock.json - name: Install JavaScript dependencies run: cd dashboard && npm ci - name: Build dashboard run: cd dashboard && npm run build - name: Run tests run: | uv run pytest -v --durations=0 tests -m "not mongo and not openai and not gpu and (${{ matrix.mark.pytest-mark }})" env: PYTEST_ADDOPTS: "--color=yes" test-js: name: Test (JavaScript) runs-on: ubuntu-latest timeout-minutes: 15 steps: - uses: actions/checkout@v6 with: fetch-depth: 0 - uses: actions/setup-node@v6 with: node-version: '22' cache: 'npm' cache-dependency-path: dashboard/package-lock.json - uses: astral-sh/setup-uv@v7 with: enable-cache: true python-version: '3.12' - name: Sync Python dependencies run: uv sync --frozen --no-default-groups --extra apo --group dev --group agents --group core-stable - name: Install JavaScript dependencies run: cd dashboard && npm ci - name: Run vitest run: cd dashboard && npm run vitest