Skip to content

Fix workflow execution: coverage/build on workflow_dispatch, build on push to main#296

Merged
knoepfel merged 4 commits intomainfrom
copilot/fix-coverage-workflow-logic
Feb 9, 2026
Merged

Fix workflow execution: coverage/build on workflow_dispatch, build on push to main#296
knoepfel merged 4 commits intomainfrom
copilot/fix-coverage-workflow-logic

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 6, 2026

Three critical workflow issues prevented CI from running correctly:

  1. coverage.yaml didn't run when manually triggered via workflow_dispatch
  2. cmake-build.yaml didn't run when manually triggered via workflow_dispatch
  3. cmake-build.yaml didn't run on push to main/develop branches

Root Causes

Incorrect detect-changes handling: Jobs checked explicit event names (github.event_name == 'workflow_dispatch') instead of testing whether detect-changes was skipped. When detect-changes skips (workflow_dispatch, act, etc.), its result is 'skipped' not 'success', so conditions failed.

Missing push event: The pre-check job enumerated specific events but omitted push despite the workflow being triggered by push events.

Changes

coverage.yaml

# Before: explicit event checks
coverage:
  if: >
    github.event_name == 'workflow_dispatch' ||
    needs.pre-check.outputs.is_act == 'true' ||
    (needs.detect-changes.result == 'success' && ...)

# After: result-based pattern
coverage:
  if: >
    needs.detect-changes.result == 'skipped' ||
    (needs.detect-changes.result == 'success' && ...)

cmake-build.yaml

# Fix 1: Same result-based pattern for build job
build:
  if: >
    needs.detect-changes.result == 'skipped' ||
    (needs.detect-changes.result == 'success' && ...)

# Fix 2: Add push to pre-check condition
pre-check:
  if: >
    github.event_name == 'workflow_dispatch' ||
    github.event_name == 'pull_request' ||
    github.event_name == 'push' ||  # ← Added
    github.event_name == 'workflow_call' ||
    (issue_comment...)

This pattern matches all other check workflows (python-check, clang-tidy-check, etc.) and is more maintainable—no need to update conditions when adding new trigger events.

Original prompt

According to https://github.com/Framework-R-D/phlex/actions/runs/21765323541 (workflow_dispatch), we are not running the coverage unconditionally as expected. Please check and fix the workflow logic in coverage.yaml and other workflows if appropriate.


💡 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.

The coverage job was not running when triggered via workflow_dispatch
because detect-changes was being skipped, and the coverage job's
condition didn't handle the skipped state properly.

Changed the coverage job condition to match the pattern used in other
check workflows (e.g., python-check.yaml), which runs when
detect-changes is either skipped OR succeeded with changes.

Also updated detect-changes and coverage-skipped jobs to follow the
same pattern for consistency.

Co-authored-by: greenc-FNAL <2372949+greenc-FNAL@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix workflow logic for unconditional coverage execution Fix coverage workflow to run unconditionally on workflow_dispatch Feb 6, 2026
Copilot AI requested a review from greenc-FNAL February 6, 2026 20:51
@greenc-FNAL greenc-FNAL marked this pull request as ready for review February 6, 2026 20:58
Copilot AI review requested due to automatic review settings February 6, 2026 20:58
Updated the build job condition in cmake-build.yaml to use the same
pattern as other check workflows: checking if detect-changes was
skipped OR if it succeeded with changes.

This is functionally equivalent to the previous explicit event checks
but more maintainable and consistent:
- workflow_dispatch → detect-changes skipped → build runs
- issue_comment → detect-changes skipped → build runs
- workflow_call with skip-relevance-check → detect-changes skipped → build runs
- act environment → detect-changes skipped → build runs

Benefits:
1. Consistency with all other check workflows
2. Less maintenance when adding new trigger events
3. Simpler, more declarative logic

Co-authored-by: greenc-FNAL <2372949+greenc-FNAL@users.noreply.github.com>
Copy link
Copy Markdown
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

Adjusts the Code Coverage GitHub Actions workflow so the coverage job runs correctly when the workflow is manually triggered via workflow_dispatch, even though detect-changes is skipped in that event mode.

Changes:

  • Update coverage job gating to run when detect-changes is skipped, or when it ran and detected relevant changes.
  • Add a needs.pre-check.result == 'success' guard to detect-changes and coverage-skipped for consistency with other workflows.

Copilot AI changed the title Fix coverage workflow to run unconditionally on workflow_dispatch Fix workflow_dispatch execution in coverage and cmake-build workflows Feb 6, 2026
The pre-check job was missing 'push' in its event condition, causing
the entire workflow to be skipped when code was pushed to main or
develop branches.

Added github.event_name == 'push' to the pre-check job condition so
the workflow runs correctly for push events.

This ensures CI builds run automatically on every push to main/develop.

Co-authored-by: greenc-FNAL <2372949+greenc-FNAL@users.noreply.github.com>
Copilot AI changed the title Fix workflow_dispatch execution in coverage and cmake-build workflows Fix workflow execution: coverage/build on workflow_dispatch, build on push to main Feb 6, 2026
Copilot AI requested a review from greenc-FNAL February 6, 2026 21:16
@greenc-FNAL greenc-FNAL requested a review from knoepfel February 6, 2026 22:26
@knoepfel knoepfel merged commit 7cfe714 into main Feb 9, 2026
44 checks passed
@knoepfel knoepfel deleted the copilot/fix-coverage-workflow-logic branch February 9, 2026 14:37
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.

4 participants