From 03aac5dda9a007652f118e91963e7749fdad7182 Mon Sep 17 00:00:00 2001 From: Evanfeenstra Date: Tue, 15 Sep 2026 16:17:06 -0700 Subject: [PATCH] ci: only run each test workflow when the paths it actually exercises change Six pull_request test workflows ran on every PR regardless of what changed. gateway-check.yml already scopes itself to gateway/**; this gives the rest the same treatment, sized to what each one really compiles or reads (traced through the cargo commands and the crate graph: shared <- lsp <- ast <- standalone/skill/cli, with cli as its own workspace): - rust-test, rust-test-lsp `cargo test -p ast --lib` paths: ast, lsp, shared, root Cargo.toml/lock, self - rust-test-cli cli integration suite paths: cli, ast, lsp, shared, self - standalone-test `cargo test` over the whole root workspace paths-ignore: gateway, notes, cli, *.md - e2e-test, e2e-standalone index/standalone binary + mcp node server paths-ignore: gateway, notes, cli, skill, *.md The three cross-cutting workflows use paths-ignore rather than an include list because their real input set is nearly the whole repo; the failure mode of an ignore list is an unnecessary run, not a missed one. Each include-list workflow lists its own file so edits to the workflow still test themselves (same as gateway-check). main has no branch protection or rulesets, so a workflow that does not run for a PR simply does not appear; there is no required-check that could be left pending. Co-Authored-By: Claude --- .github/workflows/e2e-standalone.yml | 9 +++++++++ .github/workflows/e2e-test.yml | 9 +++++++++ .github/workflows/rust-test-cli.yml | 7 +++++++ .github/workflows/rust-test-lsp.yml | 8 ++++++++ .github/workflows/rust-test.yml | 8 ++++++++ .github/workflows/standalone-test.yml | 9 +++++++++ 6 files changed, 50 insertions(+) diff --git a/.github/workflows/e2e-standalone.yml b/.github/workflows/e2e-standalone.yml index 03bc3fe27..68523860b 100644 --- a/.github/workflows/e2e-standalone.yml +++ b/.github/workflows/e2e-standalone.yml @@ -1,8 +1,17 @@ name: Stakgraph E2E Standalone Test +# Builds the standalone binary (ast, lsp, shared, standalone) and the mcp node +# server, so nearly everything is an input. Skip only what it never compiles or +# reads: gateway (Go), notes, cli (separate workspace), skill, and docs. on: pull_request: branches: - main + paths-ignore: + - "gateway/**" + - "notes/**" + - "cli/**" + - "skill/**" + - "**.md" jobs: run-standalone-e2e-test: diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index 9d17c0580..925c6f078 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -1,8 +1,17 @@ name: Stakgraph E2E Test +# Builds the `index` binary (ast, lsp, shared) and the mcp node server, so nearly +# everything is an input. Skip only what it never compiles or reads: gateway (Go), +# notes, cli (separate workspace), skill, and docs. on: pull_request: branches: - main + paths-ignore: + - "gateway/**" + - "notes/**" + - "cli/**" + - "skill/**" + - "**.md" jobs: run-test: diff --git a/.github/workflows/rust-test-cli.yml b/.github/workflows/rust-test-cli.yml index dc3e1409e..7d13ee737 100644 --- a/.github/workflows/rust-test-cli.yml +++ b/.github/workflows/rust-test-cli.yml @@ -1,8 +1,15 @@ name: Stakgraph CLI Test +# cli is its own cargo workspace (own Cargo.lock) that path-depends on ast/lsp/shared. on: pull_request: branches: - main + paths: + - "cli/**" + - "ast/**" + - "lsp/**" + - "shared/**" + - ".github/workflows/rust-test-cli.yml" jobs: run-cli-test: diff --git a/.github/workflows/rust-test-lsp.yml b/.github/workflows/rust-test-lsp.yml index 4b91313fc..d977620b5 100644 --- a/.github/workflows/rust-test-lsp.yml +++ b/.github/workflows/rust-test-lsp.yml @@ -1,8 +1,16 @@ name: Stakgraph Unit Test (LSP) +# Same test surface as rust-test.yml (ast --lib), run with USE_LSP=true. on: pull_request: branches: - main + paths: + - "ast/**" + - "lsp/**" + - "shared/**" + - "Cargo.toml" + - "Cargo.lock" + - ".github/workflows/rust-test-lsp.yml" jobs: run-test-lsp: diff --git a/.github/workflows/rust-test.yml b/.github/workflows/rust-test.yml index 4be94c1cc..82e6e1cb3 100644 --- a/.github/workflows/rust-test.yml +++ b/.github/workflows/rust-test.yml @@ -1,8 +1,16 @@ name: Stakgraph Unit Test +# Only `cargo test -p ast --lib`: ast and the crates it pulls in (lsp, shared). on: pull_request: branches: - main + paths: + - "ast/**" + - "lsp/**" + - "shared/**" + - "Cargo.toml" + - "Cargo.lock" + - ".github/workflows/rust-test.yml" jobs: run-test: diff --git a/.github/workflows/standalone-test.yml b/.github/workflows/standalone-test.yml index 7e0e128ed..d9d7ff774 100644 --- a/.github/workflows/standalone-test.yml +++ b/.github/workflows/standalone-test.yml @@ -1,8 +1,17 @@ name: Stakgraph Standalone Test +# Runs `cargo test` over the whole root workspace (ast, lsp, shared, skill, standalone) +# and boots Neo4j from mcp/, so nearly everything is an input. Skip only the +# directories it provably never touches: gateway (Go), notes, cli (separate +# workspace, not a member), and docs. on: pull_request: branches: - main + paths-ignore: + - "gateway/**" + - "notes/**" + - "cli/**" + - "**.md" jobs: run-standalone-test: