diff --git a/.github/workflows/copyright.yml b/.github/workflows/copyright.yml index 3cf47bc3b..9625beb31 100644 --- a/.github/workflows/copyright.yml +++ b/.github/workflows/copyright.yml @@ -7,21 +7,38 @@ on: - main pull_request: +permissions: + contents: read + +concurrency: + # automatically cancel the previously triggered workflows when there's a newer version + group: copyright-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + jobs: copyright: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v7 + - uses: actions/checkout@v7 + with: + repository: Project-MONAI/MONAI + path: monai - name: Set up Python 3.10 uses: actions/setup-python@v6 with: python-version: '3.10' cache: 'pip' - name: Install dependencies + env: + PIP_EXTRA_INDEX_URL: "https://download.pytorch.org/whl/cpu" # forces CPU PyTorch installation, should be faster + BUILD_MONAI: 0 run: | find /opt/hostedtoolcache/* -maxdepth 0 ! -name 'Python' -exec rm -rf {} \; - python -m pip install --upgrade pip wheel wheel-stub + python -m pip install --upgrade pip wheel + (cd monai; pip install .[all]) python -m pip install -r requirements.txt - name: Copyright check run: | + rm -rf monai $(pwd)/runner.sh --no-run --no-checks --copyright diff --git a/.github/workflows/guidelines.yml b/.github/workflows/guidelines.yml index 3127e6eee..e165c9226 100644 --- a/.github/workflows/guidelines.yml +++ b/.github/workflows/guidelines.yml @@ -7,20 +7,36 @@ on: - main pull_request: +permissions: + contents: read + +concurrency: + # automatically cancel the previously triggered workflows when there's a newer version + group: guidelines-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + jobs: guidelines: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v7 + - uses: actions/checkout@v7 + with: + repository: Project-MONAI/MONAI + path: monai - name: Set up Python 3.10 uses: actions/setup-python@v6 with: python-version: '3.10' cache: 'pip' - name: Install dependencies + env: + PIP_EXTRA_INDEX_URL: "https://download.pytorch.org/whl/cpu" # forces CPU PyTorch installation, should be faster + BUILD_MONAI: 0 run: | find /opt/hostedtoolcache/* -maxdepth 0 ! -name 'Python' -exec rm -rf {} \; - python -m pip install --upgrade pip wheel wheel-stub + python -m pip install --upgrade pip wheel + (cd monai; pip install .[all]) python -m pip install -r requirements.txt - name: Guidelines notebook format check run: | diff --git a/.github/workflows/pep8.yml b/.github/workflows/pep8.yml index 800edd56b..d1daf91c1 100644 --- a/.github/workflows/pep8.yml +++ b/.github/workflows/pep8.yml @@ -7,20 +7,36 @@ on: - main pull_request: +permissions: + contents: read + +concurrency: + # automatically cancel the previously triggered workflows when there's a newer version + group: pep8-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + jobs: pep8: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v7 + - uses: actions/checkout@v7 + with: + repository: Project-MONAI/MONAI + path: monai - name: Set up Python 3.10 uses: actions/setup-python@v6 with: python-version: '3.10' cache: 'pip' - name: Install dependencies + env: + PIP_EXTRA_INDEX_URL: "https://download.pytorch.org/whl/cpu" # forces CPU PyTorch installation, should be faster + BUILD_MONAI: 0 run: | find /opt/hostedtoolcache/* -maxdepth 0 ! -name 'Python' -exec rm -rf {} \; python -m pip install --upgrade pip wheel wheel-stub + (cd monai; pip install .[all]) python -m pip install -r requirements.txt - name: PEP8 check run: | diff --git a/.github/workflows/test-modified.yml b/.github/workflows/test-modified.yml index 974c27be1..2365d1730 100644 --- a/.github/workflows/test-modified.yml +++ b/.github/workflows/test-modified.yml @@ -7,6 +7,9 @@ on: - main pull_request: +permissions: + contents: read + concurrency: # automatically cancel the previously triggered workflows when there's a newer version group: build-${{ github.event.pull_request.number || github.ref }} @@ -16,7 +19,11 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v7 + - uses: actions/checkout@v7 + with: + repository: Project-MONAI/MONAI + path: monai - name: Set up Python 3.10 uses: actions/setup-python@v6 with: @@ -27,25 +34,20 @@ jobs: env: PIP_NO_CACHE_DIR: "1" PIP_DISABLE_PIP_VERSION_CHECK: "1" + BUILD_MONAI: 0 + PIP_EXTRA_INDEX_URL: "https://download.pytorch.org/whl/cpu" # forces CPU PyTorch installation, should be faster run: | find /opt/hostedtoolcache/* -maxdepth 0 ! -name 'Python' -exec rm -rf {} \; df -h which python - python -m pip install -U pip wheel wheel-stub - # Force CPU-only PyTorch wheels so we don't download huge CUDA/nvidia-* wheels in CI. - # Keep PyPI available for torch's dependencies. - pip install --index-url https://download.pytorch.org/whl/cpu --extra-index-url https://pypi.org/simple torch torchvision torchaudio - - pip install --no-build-isolation -r https://raw.githubusercontent.com/Project-MONAI/MONAI/dev/requirements-dev.txt - pip install -r requirements.txt - - # Avoid PEP517 build isolation (which can re-install torch and pull CUDA wheels). - BUILD_MONAI=0 pip install --no-build-isolation git+https://github.com/Project-MONAI/MONAI#egg=MONAI - pip list + python -m pip install -U pip wheel + (cd monai; pip install .[all]) + python -m pip install -r requirements.txt + python -m pip list - name: Notebook quick check shell: bash run: | - python -c "import monai; monai.config.print_debug_info()" + python -m monai.config git fetch origin main git diff --name-only origin/main | while read line do