Skip to content

ci: smart CI — path-gated tests, caching, targeted pytest#5

Open
duducpp wants to merge 8 commits into
mainfrom
feat/ci-improvements
Open

ci: smart CI — path-gated tests, caching, targeted pytest#5
duducpp wants to merge 8 commits into
mainfrom
feat/ci-improvements

Conversation

@duducpp
Copy link
Copy Markdown
Owner

@duducpp duducpp commented May 12, 2026

Summary

  • Skip docs build when no relevant files changed (docs/**, src/**/*.py, pyproject.toml)
  • New composite action .github/actions/detect-ls-changes extracts which language servers changed and maps them to test paths
  • Pytest workflow: fast lint job + conditionally install only changed language server toolchains + run targeted pytest subset
  • Caches added: uv, Swift/swiftly, R, Julia, Perl, FPC, Cabal, Nix (weekly)

Test plan

  • PR with only docs change → only docs job runs, pytest skipped
  • PR touching single LS file (e.g. svelte_language_server.py) → only Svelte toolchain installed, only test/solidlsp/svelte runs
  • PR touching src/serena/ or pyproject.toml → full toolchain install + full test suite
  • workflow_dispatch on docs → always builds

duducpp added 8 commits May 12, 2026 18:53
- Add detect-changes job using tj-actions/changed-files
- Gate build job on docs/**, src/**/*.py, or pyproject.toml changes
- workflow_dispatch always runs regardless of path filter
- Detects which solidlsp language server files changed via tj-actions/changed-files
- Detects core solidlsp/serena file changes (triggers full test run)
- Extracts language IDs from super().__init__() 4th positional arg via AST
- Maps language IDs to test/solidlsp/* paths (handles html_ls, json_ls, yaml_ls overrides)
- Outputs: language-ids (JSON array), test-paths, any-ls-changed, core-changed
… runs

Path filtering:
- Workflow only triggers on src/**, test/**, pyproject.toml, uv.lock changes
- detect-changes job uses detect-ls-changes action to identify changed language servers

New lint job (fast, Ubuntu-only):
- Runs poe lint + poe type-check without installing any language servers
- Gated on Python/config file changes only

Caching (new):
- Swift toolchain (Linux ~/.local/share/swiftly, macOS ~/.swiftly) keyed by version
- R packages (~/R) keyed by R + languageserver version
- Julia depot (~/.julia) keyed by Julia + LanguageServer version
- Perl modules (~/perl5) keyed by OS
- FPC downloads (~/fpcsrc on macOS, ~/fpc + ~/fpcsrc on Windows) keyed by version
- Cabal store (~/.cabal/store + dist-newstyle) keyed by .cabal file hash
- Nix store via nix-community/cache-nix-action with weekly rotation

Conditional installs:
- Each language toolchain only installs when core-changed or its language ID appears
  in the changed language server files (elixir/erlang, clojure, cpp, java/kotlin/
  groovy/scala, csharp/fsharp, swift, ruby, ocaml, r, julia, haskell, zig,
  systemverilog, lua/luau, perl, ansible, haxe, elm, nix, rego, pascal, lean4,
  terraform, angular/typescript)

Targeted pytest:
- Runs pytest on specific test/solidlsp/<lang>/ paths when only LS files changed
- Falls back to full pytest test suite when core files changed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant