Skip to content

Add UV workflows#20

Merged
jtyoung84 merged 19 commits intomainfrom
merge-to-upstream
Jul 19, 2025
Merged

Add UV workflows#20
jtyoung84 merged 19 commits intomainfrom
merge-to-upstream

Conversation

@galenlynch
Copy link
Copy Markdown
Member

This creates three reusable workflows that perform

  • Linting and testing: ci-uv.yml
  • Automatic version bumping based on commit message: bump-version.yml
  • Creation of github release when a tag is pushed and, if desired, publishing to pypi: publish.yml

For these to be used by other repositories, they must be in the .github/workflows directory, as is stated in the reusable workflow documentation. However, they should not run on this repo, because reusable workflows must be trigerred on workflow_call—not push, pull, or the like.

I have also added example workflows in the examples/ folder that consume each of these reusable workflows, with conditional triggering in a way that I think makes sense:

  • Run CI on all pushes and pull requests, or manually. Skip if the commit was made by a bot or has "bump:" in the title, or if the PR is a draft, or manually triggered
  • Bump versions if the CI workflow completed successfully on main, or manually. Skip if the commit message started with "bump:"
  • Publish if a tag is pushed, or triggered manually on only a tag.

I have updated the README accordingly. Projects must be configured to use uv and have the listed dependencies to use ci-uv.yml.

I think at some point ci.yml should be replaced by the ci-uv.yml in this PR, possbily with some changes. The current ci.yml is not callable, as far as I can tell.

@galenlynch
Copy link
Copy Markdown
Member Author

Also each example uses concurrency groups to cancel duplicative workflows.

@galenlynch
Copy link
Copy Markdown
Member Author

@jtyoung84

@galenlynch
Copy link
Copy Markdown
Member Author

Whoops I just noticed that I accidentally deleted stuff in my branch, I will amend the PR to not delete the original files.

@galenlynch galenlynch requested a review from Copilot July 18, 2025 19:09

This comment was marked as outdated.

@jtyoung84 jtyoung84 self-requested a review July 18, 2025 19:56
@galenlynch galenlynch marked this pull request as draft July 18, 2025 21:27
@galenlynch
Copy link
Copy Markdown
Member Author

The copilot review made me realize that I need to change the optional deps part of my projects, and sync the project with uv without using --extras. I will fix that, and then mark the PR as ready for review.

@jtyoung84
Copy link
Copy Markdown
Collaborator

The copilot review made me realize that I need to change the optional deps part of my projects, and sync the project with uv without using --extras. I will fix that, and then mark the PR as ready for review.

Sounds good.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
In response to copilot code review
@galenlynch galenlynch requested a review from Copilot July 18, 2025 21:44

This comment was marked as outdated.

@galenlynch galenlynch requested a review from Copilot July 18, 2025 22:04

This comment was marked as outdated.

@galenlynch galenlynch requested a review from Copilot July 18, 2025 22:22
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

This PR introduces three reusable GitHub Actions workflows for UV-based Python projects, along with supporting configuration and documentation. The workflows provide automated CI/CD capabilities including testing, version bumping, and publishing.

  • Adds three reusable workflows: ci-uv.yml for linting/testing, bump-version.yml for automated versioning, and publish.yml for release creation and PyPI publishing
  • Provides example calling workflows demonstrating proper usage patterns with conditional triggering
  • Updates documentation with workflow requirements and conventional commit guidelines

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
.github/workflows/ci-uv.yml Reusable CI workflow with UV package manager, linting, testing, and wheel smoke testing
.github/workflows/bump-version.yml Automated version bumping using commitizen based on conventional commits
.github/workflows/publish.yml Release creation and optional PyPI publishing workflow
examples/ci-call.yml Example CI workflow with conditional execution logic
examples/bump-call.yml Example version bump workflow triggered by CI completion
examples/publish-call.yml Example publish workflow for tag-based releases
.github/dependabot.yml Dependabot configuration for GitHub Actions updates
README.md Updated documentation with workflow requirements and conventional commit guidelines

Comment thread examples/ci-call.yml Outdated
Comment thread .github/workflows/ci-uv.yml Outdated
Comment thread .github/workflows/publish.yml Outdated
@galenlynch
Copy link
Copy Markdown
Member Author

This works with all of the changes I made based on copilot's reviews. I just tested all of the workflows in https://github.com/AllenNeuralDynamics/aind-mri-utils

@galenlynch galenlynch marked this pull request as ready for review July 18, 2025 22:38
@jtyoung84 jtyoung84 requested a review from yosefmaru July 18, 2025 23:43
Copy link
Copy Markdown
Collaborator

@jtyoung84 jtyoung84 left a comment

Choose a reason for hiding this comment

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

Looks good. Thanks for the contribution.

@jtyoung84 jtyoung84 merged commit e2b2523 into AllenNeuralDynamics:main Jul 19, 2025
@galenlynch galenlynch deleted the merge-to-upstream branch July 19, 2025 00:09
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.

3 participants