ANTsX / ANTsPy

A fast medical imaging analysis library in Python with algorithms for registration, segmentation, and more.
https://antspyx.readthedocs.io
Apache License 2.0
592 stars 160 forks source link

Reduce CI workflow run time #567

Closed cookpa closed 3 months ago

cookpa commented 4 months ago

Problem: building wheels for every supported Python for every platform on each commit and PR takes too long

Ideas:

ncullen93 commented 4 months ago

I guess the issue here is that testing and wheel building are being done with the same workflow? If that's the case, perhaps another GHA workflow can be made for nightly wheel building and then the tests can be done on just the latest python version at every PR. I think that's more of a traditional workflow.

The main thing I care about is seeing feedback on the tests as quickly as possible after submitting a PR. Maybe I'm just impatient though.

cookpa commented 4 months ago

Locally, I have ANTsPy installed with pip install -e, so I just edit my code and run the tests right away. But I'm not sure how best to implement that in a runner.

ncullen93 commented 4 months ago

True, I will start using that as my primary testing method.

cookpa commented 4 months ago

Cool, when I get some time, I'll see if I can come up with something better on my fork. Something like:

  1. Set up conda
  2. Install an ANTsPy wheel from a cache
  3. Replace installed code with PR code
  4. Run tests
cookpa commented 3 months ago

@ncullen93 FYI if you put "[skip ci]" at the beginning of a commit message, it will not run the CI builds. However, this breaks the status badges. But it can be useful if you are doing a bunch of merges (be sure to put it in the merge commit message and not just the title), just let the tests run on the last one.

I'm still working on a streamlined unit test workflow

ncullen93 commented 3 months ago

Wow nice thanks for the tip

cookpa commented 3 months ago

The full complement of wheels is now building nightly via cron, fastest test for python-only changes runs on all pushes, intermediate test (one wheel per platform) available for manual testing as needed.