Skip to content

Commit ef7bd8d

Browse files
author
Release Manager
committed
gh-36418: .github/workflows/docker.yml: Free more disk space <!-- ^^^^^ Please provide a concise, informative and self-explanatory title. Don't put issue numbers in there, do this in the PR body below. For example, instead of "Fixes #1234" use "Introduce new method to calculate 1+1" --> <!-- Describe your changes here in detail --> Replacing a step of our `docker.yml` with a well-maintained action with the same purpose. <!-- Why is this change required? What problem does it solve? --> <!-- If this PR resolves an open issue, please link to it here. For example "Fixes #12345". --> <!-- If your change requires a documentation PR, please link it appropriately. --> ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> <!-- If your change requires a documentation PR, please link it appropriately --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> <!-- Feel free to remove irrelevant items. --> - [x] The title is concise, informative, and self-explanatory. - [ ] The description explains in detail what this PR is about. - [ ] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation accordingly. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on - #12345: short description why this is a dependency - #34567: ... --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> URL: #36418 Reported by: Matthias Köppe Reviewer(s): Kwankyu Lee
2 parents 472121b + 5b9abe5 commit ef7bd8d

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

.github/workflows/docker.yml

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -144,24 +144,23 @@ jobs:
144144
EXTRA_CONFIGURE_ARGS: --enable-fat-binary
145145
EXTRA_SAGE_PACKAGES: ${{ inputs.extra_sage_packages }}
146146
steps:
147+
- name: Maximize build disk space
148+
uses: easimon/maximize-build-space@v8
149+
with:
150+
# need space in /var for Docker images
151+
root-reserve-mb: 40000
152+
remove-dotnet: true
153+
remove-android: true
154+
remove-haskell: true
155+
remove-codeql: true
156+
remove-docker-images: true
157+
if: inputs.free_disk_space
147158
- name: Check out SageMath
148159
uses: actions/checkout@v4
149160
with:
150161
repository: ${{ inputs.sage_repo }}
151162
ref: ${{ inputs.sage_ref }}
152163
fetch-depth: 10000
153-
- name: free disk space
154-
run: |
155-
df -h
156-
sudo swapoff -a
157-
sudo rm -f /swapfile
158-
sudo apt-get clean
159-
docker rmi $(docker image ls -aq)
160-
echo "Largest packages:"
161-
dpkg-query -Wf '${Installed-Size}\t${Package}\n' | sort -n | tail -n 50
162-
sudo apt-get --fix-broken --yes remove $(dpkg-query -f '${Package}\n' -W | grep -E '^(ghc-|google-cloud-sdk|google-chrome|firefox|mysql-server|dotnet-sdk|hhvm|mono)') || echo "(error ignored)"
163-
df -h
164-
if: inputs.free_disk_space
165164
- name: Download upstream artifact
166165
uses: actions/download-artifact@v3
167166
with:
@@ -216,7 +215,10 @@ jobs:
216215
.ci/merge-fixes.sh
217216
env:
218217
GH_TOKEN: ${{ github.token }}
219-
218+
- name: Show disk space
219+
run: |
220+
df -h
221+
if: inputs.free_disk_space
220222
- name: Configure and build Sage distribution within a Docker container
221223
run: |
222224
set -o pipefail; EXTRA_DOCKER_BUILD_ARGS="--build-arg NUMPROC=4 --build-arg USE_MAKEFLAGS=\"-k V=0 SAGE_NUM_THREADS=3\"" tox -e $TOX_ENV -- $TARGETS 2>&1 | sed "/^configure: notice:/s|^|::warning file=artifacts/$LOGS_ARTIFACT_NAME/config.log::|;/^configure: warning:/s|^|::warning file=artifacts/$LOGS_ARTIFACT_NAME/config.log::|;/^configure: error:/s|^|::error file=artifacts/$LOGS_ARTIFACT_NAME/config.log::|;"

0 commit comments

Comments
 (0)