Skip to content

Commit 9bdb768

Browse files
committed
build,.github/workflows: install all tools in modules mode
Tests do not need the source code of some tools. Build all tools in modules mode as the extension does. Also, remove explicit setting of GOPATH for testing. Fixes #6 Change-Id: Ifff7262bd0debece5781ac73c091ba9d15acc440 Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/244772 Run-TryBot: Hyang-Ah Hana Kim <[email protected]> Reviewed-by: Rebecca Stambler <[email protected]>
1 parent f9c0454 commit 9bdb768

File tree

4 files changed

+22
-47
lines changed

4 files changed

+22
-47
lines changed

.github/workflows/release-nightly.yml

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,18 +55,11 @@ jobs:
5555
go get golang.org/x/lint/golint
5656
go get golang.org/x/tools/cmd/gorename
5757
go get golang.org/x/tools/gopls
58+
go get github.com/cweill/gotests/...
59+
go get github.com/rogpeppe/godef
60+
go get github.com/ramya-rao-a/go-outline
5861
env:
5962
GO111MODULE: on
60-
61-
- name: Install Go tools (GOPATH mode)
62-
run: |
63-
go version
64-
go get github.com/cweill/gotests/...
65-
go get github.com/rogpeppe/godef
66-
go get github.com/ramya-rao-a/go-outline
67-
# Because some tests depend on the source code checked in GOPATH. TODO: FIX THEM.
68-
env:
69-
GO111MODULE: off
7063

7164
- name: Run unit tests
7265
run: npm run unit-test

.github/workflows/test-long.yml

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,19 +54,12 @@ jobs:
5454
go get golang.org/x/lint/golint
5555
go get golang.org/x/tools/cmd/gorename
5656
go get golang.org/x/tools/gopls
57+
go get github.com/cweill/gotests/...
58+
go get github.com/rogpeppe/godef
59+
go get github.com/ramya-rao-a/go-outline
5760
env:
5861
GO111MODULE: on
5962

60-
- name: Install Go tools (GOPATH mode)
61-
run: |
62-
go version
63-
go get github.com/cweill/gotests/...
64-
go get github.com/rogpeppe/godef
65-
go get github.com/ramya-rao-a/go-outline
66-
# Because some tests depend on the source code checked in GOPATH. TODO: FIX THEM.
67-
env:
68-
GO111MODULE: off
69-
7063
- name: Run unit tests
7164
run: npm run unit-test
7265

.github/workflows/test-smoke.yml

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,18 +50,11 @@ jobs:
5050
go get golang.org/x/lint/golint
5151
go get golang.org/x/tools/cmd/gorename
5252
go get golang.org/x/tools/gopls
53+
go get github.com/cweill/gotests/...
54+
go get github.com/rogpeppe/godef
55+
go get github.com/ramya-rao-a/go-outline
5356
env:
54-
GO111MODULE: on
55-
56-
- name: Install Go tools (GOPATH mode)
57-
run: |
58-
go version
59-
go get github.com/cweill/gotests/...
60-
go get github.com/rogpeppe/godef
61-
go get github.com/ramya-rao-a/go-outline
62-
# Because some tests depend on the source code checked in GOPATH. TODO: FIX THEM.
63-
env:
64-
GO111MODULE: off
57+
GO111MODULE: on
6558

6659
- name: Run unit tests
6760
run: npm run unit-test

build/Dockerfile

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,28 +14,24 @@ RUN mkdir /go
1414
COPY --from=gobuilder /gobin /go/bin
1515
COPY --from=gobuilder /usr/local/go /usr/local/go
1616

17-
# TODO(hyangah): some tests fail if GOPATH is not set. Fix them.
18-
ENV GOPATH=/go
1917
ENV PATH=${GOPATH}/bin:/usr/local/go/bin:${PATH}
2018
ENV DEBIAN_FRONTEND noninteractive
2119

2220
RUN apt-get update && apt-get install -y libnss3 libgtk-3-dev libxss1 libasound2 xvfb libsecret-1-0
2321

2422
# Install other Go tools tests depend on
25-
RUN go get -u -v \
26-
github.com/acroca/go-symbols \
27-
github.com/cweill/gotests/... \
28-
github.com/davidrjenni/reftools/cmd/fillstruct \
29-
github.com/haya14busa/goplay/cmd/goplay \
30-
github.com/mdempsky/gocode \
31-
github.com/ramya-rao-a/go-outline \
32-
github.com/rogpeppe/godef \
33-
github.com/sqs/goreturns \
34-
github.com/uudashr/gopkgs/v2/cmd/gopkgs \
35-
github.com/zmb3/gogetdoc \
36-
golang.org/x/lint/golint \
37-
golang.org/x/tools/cmd/gorename
38-
23+
RUN GO111MODULE=on go get -x -v github.com/acroca/go-symbols &&
24+
GO111MODULE=on go get -x -v github.com/cweill/gotests/... &&
25+
GO111MODULE=on go get -x -v github.com/davidrjenni/reftools/cmd/fillstruct &&
26+
GO111MODULE=on go get -x -v github.com/haya14busa/goplay/cmd/goplay &&
27+
GO111MODULE=on go get -x -v github.com/mdempsky/gocode &&
28+
GO111MODULE=on go get -x -v github.com/ramya-rao-a/go-outline &&
29+
GO111MODULE=on go get -x -v github.com/rogpeppe/godef &&
30+
GO111MODULE=on go get -x -v github.com/sqs/goreturns &&
31+
GO111MODULE=on go get -x -v github.com/uudashr/gopkgs/v2/cmd/gopkgs &&
32+
GO111MODULE=on go get -x -v github.com/zmb3/gogetdoc &&
33+
GO111MODULE=on go get -x -v golang.org/x/lint/golint &&
34+
GO111MODULE=on go get -x -v golang.org/x/tools/cmd/gorename
3935

4036
WORKDIR /workspace
4137
ENTRYPOINT ["build/all.bash"]

0 commit comments

Comments
 (0)