Skip to content

Use reusable workflow to eliminate setup duplication between test and collateral#199

Draft
Copilot wants to merge 3 commits intomainfrom
copilot/explore-reusable-workflows
Draft

Use reusable workflow to eliminate setup duplication between test and collateral#199
Copilot wants to merge 3 commits intomainfrom
copilot/explore-reusable-workflows

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 27, 2026

test and collateral jobs duplicated setup steps, making it easy to add a workaround to one but forget the other — critical because diffcov in collateral actually runs the tests and needs identical setup.

Changes

  • New .github/workflows/test-suite.yml — reusable workflow_call workflow encapsulating all shared logic:

    • Inputs: python (default 3.x), platform (default ubuntu-latest), tox-env (default empty)
    • fetch-depth: 0 (required for diffcov)
    • Conditional system dep install for Python 3.15/ubuntu (now applies to both test and diffcov automatically)
    • Setup Python → install tox → run tox or tox -e <env> based on tox-env input
    • Shared env vars (FORCE_COLOR, TOX_OVERRIDE, etc.)
  • Updated main.yml — both test and collateral now delegate to the reusable workflow:

test:
  strategy:
    matrix: { python: [...], platform: [...] }
  uses: ./.github/workflows/test-suite.yml
  with:
    python: ${{ matrix.python }}
    platform: ${{ matrix.platform }}
  continue-on-error: ${{ matrix.python == '3.15' }}

collateral:
  strategy:
    matrix: { job: [diffcov, docs] }
  uses: ./.github/workflows/test-suite.yml
  with:
    platform: ubuntu-latest
    tox-env: ${{ matrix.job }}

Copilot AI changed the title [WIP] Explore reusable workflows for shared CI behavior Use reusable workflow to eliminate setup duplication between test and collateral Apr 27, 2026
Copilot AI requested a review from jaraco April 27, 2026 16:22
Comment on lines +20 to +30
env:
# Environment variable to support color support (jaraco/skeleton#66)
FORCE_COLOR: 1

# Suppress noisy pip warnings
PIP_DISABLE_PIP_VERSION_CHECK: 'true'
PIP_NO_WARN_SCRIPT_LOCATION: 'true'

# Ensure tests can sense settings about the environment
TOX_OVERRIDE: >-
testenv.pass_env+=GITHUB_*,FORCE_COLOR
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

@copilot This content is duplicated with main.yml. Is it possible for it to be shared or only defined in one place?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

GitHub Actions doesn't propagate a calling workflow's env into a reusable workflow — they're separate contexts, so the duplication was previously unavoidable.

Since test and collateral now fully delegate to test-suite.yml, the env block in main.yml was no longer serving any job there (the only remaining inline-step job is release, which doesn't need those vars). Removed it in 62e53f8 — the env is now defined in one place only (test-suite.yml).

Copilot AI requested a review from jaraco April 27, 2026 16:28
Copy link
Copy Markdown
Contributor

@webknjaz webknjaz left a comment

Choose a reason for hiding this comment

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

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.

tests and collateral share some behavior implicitly

3 participants