|
| 1 | +# Jenkinsfile.monai-premerge |
| 2 | +name: premerge-min |
| 3 | + |
| 4 | +on: |
| 5 | + # quick tests for pull requests and the releasing branches |
| 6 | + push: |
| 7 | + branches: |
| 8 | + - main |
| 9 | + pull_request: |
| 10 | + |
| 11 | +concurrency: |
| 12 | + # automatically cancel the previously triggered workflows when there's a newer version |
| 13 | + group: build-min-${{ github.event.pull_request.number || github.ref }} |
| 14 | + cancel-in-progress: true |
| 15 | + |
| 16 | +jobs: |
| 17 | + # caching of these jobs: |
| 18 | + # - docker-py3-pip- (shared) |
| 19 | + # - ubuntu py37 pip- |
| 20 | + # - os-latest-pip- (shared) |
| 21 | + min-dep-os: # min dependencies installed tests for different OS |
| 22 | + runs-on: ${{ matrix.os }} |
| 23 | + strategy: |
| 24 | + fail-fast: false |
| 25 | + matrix: |
| 26 | + os: [windows-latest, macOS-latest, ubuntu-latest] |
| 27 | + timeout-minutes: 40 |
| 28 | + steps: |
| 29 | + - uses: actions/checkout@v3 |
| 30 | + - name: Set up Python 3.8 |
| 31 | + uses: actions/setup-python@v4 |
| 32 | + with: |
| 33 | + python-version: '3.8' |
| 34 | + - name: Prepare pip wheel |
| 35 | + run: | |
| 36 | + which python |
| 37 | + python -m pip install --upgrade pip wheel |
| 38 | + - name: cache weekly timestamp |
| 39 | + id: pip-cache |
| 40 | + run: | |
| 41 | + echo "datew=$(date '+%Y-%V')" >> $GITHUB_OUTPUT |
| 42 | + echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT |
| 43 | + shell: bash |
| 44 | + - name: cache for pip |
| 45 | + uses: actions/cache@v3 |
| 46 | + id: cache |
| 47 | + with: |
| 48 | + path: ${{ steps.pip-cache.outputs.dir }} |
| 49 | + key: ${{ matrix.os }}-latest-pip-${{ steps.pip-cache.outputs.datew }} |
| 50 | + - if: runner.os == 'windows' |
| 51 | + name: Install torch cpu from pytorch.org (Windows only) |
| 52 | + run: | |
| 53 | + python -m pip install torch==1.13.1+cpu -f https://download.pytorch.org/whl/torch_stable.html |
| 54 | + - name: Install the dependencies |
| 55 | + run: | |
| 56 | + # min. requirements |
| 57 | + python -m pip install torch==1.13.1 |
| 58 | + python -m pip install -r requirements-min.txt |
| 59 | + python -m pip list |
| 60 | + BUILD_MONAI=0 python setup.py develop # no compile of extensions |
| 61 | + shell: bash |
| 62 | + - name: Run quick tests (CPU ${{ runner.os }}) |
| 63 | + run: | |
| 64 | + python -c 'import torch; print(torch.__version__); print(torch.rand(5,3))' |
| 65 | + python -c "import monai; monai.config.print_config()" |
| 66 | + ./runtests.sh --min |
| 67 | + shell: bash |
| 68 | + env: |
| 69 | + QUICKTEST: True |
| 70 | + |
| 71 | + min-dep-py3: # min dependencies installed tests for different python |
| 72 | + runs-on: ubuntu-latest |
| 73 | + strategy: |
| 74 | + fail-fast: false |
| 75 | + matrix: |
| 76 | + python-version: ['3.7', '3.8', '3.9', '3.10', '3.11'] |
| 77 | + timeout-minutes: 40 |
| 78 | + steps: |
| 79 | + - uses: actions/checkout@v3 |
| 80 | + - name: Set up Python ${{ matrix.python-version }} |
| 81 | + uses: actions/setup-python@v4 |
| 82 | + with: |
| 83 | + python-version: ${{ matrix.python-version }} |
| 84 | + - name: Prepare pip wheel |
| 85 | + run: | |
| 86 | + which python |
| 87 | + python -m pip install --user --upgrade pip setuptools wheel |
| 88 | + - name: cache weekly timestamp |
| 89 | + id: pip-cache |
| 90 | + run: | |
| 91 | + echo "datew=$(date '+%Y-%V')" >> $GITHUB_OUTPUT |
| 92 | + echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT |
| 93 | + shell: bash |
| 94 | + - name: cache for pip |
| 95 | + uses: actions/cache@v3 |
| 96 | + id: cache |
| 97 | + with: |
| 98 | + path: ${{ steps.pip-cache.outputs.dir }} |
| 99 | + key: ubuntu-latest-latest-pip-${{ steps.pip-cache.outputs.datew }} |
| 100 | + - name: Install the dependencies |
| 101 | + run: | |
| 102 | + # min. requirements |
| 103 | + python -m pip install torch --extra-index-url https://download.pytorch.org/whl/cpu |
| 104 | + python -m pip install -r requirements-min.txt |
| 105 | + python -m pip list |
| 106 | + BUILD_MONAI=0 python setup.py develop # no compile of extensions |
| 107 | + shell: bash |
| 108 | + - name: Run quick tests (CPU ${{ runner.os }}) |
| 109 | + run: | |
| 110 | + python -c 'import torch; print(torch.__version__); print(torch.rand(5,3))' |
| 111 | + python -c "import monai; monai.config.print_config()" |
| 112 | + ./runtests.sh --min |
| 113 | + env: |
| 114 | + QUICKTEST: True |
| 115 | + |
| 116 | + min-dep-pytorch: # min dependencies installed tests for different pytorch |
| 117 | + runs-on: ubuntu-latest |
| 118 | + strategy: |
| 119 | + fail-fast: false |
| 120 | + matrix: |
| 121 | + pytorch-version: ['1.8.2', '1.9.1', '1.10.2', '1.11.0', '1.12.1', 'latest'] |
| 122 | + timeout-minutes: 40 |
| 123 | + steps: |
| 124 | + - uses: actions/checkout@v3 |
| 125 | + - name: Set up Python 3.8 |
| 126 | + uses: actions/setup-python@v4 |
| 127 | + with: |
| 128 | + python-version: '3.8' |
| 129 | + - name: Prepare pip wheel |
| 130 | + run: | |
| 131 | + which python |
| 132 | + python -m pip install --user --upgrade pip setuptools wheel |
| 133 | + - name: cache weekly timestamp |
| 134 | + id: pip-cache |
| 135 | + run: | |
| 136 | + echo "datew=$(date '+%Y-%V')" >> $GITHUB_OUTPUT |
| 137 | + echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT |
| 138 | + shell: bash |
| 139 | + - name: cache for pip |
| 140 | + uses: actions/cache@v3 |
| 141 | + id: cache |
| 142 | + with: |
| 143 | + path: ${{ steps.pip-cache.outputs.dir }} |
| 144 | + key: ubuntu-latest-latest-pip-${{ steps.pip-cache.outputs.datew }} |
| 145 | + - name: Install the dependencies |
| 146 | + run: | |
| 147 | + # min. requirements |
| 148 | + if [ ${{ matrix.pytorch-version }} == "latest" ]; then |
| 149 | + python -m pip install torch |
| 150 | + elif [ ${{ matrix.pytorch-version }} == "1.8.2" ]; then |
| 151 | + python -m pip install torch==1.8.2 --extra-index-url https://download.pytorch.org/whl/lts/1.8/cpu |
| 152 | + elif [ ${{ matrix.pytorch-version }} == "1.9.1" ]; then |
| 153 | + python -m pip install torch==1.9.1 |
| 154 | + elif [ ${{ matrix.pytorch-version }} == "1.10.2" ]; then |
| 155 | + python -m pip install torch==1.10.2 |
| 156 | + elif [ ${{ matrix.pytorch-version }} == "1.11.0" ]; then |
| 157 | + python -m pip install torch==1.11.0 |
| 158 | + elif [ ${{ matrix.pytorch-version }} == "1.12.1" ]; then |
| 159 | + python -m pip install torch==1.12.1 |
| 160 | + fi |
| 161 | + python -m pip install -r requirements-min.txt |
| 162 | + python -m pip list |
| 163 | + BUILD_MONAI=0 python setup.py develop # no compile of extensions |
| 164 | + shell: bash |
| 165 | + - name: Run quick tests (pytorch ${{ matrix.pytorch-version }}) |
| 166 | + run: | |
| 167 | + python -c 'import torch; print(torch.__version__); print(torch.rand(5,3))' |
| 168 | + python -c "import monai; monai.config.print_config()" |
| 169 | + ./runtests.sh --min |
| 170 | + env: |
| 171 | + QUICKTEST: True |
0 commit comments