Skip to content

Commit 27cb347

Browse files
committed
Disk size optimisation
Signed-off-by: Eric Kerfoot <[email protected]>
1 parent 4ec2800 commit 27cb347

File tree

1 file changed

+35
-6
lines changed

1 file changed

+35
-6
lines changed

.github/workflows/cicd_tests.yml

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ concurrency:
2424
group: cicd-tests-${{ github.event.pull_request.number || github.ref }}
2525
cancel-in-progress: true
2626

27-
# These jobs run the CICD tests, type checking, and testing packaging and documentation generation. These use the
28-
# minimum supported versions of Python and PyTorch in many places hard-coded as literals, so when support is dropped
29-
# for a version it is important to go through all jobs and check the versions they use are correct.
27+
# These jobs run the CICD tests, type checking, and testing packaging. These use the minimum supported versions of
28+
# Python and PyTorch in many places hard-coded as literals, so when support is dropped for a version it is important to
29+
# go through all jobs and check the versions they use are correct.
3030

3131
jobs:
3232
static-checks: # Perform static type and other checks using runtests.sh
@@ -35,6 +35,14 @@ jobs:
3535
matrix:
3636
opt: ["codeformat", "pytype", "mypy"]
3737
steps:
38+
- name: Clean unused tools
39+
run: |
40+
find /opt/hostedtoolcache/* -maxdepth 0 ! -name 'Python' -exec rm -rf {} \;
41+
sudo rm -rf /usr/share/dotnet
42+
sudo rm -rf /usr/local/lib/android
43+
sudo rm -rf /opt/ghc /usr/local/.ghcup
44+
sudo docker system prune -f
45+
3846
- uses: actions/checkout@v6
3947
- name: Set up Python 3.10
4048
uses: actions/setup-python@v6
@@ -52,7 +60,6 @@ jobs:
5260
key: ${{ runner.os }}-pip-${{ steps.pip-cache.outputs.datew }}
5361
- name: Install dependencies
5462
run: |
55-
find /opt/hostedtoolcache/* -maxdepth 0 ! -name 'Python' -exec rm -rf {} \;
5663
python -m pip install --upgrade pip wheel
5764
python -m pip install -r requirements-dev.txt
5865
- name: Lint and type check with "./runtests.sh --build --${{ matrix.opt }}"
@@ -95,6 +102,14 @@ jobs:
95102

96103
timeout-minutes: 40
97104
steps:
105+
- if: runner.os == 'Linux'
106+
name: Clean unused tools
107+
run: |
108+
find /opt/hostedtoolcache/* -maxdepth 0 ! -name 'Python' -exec rm -rf {} \;
109+
sudo rm -rf /usr/share/dotnet
110+
sudo rm -rf /usr/local/lib/android
111+
sudo rm -rf /opt/ghc /usr/local/.ghcup
112+
sudo docker system prune -f
98113
- uses: actions/checkout@v5
99114
- name: Set up Python ${{ matrix.python-version }}
100115
uses: actions/setup-python@v6
@@ -151,6 +166,14 @@ jobs:
151166
os: [windows-latest, macOS-latest, ubuntu-latest]
152167
timeout-minutes: 120
153168
steps:
169+
- if: runner.os == 'Linux'
170+
name: Clean unused tools
171+
run: |
172+
find /opt/hostedtoolcache/* -maxdepth 0 ! -name 'Python' -exec rm -rf {} \;
173+
sudo rm -rf /usr/share/dotnet
174+
sudo rm -rf /usr/local/lib/android
175+
sudo rm -rf /opt/ghc /usr/local/.ghcup
176+
sudo docker system prune -f
154177
- if: runner.os == 'windows'
155178
name: Config pagefile (Windows only)
156179
uses: al-cheb/[email protected]
@@ -188,7 +211,6 @@ jobs:
188211
name: Install itk pre-release (Linux only)
189212
run: |
190213
python -m pip install --pre -U itk
191-
find /opt/hostedtoolcache/* -maxdepth 0 ! -name 'Python' -exec rm -rf {} \;
192214
- name: Install the complete dependencies
193215
run: |
194216
python -m pip install --user --upgrade pip wheel
@@ -218,6 +240,14 @@ jobs:
218240
QUICKTEST: True
219241
shell: bash
220242
steps:
243+
- name: Clean unused tools
244+
run: |
245+
find /opt/hostedtoolcache/* -maxdepth 0 ! -name 'Python' -exec rm -rf {} \;
246+
sudo rm -rf /usr/share/dotnet
247+
sudo rm -rf /usr/local/lib/android
248+
sudo rm -rf /opt/ghc /usr/local/.ghcup
249+
sudo docker system prune -f
250+
221251
- uses: actions/checkout@v6
222252
with:
223253
fetch-depth: 0
@@ -239,7 +269,6 @@ jobs:
239269
key: ${{ runner.os }}-pip-${{ steps.pip-cache.outputs.datew }}
240270
- name: Install dependencies
241271
run: |
242-
find /opt/hostedtoolcache/* -maxdepth 0 ! -name 'Python' -exec rm -rf {} \;
243272
python -m pip install --user --upgrade pip setuptools wheel twine packaging
244273
# install the latest pytorch for testing
245274
# however, "pip install monai*.tar.gz" will build cpp/cuda with an isolated

0 commit comments

Comments
 (0)