From 4a851a05ea37e9c13fe7831c96fdb2463fd5aacf Mon Sep 17 00:00:00 2001 From: Brace Sproul Date: Mon, 23 Feb 2026 19:11:41 -0800 Subject: [PATCH] ci: Add CI actions (#972) * ci: Add CI actions * cr * cr * cr --- .github/workflows/agent-ci.yml | 58 ++++++++++++++++++++++++++++++++ .github/workflows/ci.yml | 10 ++++++ .github/workflows/unit-tests.yml | 10 ++++++ apps/agent/Makefile | 17 ++++++++-- apps/agent/agent/server.py | 2 +- 5 files changed, 93 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/agent-ci.yml diff --git a/.github/workflows/agent-ci.yml b/.github/workflows/agent-ci.yml new file mode 100644 index 00000000..21e9edd4 --- /dev/null +++ b/.github/workflows/agent-ci.yml @@ -0,0 +1,58 @@ +name: Agent CI + +on: + push: + branches: ["main"] + paths: + - "apps/agent/**" + pull_request: + paths: + - "apps/agent/**" + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + lint: + name: Agent lint + runs-on: ubuntu-latest + defaults: + run: + working-directory: apps/agent + steps: + - uses: actions/checkout@v4 + - uses: astral-sh/setup-uv@v4 + - name: Install dependencies + run: uv sync --locked --extra dev + - name: Run lint + run: make lint + + format: + name: Agent format check + runs-on: ubuntu-latest + defaults: + run: + working-directory: apps/agent + steps: + - uses: actions/checkout@v4 + - uses: astral-sh/setup-uv@v4 + - name: Install dependencies + run: uv sync --locked --extra dev + - name: Run format check + run: make format-check + + unit-tests: + name: Agent unit tests + runs-on: ubuntu-latest + defaults: + run: + working-directory: apps/agent + steps: + - uses: actions/checkout@v4 + - uses: astral-sh/setup-uv@v4 + - name: Install dependencies + run: uv sync --locked --extra dev + - name: Run unit tests + run: make test diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5ea1b54b..27bc2309 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,7 +5,17 @@ name: CI on: push: branches: ["main"] + paths: + - "apps/web/**" + - "packages/shared/**" + - "*" + - ".*" pull_request: + paths: + - "apps/web/**" + - "packages/shared/**" + - "*" + - ".*" workflow_dispatch: # Allows triggering the workflow manually in GitHub UI # If another push to the same PR or branch happens while this workflow is still running, diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index d8bff89a..5cd56537 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -6,7 +6,17 @@ permissions: on: push: branches: ["main"] + paths: + - "apps/web/**" + - "packages/shared/**" + - "*" + - ".*" pull_request: + paths: + - "apps/web/**" + - "packages/shared/**" + - "*" + - ".*" workflow_dispatch: # Allows triggering the workflow manually in GitHub UI # If another push to the same PR or branch happens while this workflow is still running, diff --git a/apps/agent/Makefile b/apps/agent/Makefile index 788e203f..666594e1 100644 --- a/apps/agent/Makefile +++ b/apps/agent/Makefile @@ -1,4 +1,4 @@ -.PHONY: all format lint test tests integration_tests help run dev +.PHONY: all format format-check lint test tests integration_tests help run dev # Default target executed when no arguments are given to make. all: help @@ -23,10 +23,18 @@ install: TEST_FILE ?= tests/ test tests: - uv run pytest -vvv $(TEST_FILE) + @if [ -d "$(TEST_FILE)" ] || [ -f "$(TEST_FILE)" ]; then \ + uv run pytest -vvv $(TEST_FILE); \ + else \ + echo "Skipping tests: path not found: $(TEST_FILE)"; \ + fi integration_tests: - uv run pytest -vvv tests/integration_tests/ + @if [ -d "tests/integration_tests/" ] || [ -f "tests/integration_tests/" ]; then \ + uv run pytest -vvv tests/integration_tests/; \ + else \ + echo "Skipping integration tests: path not found: tests/integration_tests/"; \ + fi ###################### # LINTING AND FORMATTING @@ -42,6 +50,9 @@ format: uv run ruff format $(PYTHON_FILES) uv run ruff check --fix $(PYTHON_FILES) +format-check: + uv run ruff format $(PYTHON_FILES) --check + ###################### # HELP ###################### diff --git a/apps/agent/agent/server.py b/apps/agent/agent/server.py index ebb4a891..56d726af 100644 --- a/apps/agent/agent/server.py +++ b/apps/agent/agent/server.py @@ -28,11 +28,11 @@ from langchain_openai import ChatOpenAI from .encryption import decrypt_token from .integrations.langsmith import _create_langsmith_sandbox from .middleware import ( + TimeoutExecuteToolMiddleware, ToolErrorMiddleware, check_message_queue_before_model, open_pr_if_needed, post_to_linear_after_model, - TimeoutExecuteToolMiddleware, ) from .prompt import construct_system_prompt from .tools import commit_and_open_pr, fetch_url, http_request