Skip to content

CI Add GHA aggregate job - #33508

Merged
lesteve merged 8 commits into
scikit-learn:mainfrom
sauravyadav1008:ci-aggregate-job
Mar 13, 2026
Merged

lesteve merged 8 commits into
scikit-learn:mainfrom
sauravyadav1008:ci-aggregate-job

Conversation

@sauravyadav1008

@sauravyadav1008 sauravyadav1008 commented Mar 10, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #33438

This PR adds an aggregating GitHub Actions job (all-tests) to summarize the
status of all unit test related jobs in the CI workflow.

The goal is to provide a single stable CI check that can be used as a required
status check instead of relying on multiple individual job names, which can be
brittle if jobs are renamed.

The new job depends on the following jobs:

  • lint
  • unit-tests
  • free-threaded
  • scipy-dev
  • debian-32bit

The all-tests job uses the re-actors/alls-green GitHub Action to aggregate
the results of these jobs. The job succeeds only if all required jobs succeed
and fails if any of them fail. Skipped jobs are handled correctly by the action.

This provides a single aggregated CI status that can be used as a required
check for pull requests.

I used AI assistance for:

  • Code generation (e.g., when writing an implementation or fixing a bug)
  • Test/benchmark generation
  • Documentation (including examples)
  • Research and understanding

Please let me know if the set of dependent jobs should be adjusted or if the
aggregating job should be placed in a different workflow.

@lesteve

lesteve commented Mar 12, 2026 •

Copy link
Copy Markdown
Member

Thanks for the PR!

Can you explain what your last commit does. It doesn't really seem necessary and introduce unrelated changes. Can you also explain how you tested your changes?

@sauravyadav1008

Copy link
Copy Markdown
Contributor Author

Thanks for the review!

The last commit adds the allowed-failures parameter to the re-actors/alls-green step in the all-tests job. During testing of the workflow on my fork, I observed that the free-threaded and scipy-dev jobs were sometimes skipped depending on the workflow conditions. Since these jobs are optional in the CI matrix, the aggregator job was failing because alls-green treats skipped jobs as failures by default.

Adding:
allowed-failures: free-threaded,scipy-dev
ensures that the aggregator does not fail when these optional jobs are skipped, while still failing if required jobs (e.g., lint, unit-tests, or debian-32bit) fail.

How I tested the changes

  1. I pushed the changes to my fork and triggered the workflow via a pull request.

  2. I inspected the workflow graph in GitHub Actions to confirm that the all-tests job runs after the dependent jobs (lint, unit-tests, free-threaded, scipy-dev, and debian-32bit).

  3. I verified the alls-green step logs to ensure it correctly aggregates job statuses and no longer fails when optional jobs are skipped.

  4. I confirmed that the all-tests job still fails when a required job fails.

Please let me know if you would prefer a different approach to handle optional jobs or if the aggregator should only depend on required jobs instead.

@lesteve

lesteve commented Mar 12, 2026

Copy link
Copy Markdown
Member

Can you use allowed-skips rather than allowed-failures, it seems to do what we want according to the doc.

Please also revert your unrelated changes, for example changing single quotes in double quotes or removing spaces. The diff should only be the addition of the re-actors/alls-green action with the correct config.

@lesteve lesteve changed the title Ci aggregate job (Fixes #33438) I Add GHA aggregate job Mar 12, 2026
@lesteve lesteve changed the title I Add GHA aggregate job CI Add GHA aggregate job Mar 12, 2026
@sauravyadav1008

Copy link
Copy Markdown
Contributor Author

Thanks for the suggestion!

I updated the configuration to use allowed-skips instead of allowed-failures,
since these jobs are optional and can legitimately be skipped depending on the
workflow conditions.

I also reverted unrelated formatting changes so that the diff only contains the
addition of the re-actors/alls-green action and its configuration.

Please let me know if anything else should be adjusted.

@lesteve
lesteve enabled auto-merge (squash) March 13, 2026 05:47

@lesteve lesteve left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, thanks!

@lesteve
lesteve merged commit c451b03 into scikit-learn:main Mar 13, 2026
33 checks passed
check-job-statuses:
name: Check all job statuses
runs-on: ubuntu-latest
if: always()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We should probably restrict this to only run in the main repo as well. I keep getting errors emails from my fork because other (required) jobs are skipped there by default.

Suggested change
if: always()
if: always() && github.repository == 'scikit-learn/scikit-learn'

@sauravyadav1008, would you be interested in adding this in a follow-up PR?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Indeed, good catch!

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.

Thanks, that makes sense. I can add this in a follow-up PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CI Add aggregating job in GHA to summarize statuses of all unit test jobs and be used a required check

3 participants