From bbffda29e3416615433fc3888f4371e00c83b85b Mon Sep 17 00:00:00 2001 From: Whisperity Date: Wed, 8 Jun 2022 11:14:35 +0200 Subject: [PATCH] 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. --- .github/workflows/test.yml | 2 ++ src/get-llvm.sh | 14 +++++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2152ea8..f21bb00 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,6 +8,8 @@ on: branches: - master - 'releases/*' + - 'fix/*' + - 'feat/*' paths-ignore: - '**.md' diff --git a/src/get-llvm.sh b/src/get-llvm.sh index 6c97a9e..f08000e 100755 --- a/src/get-llvm.sh +++ b/src/get-llvm.sh @@ -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-)"