Skip to content

Commit bbffda2

Browse files
committed
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.
1 parent a052369 commit bbffda2

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ on:
88
branches:
99
- master
1010
- 'releases/*'
11+
- 'fix/*'
12+
- 'feat/*'
1113
paths-ignore:
1214
- '**.md'
1315

src/get-llvm.sh

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ fi
66

77
echo "::group::Installing LLVM"
88

9+
update-alternatives --query clang
10+
update-alternatives --query clang-tidy
11+
912
export DISTRO_FANCYNAME="$(lsb_release -c | awk '{ print $2 }')"
1013
curl -sL http://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
1114

@@ -21,12 +24,13 @@ fi
2124
sudo apt-get -y --no-install-recommends install \
2225
clang-$LLVM_VER \
2326
clang-tidy-$LLVM_VER
24-
sudo update-alternatives --install \
25-
/usr/bin/clang clang /usr/bin/clang-$LLVM_VER 1000 \
26-
--slave \
27-
/usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-$LLVM_VER
28-
echo "::endgroup::"
27+
sudo update-alternatives --install \
28+
/usr/bin/clang clang /usr/bin/clang-$LLVM_VER 10000
29+
sudo update-alternatives --install \
30+
/usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-$LLVM_VER 10000
2931

3032
update-alternatives --query clang
33+
update-alternatives --query clang-tidy
34+
echo "::endgroup::"
3135

3236
echo "::set-output name=REAL_VERSION::$(clang --version | head -n 1 | cut -d' ' -f4-)"

0 commit comments

Comments
 (0)