From ac7391be7ad9b1b6ddb7d71505a4657db9b088b6 Mon Sep 17 00:00:00 2001 From: safina57 Date: Wed, 16 Sep 2026 18:16:45 +0100 Subject: [PATCH 1/2] feat(ci): add file change detection to workflows --- .github/workflows/test.yml | 62 ++++++++++++++++++- .../templates/test_orchestrator.jinja | 35 ++++++++++- 2 files changed, 95 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5bd58610b5..260825cb6c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -31,54 +31,113 @@ permissions: # if: false # TEMP: skipping, see PR #xxxx # uses: ./.github/workflows/test-integrations-dbs.yml jobs: + files-changed: + name: Detect changed files + runs-on: ubuntu-22.04 + timeout-minutes: 3 + permissions: + contents: read + pull-requests: read + outputs: + code: ${{ github.event_name != 'pull_request' || steps.changes.outputs.code == 'true' }} + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + if: github.event_name == 'pull_request' + - name: Check for code changes + id: changes + if: github.event_name == 'pull_request' + uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3 + with: + token: ${{ github.token }} + filters: | + code: + - '**' + - '!**/*.md' + - '!docs/**' + - '!LICENSE' + - '!.agents/**' + - '!.github/ISSUE_TEMPLATE/**' + - '!.github/CODEOWNERS' + - '!.git-blame-ignore-revs' common: name: Common + needs: files-changed + if: ${{ needs.files-changed.outputs.code == 'true' }} uses: ./.github/workflows/test-integrations-common.yml mcp: name: MCP + needs: files-changed + if: ${{ needs.files-changed.outputs.code == 'true' }} uses: ./.github/workflows/test-integrations-mcp.yml agents: name: Agents + needs: files-changed + if: ${{ needs.files-changed.outputs.code == 'true' }} uses: ./.github/workflows/test-integrations-agents.yml ai_workflow: name: AI Workflow + needs: files-changed + if: ${{ needs.files-changed.outputs.code == 'true' }} uses: ./.github/workflows/test-integrations-ai-workflow.yml ai: name: AI + needs: files-changed + if: ${{ needs.files-changed.outputs.code == 'true' }} uses: ./.github/workflows/test-integrations-ai.yml cloud: name: Cloud + needs: files-changed + if: ${{ needs.files-changed.outputs.code == 'true' }} uses: ./.github/workflows/test-integrations-cloud.yml dbs: name: DBs + needs: files-changed + if: ${{ needs.files-changed.outputs.code == 'true' }} uses: ./.github/workflows/test-integrations-dbs.yml flags: name: Flags + needs: files-changed + if: ${{ needs.files-changed.outputs.code == 'true' }} uses: ./.github/workflows/test-integrations-flags.yml gevent: name: Gevent + needs: files-changed + if: ${{ needs.files-changed.outputs.code == 'true' }} uses: ./.github/workflows/test-integrations-gevent.yml graphql: name: GraphQL + needs: files-changed + if: ${{ needs.files-changed.outputs.code == 'true' }} uses: ./.github/workflows/test-integrations-graphql.yml network: name: Network + needs: files-changed + if: ${{ needs.files-changed.outputs.code == 'true' }} uses: ./.github/workflows/test-integrations-network.yml tasks: name: Tasks + needs: files-changed + if: ${{ needs.files-changed.outputs.code == 'true' }} uses: ./.github/workflows/test-integrations-tasks.yml web_1: name: Web 1 + needs: files-changed + if: ${{ needs.files-changed.outputs.code == 'true' }} uses: ./.github/workflows/test-integrations-web-1.yml web_2: name: Web 2 + needs: files-changed + if: ${{ needs.files-changed.outputs.code == 'true' }} uses: ./.github/workflows/test-integrations-web-2.yml misc: name: Misc + needs: files-changed + if: ${{ needs.files-changed.outputs.code == 'true' }} uses: ./.github/workflows/test-integrations-misc.yml report: name: Combine and report coverage needs: + - files-changed - common - mcp - agents @@ -95,7 +154,7 @@ jobs: - web_2 - misc # Report whatever coverage exists, even if some test jobs failed. - if: ${{ !cancelled() }} + if: ${{ !cancelled() && needs.files-changed.outputs.code == 'true' }} runs-on: ubuntu-22.04 steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 @@ -126,6 +185,7 @@ jobs: check-required: name: All tests passed needs: + - files-changed - common - mcp - agents diff --git a/scripts/split_tox_gh_actions/templates/test_orchestrator.jinja b/scripts/split_tox_gh_actions/templates/test_orchestrator.jinja index c8944d3c65..c736f97761 100644 --- a/scripts/split_tox_gh_actions/templates/test_orchestrator.jinja +++ b/scripts/split_tox_gh_actions/templates/test_orchestrator.jinja @@ -36,20 +36,52 @@ permissions: # if: false # TEMP: skipping, see PR #xxxx # uses: ./.github/workflows/test-integrations-dbs.yml jobs: + files-changed: + name: Detect changed files + runs-on: ubuntu-22.04 + timeout-minutes: 3 + permissions: + contents: read + pull-requests: read + outputs: + code: {% raw %}${{ github.event_name != 'pull_request' || steps.changes.outputs.code == 'true' }}{% endraw %} + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + if: github.event_name == 'pull_request' + - name: Check for code changes + id: changes + if: github.event_name == 'pull_request' + uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3 + with: + token: {% raw %}${{ github.token }}{% endraw %} + filters: | + code: + - '**' + - '!**/*.md' + - '!docs/**' + - '!LICENSE' + - '!.agents/**' + - '!.github/ISSUE_TEMPLATE/**' + - '!.github/CODEOWNERS' + - '!.git-blame-ignore-revs' + {% for g in orchestrated_groups %} {{ g.id }}: name: {{ g.name }} + needs: files-changed + if: {% raw %}${{ needs.files-changed.outputs.code == 'true' }}{% endraw %} uses: ./.github/workflows/test-integrations-{{ g.slug }}.yml {% endfor %} report: name: Combine and report coverage needs: + - files-changed {% for g in orchestrated_groups %} - {{ g.id }} {% endfor %} # Report whatever coverage exists, even if some test jobs failed. - if: {% raw %}${{ !cancelled() }}{% endraw %} + if: {% raw %}${{ !cancelled() && needs.files-changed.outputs.code == 'true' }}{% endraw %} runs-on: ubuntu-22.04 steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 @@ -81,6 +113,7 @@ jobs: check-required: name: All tests passed needs: + - files-changed {% for g in orchestrated_groups %} - {{ g.id }} {% endfor %} From e265b56fafc1cc067790a05ce21e72be1e6090e3 Mon Sep 17 00:00:00 2001 From: safina57 Date: Wed, 16 Sep 2026 18:28:00 +0100 Subject: [PATCH 2/2] feat(ci): update paths-filter to use 'some-with-excludes' quantifier --- .github/workflows/test.yml | 1 + scripts/split_tox_gh_actions/templates/test_orchestrator.jinja | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 260825cb6c..91688d6e58 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -49,6 +49,7 @@ jobs: uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3 with: token: ${{ github.token }} + predicate-quantifier: some-with-excludes filters: | code: - '**' diff --git a/scripts/split_tox_gh_actions/templates/test_orchestrator.jinja b/scripts/split_tox_gh_actions/templates/test_orchestrator.jinja index c736f97761..8bf71a20e0 100644 --- a/scripts/split_tox_gh_actions/templates/test_orchestrator.jinja +++ b/scripts/split_tox_gh_actions/templates/test_orchestrator.jinja @@ -54,6 +54,7 @@ jobs: uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3 with: token: {% raw %}${{ github.token }}{% endraw %} + predicate-quantifier: some-with-excludes filters: | code: - '**'