Skip to content

Commit

Permalink
all: imp scripts, try another goproxy and direct
Browse files Browse the repository at this point in the history
  • Loading branch information
ainar-g committed Dec 24, 2020
1 parent 423229e commit c63a2a5
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
19 changes: 19 additions & 0 deletions scripts/go-deps.sh
Original file line number Diff line number Diff line change
@@ -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
20 changes: 10 additions & 10 deletions scripts/go-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,33 +9,33 @@ 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

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 ./...

0 comments on commit c63a2a5

Please sign in to comment.