Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
8dec09f
support wasm inline assembly in naked functions
folkertdev Jan 15, 2025
bcf478b
work around the `wasm32-unknown-unknown` ABI being broken
folkertdev Jan 17, 2025
bf5e634
proc_macro: add `#![warn(unreachable_pub)]`
Urgau Jan 9, 2025
939b704
test: add `#![warn(unreachable_pub)]`
Urgau Jan 9, 2025
00381ea
Make it possible to build GCC on CI
Kobzol Jan 2, 2025
9b70b8b
CI: free disk with in-tree script instead of GitHub Action
marcoieni Jan 21, 2025
aef640a
Only assert the `Parser` size on specific arches
cuviper Jan 22, 2025
eb3b3fe
ci: use 8 core arm runner for dist-aarch64-linux
marcoieni Jan 22, 2025
2a544ab
Target modifiers (special marked options) are recorded in metainfo an…
azhogin Nov 17, 2024
87f7535
Reword "crate not found" resolve message
estebank Nov 18, 2024
6b06aa6
Enable kernel sanitizers for aarch64-unknown-none-softfloat
workingjubilee Jan 22, 2025
ff39ce9
Rollup merge of #133138 - azhogin:azhogin/target-modifiers, r=davidtw…
jhpratt Jan 23, 2025
76f57a5
Rollup merge of #133154 - estebank:issue-133137, r=wesleywiser
jhpratt Jan 23, 2025
f05e0c1
Rollup merge of #135366 - Urgau:unreach_pub-std-2, r=cuviper
jhpratt Jan 23, 2025
6e33327
Rollup merge of #135638 - Kobzol:gcc-ci, r=onur-ozkan
jhpratt Jan 23, 2025
781e01f
Rollup merge of #135648 - folkertdev:naked-asm-wasm, r=bjorn3
jhpratt Jan 23, 2025
c7413a6
Rollup merge of #135827 - marcoieni:free-space-script, r=Kobzol
jhpratt Jan 23, 2025
a91ac7d
Rollup merge of #135855 - cuviper:parser-size, r=wesleywiser
jhpratt Jan 23, 2025
b03ec03
Rollup merge of #135878 - marcoieni:dist-aarch64-linux-8c, r=Kobzol
jhpratt Jan 23, 2025
30177b8
Rollup merge of #135905 - workingjubilee:softly-sanitize-aarch64-floa…
jhpratt Jan 23, 2025
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
Prev Previous commit
Next Next commit
CI: free disk with in-tree script instead of GitHub Action
Co-authored-by: whiteio <chriswhiteiodev@gmail.com>
  • Loading branch information
marcoieni and whiteio committed Jan 21, 2025
commit 9b70b8bbbf1457ce93813071727b5e719e690e4d
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ jobs:
# intensive jobs to run on free runners, which however also have
# less disk space.
- name: free up disk space
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be
run: src/ci/scripts/free-disk-space.sh
if: matrix.free_disk

# Rust Log Analyzer can't currently detect the PR number of a GitHub
Expand Down
142 changes: 142 additions & 0 deletions src/ci/scripts/free-disk-space.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
#!/bin/bash

# Free disk space on Linux GitHub action runners
# Script inspired by https://github.com/jlumbroso/free-disk-space

# print a line of the specified character
printSeparationLine() {
for ((i = 0; i < 80; i++)); do
printf "%s" "$1"
done
printf "\n"
}

# compute available space
# REF: https://unix.stackexchange.com/a/42049/60849
# REF: https://stackoverflow.com/a/450821/408734
getAvailableSpace() { echo $(df -a | awk 'NR > 1 {avail+=$4} END {print avail}'); }

# make Kb human readable (assume the input is Kb)
# REF: https://unix.stackexchange.com/a/44087/60849
formatByteCount() { echo $(numfmt --to=iec-i --suffix=B --padding=7 $1'000'); }

# macro to output saved space
printSavedSpace() {
# Disk space before the operation
local before=${1}
local title=${2:-}

local after
after=$(getAvailableSpace)
local saved=$((after - before))

echo ""
printSeparationLine "*"
if [ -n "${title}" ]; then
echo "=> ${title}: Saved $(formatByteCount "$saved")"
else
echo "=> Saved $(formatByteCount "$saved")"
fi
printSeparationLine "*"
echo ""
}

# macro to print output of df with caption
printDF() {
local caption=${1}

printSeparationLine "="
echo "${caption}"
echo ""
echo "$ df -h"
echo ""
df -h
printSeparationLine "="
}

removeDir() {
dir=${1}

local before
before=$(getAvailableSpace)

sudo rm -rf "$dir" || true

printSavedSpace "$before" "$dir"
}

execAndMeasureSpaceChange() {
local operation=${1} # Function to execute
local title=${2}

local before
before=$(getAvailableSpace)
$operation

printSavedSpace "$before" "$title"
}

# Remove large packages
# REF: https://github.com/apache/flink/blob/master/tools/azure-pipelines/free_disk_space.sh
cleanPackages() {
sudo apt-get -qq remove -y --fix-missing \
'^aspnetcore-.*' \
'^dotnet-.*' \
'^llvm-.*' \
'php.*' \
'^mongodb-.*' \
'^mysql-.*' \
'azure-cli' \
'google-chrome-stable' \
'firefox' \
'powershell' \
'mono-devel' \
'libgl1-mesa-dri' \
'google-cloud-sdk' \
'google-cloud-cli'

sudo apt-get autoremove -y || echo "::warning::The command [sudo apt-get autoremove -y] failed"
sudo apt-get clean || echo "::warning::The command [sudo apt-get clean] failed failed"
}

# Remove Docker images
cleanDocker() {
echo "Removing the following docker images:"
sudo docker image ls
echo "Removing docker images..."
sudo docker image prune --all --force || true
}

# Remove Swap storage
cleanSwap() {
sudo swapoff -a || true
sudo rm -rf /mnt/swapfile || true
free -h
}

# Display initial disk space stats

AVAILABLE_INITIAL=$(getAvailableSpace)

printDF "BEFORE CLEAN-UP:"
echo ""

removeDir /usr/local/lib/android
removeDir /usr/share/dotnet

# Haskell runtime
removeDir /opt/ghc
removeDir /usr/local/.ghcup

execAndMeasureSpaceChange cleanPackages "Large misc. packages"
execAndMeasureSpaceChange cleanDocker "Docker images"
execAndMeasureSpaceChange cleanSwap "Swap storage"

# Output saved space statistic
echo ""
printDF "AFTER CLEAN-UP:"

echo ""
echo ""

printSavedSpace "$AVAILABLE_INITIAL" "Total saved"