From 2d355953a34447a7cb56cf53af52852d952c5433 Mon Sep 17 00:00:00 2001 From: Rokib Hasan Sagar <10854164+rokibhasansagar@users.noreply.github.com> Date: Sat, 25 Feb 2023 13:06:21 +0600 Subject: [PATCH] Update check_ubuntu.yml - Detailed debug info extraction for Preparation of New Update Signed-off-by: rokibhasansagar <10854164+rokibhasansagar@users.noreply.github.com> --- .github/workflows/check_ubuntu.yml | 73 ++++++++++++++++++++++++------ 1 file changed, 59 insertions(+), 14 deletions(-) diff --git a/.github/workflows/check_ubuntu.yml b/.github/workflows/check_ubuntu.yml index 83187f6..be92f73 100644 --- a/.github/workflows/check_ubuntu.yml +++ b/.github/workflows/check_ubuntu.yml @@ -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