mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
etcd 3.4: Install revive linter on CI if not installed.
This is based on commit 4f238837aa
and pull request https://github.com/etcd-io/etcd/pull/14872.
Signed-off-by: D Tripp <38776199+thedtripp@users.noreply.github.com>
This commit is contained in:
parent
f4e506aa24
commit
640e54552a
1
Makefile
1
Makefile
@ -35,6 +35,7 @@ clean:
|
||||
rm -f ./clientv3/integration/127.0.0.1:* ./clientv3/integration/localhost:*
|
||||
rm -f ./clientv3/ordering/127.0.0.1:* ./clientv3/ordering/localhost:*
|
||||
rm -rf ./bin/shellcheck*
|
||||
rm -rf ./bin/revive*
|
||||
|
||||
docker-clean:
|
||||
docker images
|
||||
|
24
test
24
test
@ -39,6 +39,7 @@ source ./build
|
||||
|
||||
PASSES=${PASSES:-}
|
||||
SHELLCHECK_VERSION=${SHELLCHECK_VERSION:-"v0.10.0"}
|
||||
REVIVE_VERSION=${REVIVE_VERSION:-"v1.3.7"}
|
||||
|
||||
# build before setting up test GOPATH
|
||||
if [[ "${PASSES}" == *"functional"* ]]; then
|
||||
@ -543,8 +544,27 @@ function staticcheck_pass {
|
||||
}
|
||||
|
||||
function revive_pass {
|
||||
if command -v revive >/dev/null; then
|
||||
reviveResult=$(revive -config ./tests/revive.toml -exclude "vendor/..." ./... 2>&1 || true)
|
||||
REVIVE=revive
|
||||
|
||||
if ! command -v $REVIVE >/dev/null; then
|
||||
echo "Installing revive $REVIVE_VERSION"
|
||||
if [ "$GOARCH" == "amd64" ]; then
|
||||
URL="https://github.com/mgechev/revive/releases/download/${REVIVE_VERSION}/revive_linux_amd64.tar.gz"
|
||||
elif [[ "$GOARCH" == "arm" || "$GOARCH" == "arm64" ]]; then
|
||||
URL="https://github.com/mgechev/revive/releases/download/${REVIVE_VERSION}/revive_linux_arm64.tar.gz"
|
||||
else
|
||||
echo "Unsupported architecture: $GOARCH"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
wget -qO- "$URL" | tar -xzv -C /tmp/ > /dev/null
|
||||
mkdir -p ./bin
|
||||
mv /tmp/revive ./bin/
|
||||
REVIVE=./bin/revive
|
||||
fi
|
||||
|
||||
if command -v $REVIVE >/dev/null; then
|
||||
reviveResult=$($REVIVE -config ./tests/revive.toml -exclude "vendor/..." ./... 2>&1 || true)
|
||||
if [ -n "${reviveResult}" ]; then
|
||||
echo -e "revive checking failed:\\n${reviveResult}"
|
||||
exit 255
|
||||
|
Loading…
x
Reference in New Issue
Block a user