Skip to content

feat(ci): Add file change detection to workflows #3390

feat(ci): Add file change detection to workflows

feat(ci): Add file change detection to workflows #3390

Workflow file for this run

# Do not edit this YAML file. This file is generated automatically by executing
# python scripts/split_tox_gh_actions/split_tox_gh_actions.py
# The template responsible for it is in
# scripts/split_tox_gh_actions/templates/test_orchestrator.jinja
#
# Top-level test orchestrator. It runs every test group (each a reusable
# workflow) in a single run, then combines their coverage and reports it once.
name: Test
on:
push:
branches:
- master
- release/**
- major/**
pull_request:
# Cancel in progress workflows on pull_requests.
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
permissions:
contents: read
actions: read
checks: write
pull-requests: write
statuses: write
# To temporarily skip a group for unblocking a release,
# add `if: false` to its job below, e.g.:
#
# dbs:
# name: DBs
# 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 }}
predicate-quantifier: some-with-excludes
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
- ai_workflow
- ai
- cloud
- dbs
- flags
- gevent
- graphql
- network
- tasks
- web_1
- web_2
- misc
# Report whatever coverage exists, even if some test jobs failed.
if: ${{ !cancelled() && needs.files-changed.outputs.code == 'true' }}
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install uv
uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
- name: Download coverage data
# Artifacts from the reusable test workflows live in this same run.
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
pattern: coverage-*
merge-multiple: true
- name: Combine coverage and generate XML
run: |
uv sync
# relative_files + [tool.coverage.paths] let the 3.6/3.7 container and
# the runner data files merge into one source tree.
uv run coverage combine .coverage-sentry-*
uv run coverage xml
- name: Report coverage and test results
uses: getsentry/coverage-action@5f3f449cf9e909fd63513a48f27c57f090a5f321 # v0.4.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
files: coverage.xml
junit-xml-pattern: .junitxml-*
base-branch: master
post-pr-comment: true
verbose: true
check-required:
name: All tests passed
needs:
- files-changed
- common
- mcp
- agents
- ai_workflow
- ai
- cloud
- dbs
- flags
- gevent
- graphql
- network
- tasks
- web_1
- web_2
- misc
# Always run so it can gate merges even when a dependency failed.
if: always()
runs-on: ubuntu-22.04
steps:
- name: Check for failures
if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}
run: |
echo "One of the test jobs failed. You may need to re-run it." && exit 1