Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 29, 2026

CI runs all SDK tests on every trigger, wasting resources. This splits the monolithic workflow into separate per-SDK workflows using native GitHub Actions path filtering so tests only run when relevant files change.

Changes

  • Remove push trigger: Redundant with PR and merge group coverage
  • Split into separate workflows: Created 4 independent workflow files (one per SDK):
    • nodejs-sdk-tests.yml - Node.js SDK tests
    • go-sdk-tests.yml - Go SDK tests
    • python-sdk-tests.yml - Python SDK tests
    • dotnet-sdk-tests.yml - .NET SDK tests
  • Use native path filtering: Each workflow uses on.pull_request.paths to filter when it runs:
    • Node.js SDK: nodejs/**, test/**, workflow files
    • Go/Python/.NET SDKs: SDK directory, test/**, nodejs/package.json (CLI dependency), workflow files
  • Fix composite action outputs: Add missing outputs declaration to setup-copilot action (pre-existing bug)
  • Fix .NET SDK tests: Added missing COPILOT_CLI_PATH environment variable to .NET test step

Example

name: "Node.js SDK Tests"

on:
  pull_request:
    paths:
      - 'nodejs/**'
      - 'test/**'
      - '.github/workflows/nodejs-sdk-tests.yml'
      - '.github/actions/setup-copilot/**'
  workflow_dispatch:
  merge_group:

jobs:
  test:
    name: "Node.js SDK Tests"
    runs-on: ${{ matrix.os }}
    # ... test steps

All workflows run unconditionally on workflow_dispatch and merge_group.

Original prompt

Right now we run the SDK e2e tests for all PRs, push, workflow_dispatch and merge. This seems inefficient:
1/ do we really need that on push? (if we have PR and merge group)
2/ we should only run the python tests if there are changes in the python/directory, or the test directory, or if nodejs/package.json changes (the go/python/dotnet SDKs also depend on nodejs/package.json, not on the rest of the files under nodejs)
3/ same thing for go, python, node

Basically, I want to make CI go faster.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 5 commits January 29, 2026 16:45
Co-authored-by: friggeri <106686+friggeri@users.noreply.github.com>
Co-authored-by: friggeri <106686+friggeri@users.noreply.github.com>
Co-authored-by: friggeri <106686+friggeri@users.noreply.github.com>
…flow files to filters

Co-authored-by: friggeri <106686+friggeri@users.noreply.github.com>
Co-authored-by: friggeri <106686+friggeri@users.noreply.github.com>
Copilot AI changed the title [WIP] Improve CI efficiency for SDK end-to-end tests Optimize CI: Path-based filtering and remove push trigger Jan 29, 2026
Copilot AI requested a review from friggeri January 29, 2026 16:55
@friggeri friggeri marked this pull request as ready for review January 29, 2026 17:00
@friggeri friggeri requested a review from a team as a code owner January 29, 2026 17:00
Copilot AI review requested due to automatic review settings January 29, 2026 17:00
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR optimizes the CI workflow by removing redundant triggers and adding path-based filtering to run SDK tests only when relevant files change. The changes reduce unnecessary test runs while ensuring comprehensive coverage through pull requests and merge groups.

Changes:

  • Removed push trigger for main branch (redundant with PR and merge group coverage)
  • Added path-based filtering using dorny/paths-filter@v3 to detect which SDKs have changed files
  • Fixed missing outputs declaration in setup-copilot composite action and updated all references

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
.github/workflows/sdk-e2e-tests.yml Removed push trigger, added changes detection job with path filters for each SDK, added conditional execution to all SDK test jobs with bypass for workflow_dispatch and merge_group events, updated COPILOT_CLI_PATH references
.github/actions/setup-copilot/action.yml Added missing outputs declaration for cli-path to fix composite action usage

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

steps:
- uses: actions/checkout@v6.0.2
- uses: ./.github/actions/setup-copilot
id: setup-copilot
Copy link

Copilot AI Jan 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The setup-copilot action is given an id here, but the corresponding COPILOT_CLI_PATH environment variable is not set in the .NET SDK test step (line 266-269). This is inconsistent with the other SDK tests (Node.js at line 100, Go at line 156, Python at line 209) which all use the setup-copilot outputs. The .NET SDK tests do use COPILOT_CLI_PATH (see dotnet/test/ClientTests.cs and dotnet/test/Harness/E2ETestContext.cs), so this environment variable should be added to the test step's env section.

Copilot uses AI. Check for mistakes.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems like the dotnet tests don't need it for some reason? they didn't have it before

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 2703e85. The .NET SDK workflow now includes COPILOT_CLI_PATH in the test step's environment variables, consistent with the other SDK tests.

@friggeri
Copy link
Collaborator

@copilot split that into one workflow per sdk and use the native github actions path filtering

devm33
devm33 previously approved these changes Jan 29, 2026
Co-authored-by: friggeri <106686+friggeri@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 29, 2026

@copilot split that into one workflow per sdk and use the native github actions path filtering

Done in 2703e85. Split into 4 separate workflows (nodejs-sdk-tests.yml, go-sdk-tests.yml, python-sdk-tests.yml, dotnet-sdk-tests.yml) using native GitHub Actions on.pull_request.paths filtering instead of the dorny/paths-filter action.

Copilot AI changed the title Optimize CI: Path-based filtering and remove push trigger Optimize CI: Split into separate workflows with native path filtering Jan 29, 2026
@friggeri friggeri added this pull request to the merge queue Jan 29, 2026
Merged via the queue into main with commit fc9b54e Jan 29, 2026
24 of 25 checks passed
@friggeri friggeri deleted the copilot/optimize-ci-workflow branch January 29, 2026 17:59
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.

3 participants