Skip to content

Overhaul GitHub Actions workflows #747

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 13 commits into
base: master
Choose a base branch
from
Draft

Conversation

mhucka
Copy link
Collaborator

@mhucka mhucka commented May 30, 2025

This updates and overhauls all the workflows. Main changes:

  • split out some operations into separate, reusable workflows that are called from other workflows
  • split some workflows into separate files, for greater modularity and maintainability
  • assess what changed in a PR and avoid running workflows that don't need to run if the relevant types of files have not been changed
  • use pip package caching with setup-python
  • move as much cibuildwheels configuration into the pyproject.toml file
  • update versions of GitHub runners, actions, and Python versions of wheels built
  • add ability to invoke workflows manually, for testing
  • add best-practices elements such as job timeouts, workflow permission declarations, and more

mhucka added 12 commits May 30, 2025 15:47
Building Python wheels is done in more than one workflow. This
reusable workflow is based on the previous `bazeltest.yml`, with some
improvements:

- Addition of more platform combinations
- Use of Pip caching in setup-python
- Use of a parameter to control whether wheels are uploaded

A number of the environment variables for cibuildwheel previously
found in `bazeltest.yml` are now in the top-level `pyproject.toml`.
This workflow is used by other workflows to determine the types of
files that were changed in a PR.
The functionality of this workflow is subsumed by the new
`reusable_build_wheels.yaml` workflow.
This and the other new workflow `ci_build_library.yaml` subsume what
was previously in the workflow `testing_wheels.yml`. The latter used
to do both library build+test and wheel build+test; splitting out
those activities into separate, smaller workflows makes things more
modular and understandable.
This and the other new workflow `ci_build_wheel.yaml` subsume what was
previously in the workflow `testing_wheels.yml`. Despite its name, the
latter workflow used to do _both_ library build+test and wheel
build+test; splitting out those activities into separate, smaller
workflows makes things more modular and understandable.
This renames `python_format.yml` to `ci_format_checks.yaml`, to make
the purpose more clear from the file name and to allow for the
possibility that C++ format checks will be added later.

In addition, this makes the workflow check whether the changes in a PR
affected Python files. If not, execution is skipped, for greater
efficiency.

This also adds a `workflow_dispatch` event trigger so that this can be
invoked manually (e.g., for testing).
This renames `dockertest.yml` to `ci_docker_tests.yaml`, to make the
purpose more clear from the file name. In addition, it adds a step to
check whether the changes in a PR are such that trying to build Docker
images is warranted. (Specifically, if the only changes involve
documentation files, then there's no point in running the Docker tests.)
Changes:

- adds some best-practices elements (timeouts, permissions, etc.)
- makes the git checkout only use the latest files instead of grabbing
  the entire repo history
- use pip caching with setup-python
- changes the execution time to be at night in PST
This splits `testing_wheels.yml` into separate workflows for greater
modularity. The individual workflows now test whether the changes in a
PR involved code files, and skip execution if only documentation was
changed. In addition, the workflows have `workflow_dispatch` triggers
to allow manual invocation for testing.
Now that there's a separate reusable workflow for building wheels,
this workflow can invoke it instead of repeating the code.

In addition, this commit adds best-practices things like job timeouts,
commit hashes for action versions, and `workflow_dispatch` for manual
invocation.
@mhucka mhucka self-assigned this May 30, 2025
GitHub announced that `windows-2019` will be unsupported by June 30,
2025.
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.

1 participant