Skip to content

Commit

Permalink
Update check_ubuntu.yml
Browse files Browse the repository at this point in the history
- Detailed debug info extraction for Preparation of New Update

Signed-off-by: rokibhasansagar <[email protected]>
  • Loading branch information
rokibhasansagar committed Feb 26, 2023
1 parent 2136f0e commit 2d35595
Showing 1 changed file with 59 additions and 14 deletions.
73 changes: 59 additions & 14 deletions .github/workflows/check_ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,32 +10,77 @@ on:
paths:
- 'cleanup.sh'
- '.github/workflows/check_ubuntu.yml'
schedule:
- cron: '1 1 1 * *'
workflow_dispatch:

jobs:
cleanup:
if: github.repository == 'rokibhasansagar/slimhub_actions'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-18.04, ubuntu-20.04]
os: [ubuntu-18.04, ubuntu-20.04, ubuntu-22.04]

steps:
- uses: actions/checkout@main
- uses: actions/checkout@v3
with:
ref: 'main'
- name: Raw Environment Apt Checkup
run: sudo apt list --installed
run: |
echo "::group:: List Area"
sudo apt list --installed | sed '1d' | tee -a apt.preinstalled.raw.${{matrix.os}}.list
echo "::endgroup::"
echo "::group:: dpkg-query Debug Area"
dpkg-query -Wf 'Package: ${Package}\nSynopsis: ${binary:Summary}\nVersion: ${Version}\nISize: ${Installed-Size}\nPre-Depends: ${Pre-Depends}\nDepends: ${Depends}\n\n' | sed -e '/^Synopsis: $/d;/^Version: $/d;/^ISize: $/d;/^Pre-Depends: $/d;/^Depends: $/d' | tee -a apt.dependencies.${{matrix.os}}.list
echo "::endgroup::"
echo "::group:: Log Download Area"
for i in apt.preinstalled.raw.${{matrix.os}}.list apt.dependencies.${{matrix.os}}.list; do
tar -I'zstd --ultra -22 -T2' -cf "${i}.tzst" "${i}" && rm "${i}"
curl -s --upload-file "${i}.tzst" https://transfer.sh/ && echo
done
echo "::endgroup::"
- name: Cleanups
run: |
chmod a+x ./cleanup.sh
bash ./cleanup.sh
sed '11,18d' ./cleanup.sh | bash 2>&1
- name: Post-Cleanup Apt Checkup
run: sudo apt list --installed
- name: Check Top 20 Storage-hungry APT Packages
run: |
printf " MB - Package Name\n================\n"
dpkg-query -Wf '${db:Status-Status} ${Installed-Size}\t${Package}\n' | sed -ne 's/^installed //p' | sort -rh 2>/dev/null | head -n20 | awk '{print $1/1024, $2}'
- name: Local Bin checks
run: ls -lAog /usr/local/bin
- name: Global Bin checks
run: ls -lAog /usr/bin
echo "::group:: List Area"
sudo apt list --installed | sed '1d' | tee -a apt.postinstalled.raw.${{matrix.os}}.list
echo "::endgroup::"
echo "::group:: dpkg-query Debug Area"
dpkg-query -Wf 'Package: ${Package}\nSynopsis: ${binary:Summary}\nVersion: ${Version}\nISize: ${Installed-Size}\nPre-Depends: ${Pre-Depends}\nDepends: ${Depends}\n\n' | sed -e '/^Synopsis: $/d;/^Version: $/d;/^ISize: $/d;/^Pre-Depends: $/d;/^Depends: $/d' | tee -a apt.postdependencies.${{matrix.os}}.list
echo "::endgroup::"
echo "::group:: Log Download Area"
for i in apt.postinstalled.raw.${{matrix.os}}.list apt.postdependencies.${{matrix.os}}.list; do
tar -I'zstd --ultra -22 -T2' -cf "${i}.tzst" "${i}" && rm "${i}"
curl -s --upload-file "${i}.tzst" https://transfer.sh/ && echo
done
echo "::endgroup::"
- name: Check Top 30 Storage-hungry APT Packages
run: |
echo "::group:: dpkg-query Debug Area"
dpkg-query -Wf '${Installed-Size}\t${Package}\n' | sort -rh 2>/dev/null | head -n30 | awk '{print $2}' >apt.hugeapps.names.${{matrix.os}}.list
cat apt.hugeapps.names.${{matrix.os}}.list | while read -r i; do
dpkg-query -f='Package: ${Package}\nSynopsis: ${binary:Summary}\nVersion: ${Version}\nISize: ${Installed-Size}\nPre-Depends: ${Pre-Depends}\nDepends: ${Depends}\n\n' -W "${i}" | sed -e '/^Synopsis: $/d;/^Version: $/d;/^ISize: $/d;/^Pre-Depends: $/d;/^Depends: $/d' | tee -a apt.hugeappsdependencies.${{matrix.os}}.list
done
echo "::endgroup::"
echo "::group:: Log Download Area"
tar -I'zstd --ultra -22 -T2' -cf "apt.hugeappsdependencies.${{matrix.os}}.list.tzst" "apt.hugeappsdependencies.${{matrix.os}}.list"
curl -s --upload-file "apt.hugeappsdependencies.${{matrix.os}}.list.tzst" https://transfer.sh/ && echo
echo "::endgroup::"
- name: Local & Global Bin checks
run: |
echo "::group:: Debug Area"
ls -lAog /usr/local/bin 2>&1 | tee -a bin.local.list
ls -lAog /usr/bin 2>&1 | tee -a bin.global.list
echo "::group:: Log Download Area"
tar -I'zstd --ultra -22 -T2' -cf bin.checklists.${{matrix.os}}.tzst bin.local.list bin.global.list
curl -s --upload-file bin.checklists.${{matrix.os}}.tzst https://transfer.sh/ && echo
echo "::endgroup::"
- name: Envirnment Variables Check
run: printenv | sort
run: |
printenv | sort >envs.checklists.list
tar -I'zstd --ultra -22 -T2' -cf envs.checklists.${{matrix.os}}.tzst envs.checklists.list
curl -s --upload-file envs.checklists.${{matrix.os}}.tzst https://transfer.sh/ && echo

0 comments on commit 2d35595

Please sign in to comment.