From 376398e887cd9c1789c6e25d59c5dee732f062c1 Mon Sep 17 00:00:00 2001 From: markijbema <624143+markijbema@users.noreply.github.com> Date: Thu, 25 Jun 2026 11:19:13 +0000 Subject: [PATCH 1/4] ci(github): implement path filtering to skip unit tests for JetBrains-only changes Add a `changes` job that uses `paths-filter` to detect if changes are restricted to the `packages/kilo-jetbrains/` directory. The `unit` job is updated to depend on this job and uses a dynamic matrix to skip execution on non-JetBrains platforms when only JetBrains files are modified, optimizing CI runtime. Co-authored-by: kiloconnect[bot] <240665456+kiloconnect[bot]@users.noreply.github.com> --- .github/workflows/test.yml | 66 ++++++++++++++++++++++++++++++-------- 1 file changed, 53 insertions(+), 13 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index dbb18d8a4d7..9577cf204dc 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,31 +22,67 @@ env: jobs: # kilocode_change start + changes: + name: detect non-JetBrains changes + runs-on: blacksmith-4vcpu-ubuntu-2404 + permissions: + contents: read + pull-requests: read + outputs: + settings: ${{ steps.matrix.outputs.settings }} + steps: + - name: Checkout repository + if: github.event_name != 'workflow_dispatch' + uses: actions/checkout@v6 + + - name: Detect non-JetBrains changes + if: github.event_name != 'workflow_dispatch' + id: filter + uses: Kilo-Org/paths-filter@668c092af3649c4b664c54e4b704aa46782f6f7c # v3 + with: + predicate-quantifier: every + filters: | + general: + - '**' + - '!packages/kilo-jetbrains/**' + + - name: Configure unit matrix + id: matrix + env: + GENERAL: ${{ github.event_name == 'workflow_dispatch' || steps.filter.outputs.general == 'true' }} + run: | + if [ "$GENERAL" = "true" ]; then + echo 'settings=[{"name":"linux","host":"blacksmith-4vcpu-ubuntu-2404","run":true},{"name":"macos","host":"macos-15","run":true},{"name":"windows","host":"blacksmith-4vcpu-windows-2025","run":true}]' >> "$GITHUB_OUTPUT" + exit 0 + fi + echo 'settings=[{"name":"linux","host":"blacksmith-4vcpu-ubuntu-2404","run":false}]' >> "$GITHUB_OUTPUT" + unit: name: unit (${{ matrix.settings.name }}) + needs: changes strategy: fail-fast: false matrix: - settings: - - name: linux - host: blacksmith-4vcpu-ubuntu-2404 # kilocode_change - - name: macos - host: macos-15 # kilocode_change - - name: windows - host: blacksmith-4vcpu-windows-2025 # kilocode_change + settings: ${{ fromJSON(needs.changes.outputs.settings) }} runs-on: ${{ matrix.settings.host }} timeout-minutes: 45 # kilocode_change defaults: run: shell: bash steps: + - name: Skip unchanged general unit tests + if: ${{ !matrix.settings.run }} + run: echo "Only JetBrains files changed; general unit tests are unchanged." + - name: Checkout repository + if: matrix.settings.run uses: actions/checkout@v6 # kilocode_change with: token: ${{ secrets.GITHUB_TOKEN }} # kilocode_change start - name: Setup Node + if: matrix.settings.run id: setup-node continue-on-error: ${{ runner.os == 'Windows' }} uses: actions/setup-node@v6 # kilocode_change @@ -54,18 +90,19 @@ jobs: node-version: "24" - name: Retry Setup Node on Windows - if: runner.os == 'Windows' && steps.setup-node.outcome == 'failure' + if: matrix.settings.run && runner.os == 'Windows' && steps.setup-node.outcome == 'failure' uses: actions/setup-node@v6 with: node-version: "24" # kilocode_change end - name: Setup Bun + if: matrix.settings.run uses: ./.github/actions/setup-bun # kilocode_change start - name: Setup Zig for Linux sandbox helper - if: runner.os == 'Linux' + if: matrix.settings.run && runner.os == 'Linux' run: | curl --fail --location --retry 3 \ https://ziglang.org/download/0.14.0/zig-linux-x86_64-0.14.0.tar.xz \ @@ -75,17 +112,19 @@ jobs: echo "$RUNNER_TEMP/zig-linux-x86_64-0.14.0" >> "$GITHUB_PATH" - name: Build Linux sandbox helper - if: runner.os == 'Linux' + if: matrix.settings.run && runner.os == 'Linux' run: | bun packages/opencode/script/kilocode/bubblewrap.ts --arch x64 --output "$RUNNER_TEMP/bwrap" echo "KILO_BWRAP_PATH=$RUNNER_TEMP/bwrap" >> "$GITHUB_ENV" # kilocode_change end - name: Configure git identity + if: matrix.settings.run run: | git config --global user.email "kilo-maintainer[bot]@users.noreply.github.com" git config --global user.name "kilo-maintainer[bot]" - name: Cache Turbo + if: matrix.settings.run uses: actions/cache@v5 # kilocode_change with: path: node_modules/.cache/turbo @@ -95,6 +134,7 @@ jobs: turbo-${{ runner.os }}- - name: Run unit tests + if: matrix.settings.run run: bun turbo test:ci --filter='!@kilocode/kilo-jetbrains' env: KILO_EXPERIMENTAL_DISABLE_FILEWATCHER: ${{ runner.os == 'Windows' && 'true' || 'false' }} @@ -102,13 +142,13 @@ jobs: # kilocode_change start - name: Run HttpApi exerciser gates - if: runner.os == 'Linux' + if: matrix.settings.run && runner.os == 'Linux' working-directory: packages/opencode run: bun run test:httpapi # kilocode_change end - name: Publish unit reports # kilocode_change - if: always() + if: always() && matrix.settings.run uses: mikepenz/action-junit-report@bccf2e31636835cf0874589931c4116687171386 # v6.4.0 with: report_paths: packages/*/.artifacts/unit/junit.xml @@ -118,7 +158,7 @@ jobs: fail_on_failure: false - name: Upload unit artifacts - if: always() + if: always() && matrix.settings.run uses: actions/upload-artifact@v7 # kilocode_change with: name: unit-${{ matrix.settings.name }}-${{ github.run_attempt }} From 8d449df39bd6fde3a70bcc43d2be70774dfe9ae9 Mon Sep 17 00:00:00 2001 From: markijbema <624143+markijbema@users.noreply.github.com> Date: Thu, 25 Jun 2026 12:59:26 +0000 Subject: [PATCH 2/4] fix(ci): retain full tests outside pull requests Co-authored-by: kiloconnect[bot] <240665456+kiloconnect[bot]@users.noreply.github.com> --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9577cf204dc..7d467cadb9b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -49,7 +49,7 @@ jobs: - name: Configure unit matrix id: matrix env: - GENERAL: ${{ github.event_name == 'workflow_dispatch' || steps.filter.outputs.general == 'true' }} + GENERAL: ${{ github.event_name != 'pull_request' || steps.filter.outputs.general == 'true' }} run: | if [ "$GENERAL" = "true" ]; then echo 'settings=[{"name":"linux","host":"blacksmith-4vcpu-ubuntu-2404","run":true},{"name":"macos","host":"macos-15","run":true},{"name":"windows","host":"blacksmith-4vcpu-windows-2025","run":true}]' >> "$GITHUB_OUTPUT" From 7b1383751fa3241e195a3a3e5d6ef15b7127b714 Mon Sep 17 00:00:00 2001 From: markijbema <624143+markijbema@users.noreply.github.com> Date: Fri, 26 Jun 2026 09:42:10 +0000 Subject: [PATCH 3/4] ci: skip general tests for isolated changes Co-authored-by: kiloconnect[bot] <240665456+kiloconnect[bot]@users.noreply.github.com> --- .github/workflows/test.yml | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7d467cadb9b..c06eda17a87 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -23,7 +23,7 @@ env: jobs: # kilocode_change start changes: - name: detect non-JetBrains changes + name: detect general unit test changes runs-on: blacksmith-4vcpu-ubuntu-2404 permissions: contents: read @@ -35,7 +35,7 @@ jobs: if: github.event_name != 'workflow_dispatch' uses: actions/checkout@v6 - - name: Detect non-JetBrains changes + - name: Detect general unit test changes if: github.event_name != 'workflow_dispatch' id: filter uses: Kilo-Org/paths-filter@668c092af3649c4b664c54e4b704aa46782f6f7c # v3 @@ -44,7 +44,31 @@ jobs: filters: | general: - '**' + - '!.changeset/**' - '!packages/kilo-jetbrains/**' + - '!packages/kilo-vscode/**' + - '!packages/kilo-docs/**' + - '!packages/extensions/zed/**' + - '!specs/**' + - '!perf/**' + - '!.github/ISSUE_TEMPLATE/**' + - '!.github/CODEOWNERS' + - '!.github/pull_request_template.md' + - '!.github/workflows/disabled/**' + - '!.idea/**' + - '!.vscode/**' + - '!.zed/**' + - '!kilocode-2.code-workspace' + - '!README*.md' + - '!AGENTS.md' + - '!CONTRIBUTING.md' + - '!PRIVACY.md' + - '!REVIEW.md' + - '!SECURITY.md' + - '!TESTING.md' + - '!LICENSE' + - '!logo.png' + - '!screenshot-uk.png' - name: Configure unit matrix id: matrix @@ -72,7 +96,7 @@ jobs: steps: - name: Skip unchanged general unit tests if: ${{ !matrix.settings.run }} - run: echo "Only JetBrains files changed; general unit tests are unchanged." + run: echo "Only isolated product, documentation, or metadata files changed; general unit tests are unchanged." - name: Checkout repository if: matrix.settings.run From ef3e8cbffd88dfa6eab3163dbd7ccf5d7af6b792 Mon Sep 17 00:00:00 2001 From: Mark IJbema Date: Fri, 26 Jun 2026 15:36:08 +0200 Subject: [PATCH 4/4] remove overly specific ones --- .github/workflows/test.yml | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c06eda17a87..96c15f41d0b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -51,24 +51,6 @@ jobs: - '!packages/extensions/zed/**' - '!specs/**' - '!perf/**' - - '!.github/ISSUE_TEMPLATE/**' - - '!.github/CODEOWNERS' - - '!.github/pull_request_template.md' - - '!.github/workflows/disabled/**' - - '!.idea/**' - - '!.vscode/**' - - '!.zed/**' - - '!kilocode-2.code-workspace' - - '!README*.md' - - '!AGENTS.md' - - '!CONTRIBUTING.md' - - '!PRIVACY.md' - - '!REVIEW.md' - - '!SECURITY.md' - - '!TESTING.md' - - '!LICENSE' - - '!logo.png' - - '!screenshot-uk.png' - name: Configure unit matrix id: matrix