Skip to content

Run full test matrix in automated dependency update workflow with reusable workflow pattern#39

Draft
Copilot wants to merge 10 commits intomainfrom
copilot/update-dependencies-workflow
Draft

Run full test matrix in automated dependency update workflow with reusable workflow pattern#39
Copilot wants to merge 10 commits intomainfrom
copilot/update-dependencies-workflow

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Dec 8, 2025

The automated dependency update workflow only ran smoke and unit tests on Ubuntu/Python 3.11, allowing broken dependencies to reach main.

Changes

Reusable Workflow Pattern (Single Source of Truth)

  • Created .github/workflows/test-matrix.yml as a reusable workflow defining the test matrix
  • Refactored both dependencies.yml and ci.yml to use the reusable workflow
  • Test matrix (OS/Python versions) now defined in one place, changes propagate automatically
  • Eliminates 53 lines of duplicated code across workflows

Workflow Structure

  • Split into update-and-test (matrix testing) and create-pr (only runs if all tests pass)
  • Added fail-fast: false to test all configurations even if one fails

Test Matrix

  • Before: 1 config (Ubuntu, Python 3.11, smoke + unit tests)
  • After: 9 configs (Ubuntu/Windows/macOS × Python 3.10/3.11/3.12, full test suite with 70% coverage)

Security

  • Added explicit permissions blocks (read-only for tests, write for PR creation)
  • CodeQL scan passed with 0 alerts

Documentation

  • Inline comments in test-matrix.yml explaining cache strategy and dependency sync logic

PR Template

  • Documents all tested configurations instead of requesting manual testing

Reusable Workflow Usage

The test matrix is now centrally defined and can be used by any workflow:

# For CI with frozen dependencies
jobs:
  test:
    uses: ./.github/workflows/test-matrix.yml
    with:
      frozen-deps: true
      update-deps: false

# For dependency updates
jobs:
  test:
    uses: ./.github/workflows/test-matrix.yml
    with:
      frozen-deps: false
      update-deps: true

Benefits

  • Single Source of Truth: Modify test matrix in one place, applies everywhere
  • Consistency: CI and dependency workflows use identical test configurations
  • Maintainability: Adding Python 3.13 support requires changing only one file
  • Code Quality: 74% reduction in dependencies.yml, 82% reduction in ci.yml full_tests job

To add a new Python version, edit only test-matrix.yml:

matrix:
  os: [ubuntu-latest, windows-latest, macos-latest]
  python-version: ['3.10', '3.11', '3.12', '3.13']  # ← Add here
Original prompt

This section details on the original issue you should resolve

<issue_title>[BUG] Change Update Dependencies Workflow to Run Full Matrix Tests</issue_title>
<issue_description>### Bug Description

The existing update deps workflow only does partial testing. This does not ensure that updating the dependencies wont break part of the codebase.

Steps to Reproduce

Run the workflow.

Expected Behavior

Run the full matrix of tests before making a pr into main and document that they all pass.

Error Message

Environment

Windows

Python Version

3.11.8

SEU Injection Framework Version

1.0.0+

PyTorch Version

No response

Installation Method

Source install (git clone + uv/pip install -e)

CUDA/GPU Information

  • Issue occurs with GPU/CUDA
  • Issue occurs with CPU only
  • Issue is related to device handling

Additional Context

No response

Pre-submission Checklist

  • I have searched existing issues for duplicates
  • I have provided a minimal reproducible example
  • I have included all relevant version information
  • I have tested with the latest version</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 4 commits December 8, 2025 23:18
Co-authored-by: Will-D-AER <197624355+Will-D-AER@users.noreply.github.com>
Co-authored-by: Will-D-AER <197624355+Will-D-AER@users.noreply.github.com>
…pdates)

Co-authored-by: Will-D-AER <197624355+Will-D-AER@users.noreply.github.com>
Co-authored-by: Will-D-AER <197624355+Will-D-AER@users.noreply.github.com>
Copilot AI changed the title [WIP] Update dependencies workflow to run full matrix tests Run full test matrix in automated dependency update workflow Dec 8, 2025
Copilot AI requested a review from Will-D-AER December 8, 2025 23:26
@Will-D-AER
Copy link
Copy Markdown
Collaborator

If this is not possible please let me know. I would like to have a consistent source of truth for my types of tests. Would this be possible? i.e. having a separate file containing the rules for the tests and our existing workflow files pointing towards this. This way the update dependency workflow can use the exact same tests used on main. @copilot

…ruth

Co-authored-by: Will-D-AER <197624355+Will-D-AER@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Dec 8, 2025

If this is not possible please let me know. I would like to have a consistent source of truth for my types of tests. Would this be possible? i.e. having a separate file containing the rules for the te...

Yes, this is absolutely possible! I've implemented a reusable workflow pattern to create a single source of truth for your test configurations.

Changes in commit 7324430:

  1. Created .github/workflows/test-matrix.yml - Reusable workflow defining the test matrix (3 OS × 3 Python versions)

  2. Refactored both workflows to call the reusable workflow:

    • dependencies.yml → calls with update-deps: true
    • ci.yml (full_tests) → calls with frozen-deps: true
  3. Added documentation in .github/workflows/README.md explaining the pattern

To modify the test matrix in the future, edit only test-matrix.yml:

matrix:
  os: [ubuntu-latest, windows-latest, macos-latest]
  python-version: ['3.10', '3.11', '3.12']

This change automatically applies to both the CI workflow and dependency update workflow, ensuring they always use identical test configurations.

Copilot AI and others added 3 commits December 8, 2025 23:48
Co-authored-by: Will-D-AER <197624355+Will-D-AER@users.noreply.github.com>
Co-authored-by: Will-D-AER <197624355+Will-D-AER@users.noreply.github.com>
Co-authored-by: Will-D-AER <197624355+Will-D-AER@users.noreply.github.com>
Copilot AI changed the title Run full test matrix in automated dependency update workflow Run full test matrix in automated dependency update workflow with reusable workflow pattern Dec 8, 2025
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Was there previously comments on the workflow in the readme. if not, then we should not add it now @copilot

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.

Correct, there was no README in the workflows directory before. Removed in commit 400040f.

The inline comments in test-matrix.yml still document the logic clearly.

Co-authored-by: Will-D-AER <197624355+Will-D-AER@users.noreply.github.com>
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.

[BUG] Change Update Dependencies Workflow to Run Full Matrix Tests

2 participants