From c63a2a54641ac8cd032a3306bb35e49b9ae74728 Mon Sep 17 00:00:00 2001 From: Ainar Garipov Date: Thu, 24 Dec 2020 17:39:30 +0300 Subject: [PATCH] all: imp scripts, try another goproxy and direct --- .github/workflows/lint.yml | 2 +- Makefile | 6 +++--- scripts/go-deps.sh | 19 +++++++++++++++++++ scripts/go-test.sh | 20 ++++++++++---------- 4 files changed, 33 insertions(+), 14 deletions(-) create mode 100644 scripts/go-deps.sh diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 1eafac1a8a9..fed2a4cf4e6 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -13,7 +13,7 @@ - 'uses': 'actions/checkout@v2' - 'name': 'run-lint' 'run': > - make go-tools go-lint + make go-deps go-tools go-lint 'eslint': 'runs-on': 'ubuntu-latest' 'steps': diff --git a/Makefile b/Makefile index 53199e22693..5791b70c910 100644 --- a/Makefile +++ b/Makefile @@ -11,8 +11,8 @@ GO = go # TODO(a.garipov): Add more default proxies using pipes after update to # Go 1.15. # -# GOPROXY = https://goproxy.io|https://athens.azurefd.net -GOPROXY = https://athens.azurefd.net +# GOPROXY = https://goproxy.io|https://goproxy.cn +GOPROXY = https://goproxy.cn,https://goproxy.io,direct GPG_KEY_PASSPHRASE = not-a-real-password NPM = npm NPM_FLAGS = --prefix $(CLIENT_DIR) @@ -55,7 +55,7 @@ js-lint: ; $(NPM) $(NPM_FLAGS) run lint js-test: ; $(NPM) $(NPM_FLAGS) run test go-build: ; $(ENV) $(SHELL) ./scripts/go-build.sh -go-deps: ; $(ENV) $(GO) mod download +go-deps: ; $(ENV) $(SHELL) ./scripts/go-deps.sh go-gen: ; $(ENV) $(GO) generate ./... go-lint: ; $(ENV) $(SHELL) ./scripts/go-lint.sh go-test: ; $(ENV) $(SHELL) ./scripts/go-test.sh diff --git a/scripts/go-deps.sh b/scripts/go-deps.sh new file mode 100644 index 00000000000..d49a64fcf41 --- /dev/null +++ b/scripts/go-deps.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +verbose="${VERBOSE:-0}" + +if [ "$verbose" -gt '0' ] +then + set -x + x_flags='-x' +else + x_flags='' +fi + +set -e -f -u + +go="${GO:-go}" + +# Don't use quotes with flag variables because we want an empty space if +# those aren't set. +"$go" mod download $x_flags diff --git a/scripts/go-test.sh b/scripts/go-test.sh index 80ad0768f38..cf56db6c722 100644 --- a/scripts/go-test.sh +++ b/scripts/go-test.sh @@ -9,17 +9,17 @@ verbose="${VERBOSE:-0}" if [ "$verbose" -gt '0' ] then set -x - v_flag='-v' + v_flags='-v' if [ "$verbose" -gt '1' ] then - x_flag='-x' + x_flags='-x' else - x_flag='' + x_flags='' fi else - v_flag='' - x_flag='' + v_flags='' + x_flags='' fi set -e -f -u @@ -27,15 +27,15 @@ set -e -f -u race="${RACE:-1}" if [ "$race" = '0' ] then - race_flag='' + race_flags='' else - race_flag='--race' + race_flags='--race' fi go="${GO:-go}" -cover_flag='--coverprofile ./coverage.txt' -count_flag='--count 1' +cover_flags='--coverprofile ./coverage.txt' +count_flags='--count 1' # Don't use quotes with flag variables because we want an empty space if # those aren't set. -"$go" test $race_flag $count_flag $cover_flag $x_flag $v_flag ./... +"$go" test $race_flags $count_flags $cover_flags $x_flags $v_flags ./...