Skip to content

Commit

Permalink
build,.github/workflows: install all tools in modules mode
Browse files Browse the repository at this point in the history
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 golang#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]>
  • Loading branch information
hyangah committed Aug 5, 2020
1 parent f9c0454 commit 9bdb768
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 47 deletions.
13 changes: 3 additions & 10 deletions .github/workflows/release-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,11 @@ jobs:
go get golang.org/x/lint/golint
go get golang.org/x/tools/cmd/gorename
go get golang.org/x/tools/gopls
go get github.com/cweill/gotests/...
go get github.com/rogpeppe/godef
go get github.com/ramya-rao-a/go-outline
env:
GO111MODULE: on

- name: Install Go tools (GOPATH mode)
run: |
go version
go get github.com/cweill/gotests/...
go get github.com/rogpeppe/godef
go get github.com/ramya-rao-a/go-outline
# Because some tests depend on the source code checked in GOPATH. TODO: FIX THEM.
env:
GO111MODULE: off

- name: Run unit tests
run: npm run unit-test
Expand Down
13 changes: 3 additions & 10 deletions .github/workflows/test-long.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,19 +54,12 @@ jobs:
go get golang.org/x/lint/golint
go get golang.org/x/tools/cmd/gorename
go get golang.org/x/tools/gopls
go get github.com/cweill/gotests/...
go get github.com/rogpeppe/godef
go get github.com/ramya-rao-a/go-outline
env:
GO111MODULE: on

- name: Install Go tools (GOPATH mode)
run: |
go version
go get github.com/cweill/gotests/...
go get github.com/rogpeppe/godef
go get github.com/ramya-rao-a/go-outline
# Because some tests depend on the source code checked in GOPATH. TODO: FIX THEM.
env:
GO111MODULE: off

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

Expand Down
15 changes: 4 additions & 11 deletions .github/workflows/test-smoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,11 @@ jobs:
go get golang.org/x/lint/golint
go get golang.org/x/tools/cmd/gorename
go get golang.org/x/tools/gopls
go get github.com/cweill/gotests/...
go get github.com/rogpeppe/godef
go get github.com/ramya-rao-a/go-outline
env:
GO111MODULE: on

- name: Install Go tools (GOPATH mode)
run: |
go version
go get github.com/cweill/gotests/...
go get github.com/rogpeppe/godef
go get github.com/ramya-rao-a/go-outline
# Because some tests depend on the source code checked in GOPATH. TODO: FIX THEM.
env:
GO111MODULE: off
GO111MODULE: on

- name: Run unit tests
run: npm run unit-test
Expand Down
28 changes: 12 additions & 16 deletions build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,24 @@ RUN mkdir /go
COPY --from=gobuilder /gobin /go/bin
COPY --from=gobuilder /usr/local/go /usr/local/go

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

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

# Install other Go tools tests depend on
RUN go get -u -v \
github.com/acroca/go-symbols \
github.com/cweill/gotests/... \
github.com/davidrjenni/reftools/cmd/fillstruct \
github.com/haya14busa/goplay/cmd/goplay \
github.com/mdempsky/gocode \
github.com/ramya-rao-a/go-outline \
github.com/rogpeppe/godef \
github.com/sqs/goreturns \
github.com/uudashr/gopkgs/v2/cmd/gopkgs \
github.com/zmb3/gogetdoc \
golang.org/x/lint/golint \
golang.org/x/tools/cmd/gorename

RUN GO111MODULE=on go get -x -v github.com/acroca/go-symbols &&
GO111MODULE=on go get -x -v github.com/cweill/gotests/... &&
GO111MODULE=on go get -x -v github.com/davidrjenni/reftools/cmd/fillstruct &&
GO111MODULE=on go get -x -v github.com/haya14busa/goplay/cmd/goplay &&
GO111MODULE=on go get -x -v github.com/mdempsky/gocode &&
GO111MODULE=on go get -x -v github.com/ramya-rao-a/go-outline &&
GO111MODULE=on go get -x -v github.com/rogpeppe/godef &&
GO111MODULE=on go get -x -v github.com/sqs/goreturns &&
GO111MODULE=on go get -x -v github.com/uudashr/gopkgs/v2/cmd/gopkgs &&
GO111MODULE=on go get -x -v github.com/zmb3/gogetdoc &&
GO111MODULE=on go get -x -v golang.org/x/lint/golint &&
GO111MODULE=on go get -x -v golang.org/x/tools/cmd/gorename

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

0 comments on commit 9bdb768

Please sign in to comment.