Smart Test Selection — Save CI Compute | Kramlipi
test-intel · beta · v0.1.7

Run tests on changed code only.

Map the PR diff to impacted tests — not the full suite every time. Save GitHub Actions minutes. Python/pytest live today. Go, Java, JS, .NET, Rust on the roadmap. No LLM key for selection.

✓ No GEMINI key for test-intel ✓ Secrets from GitHub Actions ✓ Full suite stays on main
Install Action → Download binary

Paste the workflow below · pin @v0.1.7

GitHub Actions · PR #42 · test-intel 12 tests
diff src/checkout.py (+14 −3)
skip 1,988 tests not in impact graph
run pytest -q tests/test_checkout.py
run tests/test_discounts.py::test_tax
report mr_test_report.json · method: heuristic
✓ verify_cmd → GITHUB_OUTPUT

What it does

Intelligent test selection on your runners.

Same job as CircleCI Smarter Testing — without leaving GitHub Actions.

Live

Python / pytest

Diff-scoped selection via collect-only + import heuristics + optional coverage.xml.

Roadmap

Go · Java · JS · .NET · Rust

Wire verify-cmd today. Collectors ship per language — no workflow rewrite.

Every stack today

Doc-only PR skip · JSON report · flake memory with CI cache.

How it works

Four steps. One verify command.

Fallback to full suite when confidence is low.

01
PR diffchanged files vs base branch
git
02
Impact mapcollect tests · match imports
plan
03
verify_cmdnarrowed pytest / go test / etc.
emit
04
CI runs selectionfull gate on main unchanged
save $

Secrets → Actions

Pull these from repository secrets.

Settings → Secrets and variables → Actions

Required

GITHUB_TOKEN

Built-in. Reference as ${{ secrets.GITHUB_TOKEN }}

Optional

CODE_AGENT_LICENSE_KEY

After Free CI quota. ${{ secrets.CODE_AGENT_LICENSE_KEY }}

Not needed

GEMINI_API_KEY

test-intel selection is heuristic-only. LLM keys are for bug-fix and code-review.

Copy-paste

GitHub Actions workflow

Save as .github/workflows/diff-scoped-tests.yml

diff-scoped-tests.yml yaml
name: Smart test selection (beta)
on:
  pull_request:
    types: [opened, synchronize]
permissions:
  contents: read
jobs:
  test-intel:
    runs-on: ubuntu-latest
    env:
      GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      CODE_AGENT_INSTALL_ID: github-actions:${{ github.repository_id }}
      CODE_AGENT_LICENSE_KEY: ${{ secrets.CODE_AGENT_LICENSE_KEY }}
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0
      - uses: kramlipi/code-agent-action@v0.1.7
        id: intel
        with:
          expert: test-intel
          version: code-agent-v0.1.7
          verify-cmd: pytest -q
          base-branch: ${{ github.base_ref }}
          pr: ${{ github.event.pull_request.number }}
          emit-ci: "true"
        env:
          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          CODE_AGENT_INSTALL_ID: github-actions:${{ github.repository_id }}
          CODE_AGENT_LICENSE_KEY: ${{ secrets.CODE_AGENT_LICENSE_KEY }}
      - run: ${{ steps.intel.outputs.verify_cmd }}

Swap verify-cmd: pytest -q · go test ./… · mvn -q test · npm test · dotnet test · cargo test

Try test-intel on one PR today.

Measure job time before/after. Keep full suite on main.

Get started →

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top