mirror of
https://github.com/daylinmorgan/oizys.git
synced 2025-01-03 10:40:44 -06:00
get weird with it
This commit is contained in:
parent
e4d08c4195
commit
0b1e72fbc2
3 changed files with 45 additions and 73 deletions
59
.github/actions/clean-disk/action.yml
vendored
59
.github/actions/clean-disk/action.yml
vendored
|
@ -1,6 +1,16 @@
|
||||||
name: 'Maximize build disk space'
|
name: 'Maximize build disk space'
|
||||||
description: 'Maximize the available disk space by removing unneeded software'
|
description: 'Maximize the available disk space by removing unneeded software'
|
||||||
|
|
||||||
|
inputs:
|
||||||
|
purge-packages:
|
||||||
|
description: whether to remove apt packages
|
||||||
|
required: false
|
||||||
|
default: 'true'
|
||||||
|
apt-manifest-url:
|
||||||
|
description: url to apt-package manifest (default ubuntu-22.04.4)
|
||||||
|
required: false
|
||||||
|
default: 'https://releases.ubuntu.com/jammy/ubuntu-22.04.4-live-server-amd64.manifest'
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: "composite"
|
using: "composite"
|
||||||
steps:
|
steps:
|
||||||
|
@ -10,39 +20,40 @@ runs:
|
||||||
echo "==> Available space before cleanup"
|
echo "==> Available space before cleanup"
|
||||||
echo
|
echo
|
||||||
df -h
|
df -h
|
||||||
# sudo du /usr/local -h --max-depth=1 | sort -rh || true
|
|
||||||
|
|
||||||
- name: Maximize build disk space
|
- name: Maximize build disk space
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
|
non_manifest_packages() {
|
||||||
|
comm -2 -3 \
|
||||||
|
<(sudo apt-mark showmanual | sort) \
|
||||||
|
<(curl --silent "${{ inputs.apt-manifest-url }}" | grep --perl-regexp --only-matching '^[\w-.+]+' | sort)
|
||||||
|
}
|
||||||
|
|
||||||
echo "Removing unwanted software... "
|
echo "Removing unwanted software... "
|
||||||
sudo rm -rf /usr/share/dotnet
|
|
||||||
sudo rm -rf /usr/local/lib/android
|
|
||||||
sudo rm -rf /opt
|
|
||||||
sudo rm -rf /opt/ghc
|
|
||||||
sudo rm -rf /usr/local/.ghcup
|
|
||||||
sudo rm -rf /opt/hostedtoolcache
|
|
||||||
sudo docker image prune --all --force > /dev/null
|
|
||||||
sudo rm -rf /usr/local
|
|
||||||
|
|
||||||
sudo apt-get remove -y '^aspnetcore-.*' > /dev/null
|
sudo rm -rf /opt &
|
||||||
sudo apt-get remove -y '^dotnet-.*' > /dev/null
|
sudo rm -rf "$AGENT_TOOLSDIRECTORY" &
|
||||||
sudo apt-get remove -y '^llvm-.*' > /dev/null
|
|
||||||
sudo apt-get remove -y 'php.*' > /dev/null
|
|
||||||
sudo apt-get remove -y '^mongodb-.*' > /dev/null
|
|
||||||
sudo apt-get remove -y '^mysql-.*' > /dev/null
|
|
||||||
sudo apt-get remove -y azure-cli google-chrome-stable firefox powershell mono-devel libgl1-mesa-dri --fix-missing > /dev/null
|
|
||||||
sudo apt-get remove -y google-cloud-sdk --fix-missing > /dev/null
|
|
||||||
sudo apt-get remove -y google-cloud-cli --fix-missing > /dev/null
|
|
||||||
sudo apt-get autoremove -y > /dev/null
|
|
||||||
sudo apt-get clean > /dev/null
|
|
||||||
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
|
|
||||||
|
|
||||||
sudo swapoff -a
|
if [[ "${{ inputs.purge-packages }}" == 'true' ]]; then
|
||||||
sudo rm -f /mnt/swapfile
|
sudo apt-get purge \
|
||||||
free -h
|
--allow-remove-essential \
|
||||||
|
-q \
|
||||||
|
$(non_manifest_packages) &
|
||||||
|
fi
|
||||||
|
|
||||||
|
wait
|
||||||
|
|
||||||
|
sudo rm -rf /var/lib/docker &
|
||||||
|
sudo rm -rf /usr/{local,share} &
|
||||||
|
{
|
||||||
|
sudo swapoff -a
|
||||||
|
sudo rm -f /mnt/swapfile
|
||||||
|
} &
|
||||||
|
|
||||||
|
wait
|
||||||
echo "... done"
|
echo "... done"
|
||||||
|
|
||||||
- name: Disk space report after modification
|
- name: Disk space report after modification
|
||||||
|
|
44
.github/workflows/build.yml
vendored
44
.github/workflows/build.yml
vendored
|
@ -4,9 +4,9 @@ on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
host:
|
host:
|
||||||
description: 'host name to build'
|
description: 'list of hosts to build'
|
||||||
required: true
|
required: true
|
||||||
default: 'othalan'
|
default: 'othalan algiz'
|
||||||
type: string
|
type: string
|
||||||
lockFile:
|
lockFile:
|
||||||
description: 'flake.lock file'
|
description: 'flake.lock file'
|
||||||
|
@ -15,9 +15,9 @@ on:
|
||||||
workflow_call:
|
workflow_call:
|
||||||
inputs:
|
inputs:
|
||||||
host:
|
host:
|
||||||
description: 'host name to build'
|
description: 'list of hosts to build'
|
||||||
required: true
|
required: true
|
||||||
default: 'othalan'
|
default: 'othalan aligz'
|
||||||
type: string
|
type: string
|
||||||
|
|
||||||
|
|
||||||
|
@ -29,40 +29,10 @@ jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
# # The default disk size of these runners is ~14GB
|
|
||||||
# # Cleanup the disk, see upstream discussion https://github.com/actions/runner-images/issues/2840.
|
|
||||||
# - name: Cleanup Disk Space
|
|
||||||
# run: |
|
|
||||||
# echo "Before removing files:"
|
|
||||||
# df -h
|
|
||||||
# sudo rm -rf "$AGENT_TOOLSDIRECTORY"
|
|
||||||
# sudo rm -rf /opt
|
|
||||||
# sudo rm -rf /usr/share/dotnet
|
|
||||||
# sudo rm -rf /usr/local/{lib/android,share/boost}
|
|
||||||
# sudo docker image prune --all --force
|
|
||||||
# echo "After removing files:"
|
|
||||||
# df -h
|
|
||||||
|
|
||||||
- name: Maximize build space
|
|
||||||
uses: AdityaGarg8/remove-unwanted-software@v3
|
|
||||||
with:
|
|
||||||
remove-android: 'true'
|
|
||||||
remove-dotnet: 'true'
|
|
||||||
remove-haskell: 'true'
|
|
||||||
remove-codeql: 'true'
|
|
||||||
remove-docker-images: 'true'
|
|
||||||
remove-large-packages: 'true'
|
|
||||||
remove-cached-tools: 'true'
|
|
||||||
remove-swapfile: 'true'
|
|
||||||
|
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Build
|
- uses: ./.github/actions/clean-disk
|
||||||
run: |
|
|
||||||
echo "Free space:"
|
|
||||||
df -h
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- uses: DeterminateSystems/nix-installer-action@main
|
- uses: DeterminateSystems/nix-installer-action@main
|
||||||
- uses: DeterminateSystems/magic-nix-cache-action@v7
|
- uses: DeterminateSystems/magic-nix-cache-action@v7
|
||||||
|
@ -80,4 +50,6 @@ jobs:
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
nix run . --accept-flake-config -- cache --host "${{ inputs.host }}" --flake .
|
for host in ${{ inputs.host }}; do
|
||||||
|
nix run . --accept-flake-config -- cache --host "$host" --flake .
|
||||||
|
done
|
||||||
|
|
15
.github/workflows/checks.yml
vendored
15
.github/workflows/checks.yml
vendored
|
@ -16,22 +16,11 @@ jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
# The default disk size of these runners is ~14GB
|
|
||||||
# Cleanup the disk, see upstream discussion https://github.com/actions/runner-images/issues/2840.
|
|
||||||
# - name: Cleanup Disk Space
|
|
||||||
# run: |
|
|
||||||
# echo "Before removing files:"
|
|
||||||
# df -h
|
|
||||||
# sudo rm -rf /usr/share/dotnet
|
|
||||||
# sudo rm -rf /opt/ghc
|
|
||||||
# sudo rm -rf /opt
|
|
||||||
# sudo rm -rf "/usr/local/share/boost"
|
|
||||||
# sudo rm -rf "$AGENT_TOOLSDIRECTORY"
|
|
||||||
# echo "After removing files:"
|
|
||||||
# df -h
|
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- uses: ./.github/actions/clean-disk
|
- uses: ./.github/actions/clean-disk
|
||||||
|
with:
|
||||||
|
purge-packages: false
|
||||||
|
|
||||||
- uses: DeterminateSystems/nix-installer-action@main
|
- uses: DeterminateSystems/nix-installer-action@main
|
||||||
- uses: DeterminateSystems/magic-nix-cache-action@v7
|
- uses: DeterminateSystems/magic-nix-cache-action@v7
|
||||||
|
|
Loading…
Reference in a new issue