[ci] Uninstall and install packages in batch

This cuts the time for the 'Install prerequisites' step almost in half,
since it doesn't need to re-scan the apt database for every package.
This commit is contained in:
Kim Gräsman 2022-12-20 19:59:30 +01:00
parent d6ed4a5309
commit 5a990cdae7
1 changed files with 9 additions and 7 deletions

View File

@ -26,15 +26,17 @@ jobs:
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo add-apt-repository "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy$LLVM_TAG main"
sudo apt update
sudo apt install -y ninja-build
# Remove any base dist LLVM/Clang installations
sudo apt remove -y "libclang*"
sudo apt remove -y "clang*"
sudo apt remove -y "llvm*"
sudo apt remove -y \
"libclang*" \
"clang*" \
"llvm*"
# Reinstall tagged versions
sudo apt install -y llvm$LLVM_TAG-dev
sudo apt install -y libclang$LLVM_TAG-dev
sudo apt install -y clang$LLVM_TAG
sudo apt install -y \
ninja-build \
llvm$LLVM_TAG-dev \
libclang$LLVM_TAG-dev \
clang$LLVM_TAG
- name: Check out default branch
uses: actions/checkout@v2