fix: Use separate clang-tidy alternative entry because GitHub...

The image contents of `ubuntu-20.04` changed sometime in April or May
and they already come with a `clang-tidy` pre-installed and registered
into the alternatives system, which broke the action's install script.
This commit is contained in:
Whisperity
2022-06-08 11:14:35 +02:00
parent a052369b61
commit bbffda29e3
2 changed files with 11 additions and 5 deletions

View File

@@ -8,6 +8,8 @@ on:
branches:
- master
- 'releases/*'
- 'fix/*'
- 'feat/*'
paths-ignore:
- '**.md'

View File

@@ -6,6 +6,9 @@ fi
echo "::group::Installing LLVM"
update-alternatives --query clang
update-alternatives --query clang-tidy
export DISTRO_FANCYNAME="$(lsb_release -c | awk '{ print $2 }')"
curl -sL http://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
@@ -21,12 +24,13 @@ fi
sudo apt-get -y --no-install-recommends install \
clang-$LLVM_VER \
clang-tidy-$LLVM_VER
sudo update-alternatives --install \
/usr/bin/clang clang /usr/bin/clang-$LLVM_VER 1000 \
--slave \
/usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-$LLVM_VER
echo "::endgroup::"
sudo update-alternatives --install \
/usr/bin/clang clang /usr/bin/clang-$LLVM_VER 10000
sudo update-alternatives --install \
/usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-$LLVM_VER 10000
update-alternatives --query clang
update-alternatives --query clang-tidy
echo "::endgroup::"
echo "::set-output name=REAL_VERSION::$(clang --version | head -n 1 | cut -d' ' -f4-)"