From bbffda29e3416615433fc3888f4371e00c83b85b Mon Sep 17 00:00:00 2001 From: Whisperity Date: Wed, 8 Jun 2022 11:14:35 +0200 Subject: [PATCH 1/2] 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-)" From 26b43fadb4552d522c158a9b62d3b21144076570 Mon Sep 17 00:00:00 2001 From: Whisperity Date: Wed, 8 Jun 2022 11:39:14 +0200 Subject: [PATCH 2/2] chore(docs): Explicitly mention that `llvm-version` must be the major version --- README.md | 12 ++++++------ action.yml | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 6db6428..d649c54 100644 --- a/README.md +++ b/README.md @@ -300,12 +300,12 @@ 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) | -| `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. | +| Variable | Default | Description | +|------------------|------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `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. | ### Build log configuration diff --git a/action.yml b/action.yml index 1a5f2e6..7ba81a2 100644 --- a/action.yml +++ b/action.yml @@ -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'