From d4b2808393a0465c21177fc6b04d793df7d498d1 Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Wed, 22 May 2024 21:33:46 +0200 Subject: [PATCH] CI: add a step which uninstalls all potentially left over packages In case a previous run has been aborted mid-run, there might still be packages installed. Make sure we get back to the minimal state again. --- .github/workflows/build.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4775c9d..5879f16 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -168,6 +168,19 @@ jobs: msys2 -c 'pacman --noconfirm -Suu' msys2 -c 'pacman -Qkq' + - name: Remove potentially left over packages + if: ${{ runner.arch == 'ARM64' }} + shell: msys2 {0} + run: | + # Remove everything not needed + # XXX: this depends on marix.packages just being base+base-devel + TO_REMOVE=$(comm -23 <(pacman -Qq | sort) <((pactree -ul base | sed 's/[<>=].*//'; pactree -ul base-devel | sed 's/[<>=].*//') | sort -u)) + if [[ -n "$TO_REMOVE" ]]; then + pacman --noconfirm -Rddn $TO_REMOVE + # This shouldn't install anything, but just in case + pacman -S --noconfirm --needed ${{ matrix.packages }} + fi + - name: Process build queue env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}