Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
bc3dcee
Refactoring min-dep tests
ericspod Sep 8, 2025
2b9a992
Update test
ericspod Sep 8, 2025
44bc1ae
Update test
ericspod Sep 8, 2025
0c8c868
Restoring include that worked
ericspod Sep 8, 2025
e3616e4
Renaming file
ericspod Sep 8, 2025
53cb0a4
Combining tests
ericspod Sep 8, 2025
28f06ff
Removing combined file
ericspod Sep 8, 2025
4d88075
Script update
ericspod Sep 8, 2025
d7e1451
Fix
ericspod Sep 8, 2025
7fc6107
Update with GPU runner
ericspod Sep 8, 2025
3a2381c
Whoops
ericspod Sep 8, 2025
95b7310
Adding GPU check
ericspod Sep 8, 2025
d8128f4
Fix
ericspod Sep 8, 2025
f17ec42
Merge branch 'dev' into cicd_test_update
ericspod Nov 11, 2025
55c351c
Update with merge
ericspod Nov 12, 2025
4d58d5b
Removing Python 3.9 tests, adding Python 3.13 and Pytorch 2.9 tests
ericspod Nov 12, 2025
29a2ff6
Further changes for 3.9 to 3.10
ericspod Nov 12, 2025
d309fe9
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 12, 2025
aa3080b
Whoops
ericspod Nov 12, 2025
f990178
Merge branch 'cicd_test_update' of github.com:ericspod/MONAI into cic…
ericspod Nov 12, 2025
fabc538
Adding ignore paths to stop tests triggering when documentation changed
ericspod Dec 7, 2025
309c312
Merge remote-tracking branch 'origin/dev' into cicd_test_update
ericspod Dec 7, 2025
8908725
Experimental image cleaning
ericspod Dec 7, 2025
18f640d
Fix
ericspod Dec 7, 2025
4ec2800
Always import npt
ericspod Dec 7, 2025
27cb347
Disk size optimisation
ericspod Dec 7, 2025
3c5a3da
Fix
ericspod Dec 7, 2025
5fbc0cb
Merge branch 'dev' into cicd_test_update
ericspod Feb 28, 2026
99e6a62
Merge branch 'dev' into cicd_test_update
ericspod Feb 28, 2026
c4155a4
Merge branch 'dev' into cicd_test_update
ericspod Apr 1, 2026
f26ba2a
Merge branch 'cicd_test_update' of github.com:ericspod/MONAI into cic…
ericspod Apr 1, 2026
ea2816a
Updates with version bumps
ericspod Apr 3, 2026
3841908
Merge branch 'dev' into cicd_test_update
ericspod Apr 3, 2026
63a92bf
Syntax fix
ericspod Apr 3, 2026
b669526
Syntax fix
ericspod Apr 3, 2026
22fe6ca
Pre-commit fix
ericspod Apr 3, 2026
edcbffe
Redundant file
ericspod Apr 3, 2026
30616b1
Syntax fix
ericspod Apr 3, 2026
0b6ec1c
Matrix restrictions
ericspod Apr 3, 2026
6782838
Updates for new black formatting
ericspod Apr 4, 2026
87c6fee
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Apr 4, 2026
9b38586
Format fixes and script fixes
ericspod Apr 4, 2026
6309f30
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Apr 4, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
193 changes: 159 additions & 34 deletions .github/workflows/pythonapp.yml → .github/workflows/cicd_tests.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Jenkinsfile.monai-premerge
name: premerge
name: tests

on:
# quick tests for pull requests and the releasing branches
Expand All @@ -8,52 +7,176 @@ on:
- dev
- main
- releasing/*
paths-ignore: # skip if only docs are modified
- '**.md'
- '**.rst'
- 'docs/**'
pull_request:
head_ref-ignore:
- dev
paths-ignore: # skip if only docs are modified
- '**.md'
- '**.rst'
- 'docs/**'

concurrency:
# automatically cancel the previously triggered workflows when there's a newer version
group: build-${{ github.event.pull_request.number || github.ref }}
group: cicd-tests-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

# Supported versions of Python and PyTorch are listed here for use below and as documentation
env:
# supported versions of Python
PYTHON_VER1: '3.10'
PYTHON_VER2: '3.11'
PYTHON_VER3: '3.12'
PYTHON_VER4: '3.13'
PYTHON_VER5: '3.14'
# supported versions of PyTorch
PYTORCH_VER1: '2.8.0'
PYTORCH_VER2: '2.9.1'
PYTORCH_VER3: '2.10.0'
PYTORCH_VER4: '2.11.0'
TORCHVISION_VER: '0.23.0' # used for testing with lowest PyTorch version
PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION: python # https://github.com/Project-MONAI/MONAI/issues/4354

# These jobs run the CICD tests, type checking, and testing packaging. These use the minimum supported versions of
# Python and PyTorch in many places using the above environment variables but also hard coded where necessary.
# When support is dropped for a version it is important to update these as appropriate.

jobs:
# caching of these jobs:
# - docker-py3-pip- (shared)
# - ubuntu py37 pip-
# - os-latest-pip- (shared)
flake8-py3:
static-checks: # Perform static type and other checks using runtests.sh
runs-on: ubuntu-latest
strategy:
matrix:
opt: ["codeformat", "pytype", "mypy"]
steps:
- name: Clean unused tools
run: |
find /opt/hostedtoolcache/* -maxdepth 0 ! -name 'Python' -exec rm -rf {} \;
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/ghc /usr/local/.ghcup
sudo docker system prune -f

- uses: actions/checkout@v6
- name: Set up Python 3.9
- name: Set up Python ${{ env.PYTHON_VER1 }}
uses: actions/setup-python@v6
with:
python-version: '3.9'
python-version: ${{ env.PYTHON_VER1 }}
cache: 'pip'
- name: Install dependencies
run: |
find /opt/hostedtoolcache/* -maxdepth 0 ! -name 'Python' -exec rm -rf {} \;
python -m pip install --upgrade pip wheel
python -m pip install --no-build-isolation -r requirements-dev.txt
- name: Lint and type check
run: |
# clean up temporary files
$(pwd)/runtests.sh --build --clean
# Github actions have 2 cores, so parallelize pytype
$(pwd)/runtests.sh --build --${{ matrix.opt }} -j 2
# Github actions have multiple cores, so parallelize pytype
$(pwd)/runtests.sh --build --${{ matrix.opt }} -j $(nproc --all)

min-dep: # Test with minumum dependencies installed for different OS, Python, and PyTorch combinations
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# Base test cases are to test on all three OSes with the lowest versions of Python and PyTorch, other cases are
# added below as special cases to cover other Python and PyTorch versions under Ubuntu
os: [windows-latest, macOS-latest, ubuntu-latest]
python-version: ['3.10']
pytorch-version: ['2.8.0']
include:
# Test Python versions under Ubuntu with lowest PyTorch version supported
- os: ubuntu-latest
pytorch-version: '2.8.0'
python-version: '3.11'
- os: ubuntu-latest
pytorch-version: '2.8.0'
python-version: '3.12'
- os: ubuntu-latest
pytorch-version: '2.8.0'
python-version: '3.13'
- os: ubuntu-latest
pytorch-version: '2.9.0'
python-version: '3.14'

# Test PyTorch versions under Ubuntu with lowest Python version supported
- os: ubuntu-latest
python-version: '3.10'
pytorch-version: '2.9.1'
- os: ubuntu-latest
python-version: '3.10'
pytorch-version: '2.10.0'
- os: ubuntu-latest
python-version: '3.10'
pytorch-version: '2.11.0'

timeout-minutes: 40
steps:
- if: runner.os == 'Linux'
name: Clean unused tools
run: |
find /opt/hostedtoolcache/* -maxdepth 0 ! -name 'Python' -exec rm -rf {} \;
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/ghc /usr/local/.ghcup
sudo docker system prune -f
- uses: actions/checkout@v6
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Prepare pip wheel
run: |
which python
python -m pip install --upgrade pip wheel
python -m pip install --user more-itertools>=8.0
- name: Install the minimum dependencies
run: |
# min. requirements
python -m pip install torch==${{ matrix.pytorch-version }}
python -m pip install -r requirements-min.txt
python -m pip list
BUILD_MONAI=0 python setup.py develop # no compile of extensions
shell: bash
- if: matrix.os == 'linux-gpu-runner'
name: Print GPU Info
run: |
nvidia-smi
python -c 'import torch; print(torch.rand(2,2).to("cuda:0"))'
shell: bash
- name: Run quick tests
run: |
python -c 'import torch; print(torch.__version__); print(torch.rand(5,3))'
python -c "import monai; monai.config.print_config()"
# ./runtests.sh --min
shell: bash
env:
QUICKTEST: True
NGC_API_KEY: ${{ secrets.NGC_API_KEY }}
NGC_ORG: ${{ secrets.NGC_ORG }}
NGC_TEAM: ${{ secrets.NGC_TEAM }}

quick-py3: # full dependencies installed tests for different OS
full-dep: # Test with full dependencies installed for different OS runners
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest, macOS-latest, ubuntu-latest]
timeout-minutes: 120
env:
QUICKTEST: True
steps:
- if: runner.os == 'Linux'
name: Clean unused tools
run: |
find /opt/hostedtoolcache/* -maxdepth 0 ! -name 'Python' -exec rm -rf {} \;
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/ghc /usr/local/.ghcup
sudo docker system prune -f
- if: runner.os == 'windows'
name: Config pagefile (Windows only)
uses: al-cheb/configure-pagefile-action@v1.5
Expand All @@ -62,10 +185,10 @@ jobs:
maximum-size: 16GB
disk-root: "D:"
- uses: actions/checkout@v6
- name: Set up Python 3.9
- name: Set up Python ${{ env.PYTHON_VER1 }}
uses: actions/setup-python@v6
with:
python-version: '3.9'
python-version: ${{ env.PYTHON_VER1 }}
cache: 'pip'
- name: Prepare pip wheel
run: |
Expand All @@ -74,16 +197,16 @@ jobs:
- if: runner.os == 'windows'
name: Install torch cpu from pytorch.org (Windows only)
run: |
python -m pip install torch==2.5.1 torchvision==0.20.1+cpu --index-url https://download.pytorch.org/whl/cpu
python -m pip install torch==${PYTORCH_VER1} torchvision==${TORCHVISION_VER}+cpu --index-url https://download.pytorch.org/whl/cpu
shell: bash
- if: runner.os == 'Linux'
name: Install itk pre-release (Linux only)
run: |
python -m pip install --pre -U itk
find /opt/hostedtoolcache/* -maxdepth 0 ! -name 'Python' -exec rm -rf {} \;
- name: Install the dependencies
- name: Install the complete dependencies
run: |
python -m pip install --user --upgrade pip wheel
python -m pip install torch==2.5.1 torchvision==0.20.1
python -m pip install torch==${PYTORCH_VER1} torchvision==${TORCHVISION_VER}
cat "requirements-dev.txt"
python -m pip install --no-build-isolation -r requirements-dev.txt
python -m pip list
Expand All @@ -94,37 +217,41 @@ jobs:
python -m pip uninstall -y monai
BUILD_MONAI=1 python -m pip install -e . # compile the cpp extensions
shell: bash
- name: Run quick tests (CPU ${{ runner.os }})
- name: Run quick tests
run: |
python -c 'import torch; print(torch.__version__); print(torch.rand(5,3))'
python -c "import monai; monai.config.print_config()"
python -m unittest -v
env:
QUICKTEST: True
PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION: python # https://github.com/Project-MONAI/MONAI/issues/4354
# python -m unittest -v

packaging:
packaging: # Test package generation
runs-on: ubuntu-latest
env:
QUICKTEST: True
shell: bash
steps:
- name: Clean unused tools
run: |
find /opt/hostedtoolcache/* -maxdepth 0 ! -name 'Python' -exec rm -rf {} \;
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/ghc /usr/local/.ghcup
sudo docker system prune -f

- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Set up Python 3.9
- name: Set up Python ${{ env.PYTHON_VER1 }}
uses: actions/setup-python@v6
with:
python-version: '3.9'
python-version: ${{ env.PYTHON_VER1 }}
cache: 'pip'
- name: Install dependencies
run: |
find /opt/hostedtoolcache/* -maxdepth 0 ! -name 'Python' -exec rm -rf {} \;
python -m pip install --user --upgrade pip setuptools wheel twine packaging
# install the latest pytorch for testing
# however, "pip install monai*.tar.gz" will build cpp/cuda with an isolated
# fresh torch installation according to pyproject.toml
python -m pip install torch>=2.5.1 torchvision --extra-index-url https://download.pytorch.org/whl/cpu
python -m pip install torch==${PYTORCH_VER1} torchvision --extra-index-url https://download.pytorch.org/whl/cpu
- name: Check packages
run: |
pip uninstall monai
Expand Down Expand Up @@ -176,17 +303,15 @@ jobs:
ls -al
python -m pip install --no-build-isolation -r requirements-dev.txt --extra-index-url https://download.pytorch.org/whl/cpu
python -m unittest -v
env:
PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION: python # https://github.com/Project-MONAI/MONAI/issues/4354

build-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up Python 3.9
- name: Set up Python ${{ env.PYTHON_VER1 }}
uses: actions/setup-python@v6
with:
python-version: '3.9'
python-version: ${{ env.PYTHON_VER1 }}
cache: 'pip'
- name: Install dependencies
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ["3.9", "3.10"]
python-version: ["3.10", "3.11"]
runs-on: ${{ matrix.os }}
timeout-minutes: 46 # equal to max + 3*std over the last 600 successful runs
env:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/cron-ngc-bundle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up Python 3.9
- name: Set up Python 3.10
uses: actions/setup-python@v6
with:
python-version: '3.9'
python-version: '3.10'
- name: cache weekly timestamp
id: pip-cache
run: echo "datew=$(date '+%Y-%V')" >> $GITHUB_OUTPUT
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/cron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
if pgrep python; then pkill python; fi
shell: bash
- name: Upload coverage
uses: codecov/codecov-action@v5
uses: codecov/codecov-action@v6
with:
fail_ci_if_error: false
files: ./coverage.xml
Expand Down Expand Up @@ -115,7 +115,7 @@ jobs:
if pgrep python; then pkill python; fi
shell: bash
- name: Upload coverage
uses: codecov/codecov-action@v5
uses: codecov/codecov-action@v6
with:
fail_ci_if_error: false
files: ./coverage.xml
Expand Down Expand Up @@ -220,7 +220,7 @@ jobs:
if pgrep python; then pkill python; fi
shell: bash
- name: Upload coverage
uses: codecov/codecov-action@v5
uses: codecov/codecov-action@v6
with:
fail_ci_if_error: false
files: ./coverage.xml
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,18 @@ jobs:
with:
ref: dev
fetch-depth: 0
- name: Set up Python 3.9
- name: Set up Python 3.10
uses: actions/setup-python@v6
with:
python-version: '3.9'
python-version: '3.10'
- shell: bash
run: |
git describe
python -m pip install -U pip wheel setuptools
python setup.py build
cat build/lib/monai/_version.py
- name: Upload version
uses: actions/upload-artifact@v6
uses: actions/upload-artifact@v7
with:
name: _version.py
path: build/lib/monai/_version.py
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pythonapp-gpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:

if [ ${{ matrix.environment }} = "PT230+CUDA124" ]
then
PYVER=3.9 PYSFX=3 DISTUTILS=python3-distutils && \
PYVER=3.10 PYSFX=3 DISTUTILS=python3-distutils && \
apt-get update && apt-get install -y --no-install-recommends \
curl \
pkg-config \
Expand Down Expand Up @@ -125,6 +125,6 @@ jobs:
shell: bash
- name: Upload coverage
if: ${{ github.head_ref != 'dev' && github.event.pull_request.merged != true }}
uses: codecov/codecov-action@v5
uses: codecov/codecov-action@v6
with:
files: ./coverage.xml
Loading
Loading