Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.github/workflows/docker.yml: Free more disk space #36418

Merged
merged 2 commits into from
Oct 14, 2023
Merged
Changes from all commits
Commits
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
28 changes: 15 additions & 13 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,24 +144,23 @@ jobs:
EXTRA_CONFIGURE_ARGS: --enable-fat-binary
EXTRA_SAGE_PACKAGES: ${{ inputs.extra_sage_packages }}
steps:
- name: Maximize build disk space
uses: easimon/maximize-build-space@v8
with:
# need space in /var for Docker images
root-reserve-mb: 40000
remove-dotnet: true
remove-android: true
remove-haskell: true
remove-codeql: true
remove-docker-images: true
if: inputs.free_disk_space
- name: Check out SageMath
uses: actions/checkout@v4
with:
repository: ${{ inputs.sage_repo }}
ref: ${{ inputs.sage_ref }}
fetch-depth: 10000
- name: free disk space
run: |
df -h
sudo swapoff -a
sudo rm -f /swapfile
sudo apt-get clean
docker rmi $(docker image ls -aq)
echo "Largest packages:"
dpkg-query -Wf '${Installed-Size}\t${Package}\n' | sort -n | tail -n 50
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)"
df -h
if: inputs.free_disk_space
- name: Download upstream artifact
uses: actions/download-artifact@v3
with:
Expand Down Expand Up @@ -216,7 +215,10 @@ jobs:
.ci/merge-fixes.sh
env:
GH_TOKEN: ${{ github.token }}

- name: Show disk space
run: |
df -h
if: inputs.free_disk_space
- name: Configure and build Sage distribution within a Docker container
run: |
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::|;"
Expand Down