Skip to content

Commit

Permalink
CI: add a step which uninstalls all potentially left over packages
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
lazka committed May 22, 2024
1 parent 63ea658 commit d4b2808
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down

0 comments on commit d4b2808

Please sign in to comment.