Skip to content

GHA: run tests on draft PRs#3926

Merged
jsiirola merged 7 commits intoPyomo:mainfrom
jsiirola:no-skip-draft-pr
May 4, 2026
Merged

GHA: run tests on draft PRs#3926
jsiirola merged 7 commits intoPyomo:mainfrom
jsiirola:no-skip-draft-pr

Conversation

@jsiirola
Copy link
Copy Markdown
Member

@jsiirola jsiirola commented May 3, 2026

Fixes # .

Summary/Motivation:

We moved to more actively using "Draft" PRs to communicate PR status between PR authors and the Review team. Unfortunately, we previously had GHA skip all tests when the PR was marked either "draft" or "WIP", which beans developers aren't getting build/test information. This PR updates the GHA runners so that tests are run for draft PRs, but not for tests marked "WIP".

As a bonus, this reworks the logic around code coverage: the runners are more standardized now, which also means that branches will get coverage computed on their jobs - but not uploaded to codecov.

Changes proposed in this PR:

  • Only skip GHA tests for "[WIP]" PRs (and run tests for draft PRs)
  • Standardize logic for running coverage

Legal Acknowledgement

By contributing to this software project, I have read the contribution guide and agree to the following terms and conditions for my contribution:

  1. I agree my contributions are submitted under the BSD license.
  2. I represent I am authorized to make the contributions and grant the license. If my employer has rights to intellectual property that includes these contributions, I represent that I have received permission to make contributions and grant the required license on behalf of that employer.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.98%. Comparing base (c1ce36d) to head (5a95227).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3926      +/-   ##
==========================================
- Coverage   89.98%   89.98%   -0.01%     
==========================================
  Files         904      904              
  Lines      106891   106891              
==========================================
- Hits        96191    96189       -2     
- Misses      10700    10702       +2     
Flag Coverage Δ
builders 29.15% <ø> (+<0.01%) ⬆️
default 86.31% <ø> (?)
expensive 35.59% <ø> (?)
linux 87.45% <ø> (-2.03%) ⬇️
linux_other 87.45% <ø> (+<0.01%) ⬆️
oldsolvers 28.09% <ø> (+<0.01%) ⬆️
osx 82.82% <ø> (ø)
win 85.88% <ø> (-0.01%) ⬇️
win_other 85.88% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor

@michaelbynum michaelbynum left a comment

Choose a reason for hiding this comment

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

Nice! I just have one question. Assuming the answer is no, this looks good to me.

- name: Upload codecov reports
if: github.repository_owner == 'Pyomo' || github.ref != 'refs/heads/main'
if: |
env.PYOMO_WORKFLOW != 'branch' &&
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't really know what this is doing. Will this prevent people from running tests on branches on forks?

Copy link
Copy Markdown
Contributor

@michaelbynum michaelbynum May 4, 2026

Choose a reason for hiding this comment

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

Oh, this is just codecov. Never mind.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Exactly: we were getting weird behavior on codecov when branches from forks (including the main branch on forks), and when the "branches" workflow would upload coverage results. THis logic makes sure that only the Pyomo main branch, as well as any PR builds are uploaded to codecov.

Comment thread .github/workflows/test_branches.yml Outdated
Comment thread .github/workflows/test_pr_and_main.yml Outdated
@jsiirola jsiirola merged commit 92be10f into Pyomo:main May 4, 2026
35 checks passed
@jsiirola jsiirola deleted the no-skip-draft-pr branch May 4, 2026 19:51
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