diff --git a/src/build-codechecker.sh b/src/build-codechecker.sh index 889ce81..aae6c6b 100755 --- a/src/build-codechecker.sh +++ b/src/build-codechecker.sh @@ -1,6 +1,5 @@ #!/bin/bash -set -e - +set -eo pipefail if [[ ! -z "$CODECHECKER_ACTION_DEBUG" ]]; then set -x fi diff --git a/src/get-llvm.sh b/src/get-llvm.sh index 8e252f7..1627379 100755 --- a/src/get-llvm.sh +++ b/src/get-llvm.sh @@ -3,6 +3,7 @@ set -e if [[ ! -z "$CODECHECKER_ACTION_DEBUG" ]]; then set -x fi +set -u echo "::group::Installing LLVM" diff --git a/src/pip-codechecker.sh b/src/pip-codechecker.sh index 5b3a4f5..71519df 100755 --- a/src/pip-codechecker.sh +++ b/src/pip-codechecker.sh @@ -1,16 +1,36 @@ #!/bin/bash +set -o pipefail if [[ ! -z "$CODECHECKER_ACTION_DEBUG" ]]; then set -x fi -echo "::group::Installing CodeChecker from PyPI" +echo "::group::Installing CodeChecker $IN_VERSION from PyPI" if [[ "$IN_VERSION" == "master" ]]; then # The default branch name "master" is offered as a convenient shortcut for - # fetching the latest release. - pip3 install codechecker -else - pip3 install codechecker=="$IN_VERSION" + # fetching the latest release. Unfortunately, this might just be a release + # candidate, which we do not wish to supply to automated production users + # this eagerly... + + # Hack to get pip list us which versions are available... + # (thanks, http://stackoverflow.com/a/26664162) + pip3 install codechecker=="You_cant_be_serious_mate" 2>&1 \ + | grep "ERROR: Could not find a version" \ + | sed 's/^.*(from versions: \(.*\))/\1/' \ + | sed 's/, /\n/g' \ + | grep -v 'rc\|a' \ + | sort -V \ + | tail -n 1 \ + >> "codechecker_latest_release.txt" + + IN_VERSION=$(cat "codechecker_latest_release.txt") + echo "Selected CodeChecker version $IN_VERSION automatically." + rm "codechecker_latest_release.txt" fi + +set -e + +pip3 install codechecker=="$IN_VERSION" + pip3 show codechecker echo "::endgroup::"