Merge pull request #3 from whisperity/fix/alternatives

Fix install of `clang-tidy` conflicting with the alternatives system.
This commit is contained in:
Whisperity
2022-06-09 12:10:41 +02:00
4 changed files with 18 additions and 12 deletions

View File

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

View File

@@ -301,8 +301,8 @@ Please refer to earlier parts of the documentation for the configuration of thes
### Versions to install
| Variable | Default | Description |
|------------------|------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `llvm-version` | `latest` | The major version of LLVM to install and use. LLVM is installed from [PPA](http://apt.llvm.org/). If `latest`, automatically gather the latest version. If `ignore`, don't install anything. (Not recommended) |
|------------------|------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `llvm-version` | `latest` | The major version of LLVM to install and use. LLVM is installed from the community [PPA](http://apt.llvm.org/). The value **MUST** be a major version (e.g. `13`) that is supported by the _PPA_ for the OS used! If `latest`, automatically gather the latest (yet unreleased) version. If `ignore`, don't install anything. (Not recommended.) |
| `install-custom` | `false` | If set to `true`, opens the ability to locally clone and install CodeChecker from the specified `repository` and `version`. Otherwise, `version` is taken as a release version, and the [CodeChecker suite from PyPI](http://pypi.org/project/codechecker) is downloaded. |
| `repository` | [`Ericsson/CodeChecker`](http://github.com/Ericsson/CodeChecker) | The CodeChecker repository to check out and build, if `install-custom` is `true`. |
| `version` | `master` | If `install-custom` is `false`, the release version (e.g. `6.18.0`) to download from PyPI, or `master` to fetch the latest release. Otherwise, the branch (defaulting to `master`), tag, or commit SHA in the `repository` to check out. |

View File

@@ -19,7 +19,7 @@ inputs:
required: true
default: 'master'
llvm-version:
description: 'The major version of LLVM to install and use. LLVM is installed from PPA. If "latest", automatically gather the latest version. If "ignore", do not install anything. (Not recommended)'
description: 'The major version of LLVM to install and use. LLVM is installed from the community PPA at http://apt.llvm.org. The value MUST be a major version (e.g. 13) that is supported by the PPA for the OS used! If "latest", automatically gather the latest version. If "ignore", do not install anything. (Not recommended.)'
required: true
default: 'latest'

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 -
@@ -22,11 +25,12 @@ 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::"
/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-)"