Skip to content

Commit

Permalink
GOPATH handling not necessary anymore
Browse files Browse the repository at this point in the history
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
  • Loading branch information
crazy-max committed Mar 30, 2023
1 parent 1165234 commit 804c0f2
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 18 deletions.
8 changes: 0 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@ jobs:

host:
runs-on: ${{ matrix.os }}
env:
GOPATH: ${{ github.workspace }}
GOBIN: ${{ github.workspace }}/bin
GO111MODULE: auto
strategy:
fail-fast: false
matrix:
Expand All @@ -57,8 +53,6 @@ jobs:
-
name: Checkout
uses: actions/checkout@v3
with:
path: ${{ env.GOPATH }}/src/github.com/docker/cli
-
name: Set up Go
uses: actions/setup-go@v4
Expand All @@ -69,11 +63,9 @@ jobs:
run: |
go test -coverprofile=/tmp/coverage.txt $(go list ./... | grep -vE '/vendor/|/e2e/')
go tool cover -func=/tmp/coverage.txt
working-directory: ${{ env.GOPATH }}/src/github.com/docker/cli
shell: bash
-
name: Send to Codecov
uses: codecov/codecov-action@v3
with:
file: /tmp/coverage.txt
working-directory: ${{ env.GOPATH }}/src/github.com/docker/cli
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ FROM --platform=$BUILDPLATFORM tonistiigi/xx:${XX_VERSION} AS xx
FROM --platform=$BUILDPLATFORM golang:${GO_VERSION}-alpine${ALPINE_VERSION} AS build-base-alpine
COPY --from=xx / /
RUN apk add --no-cache bash clang lld llvm file git
WORKDIR /go/src/github.com/docker/cli
WORKDIR /src

FROM build-base-alpine AS build-alpine
ARG TARGETPLATFORM
Expand All @@ -23,7 +23,7 @@ RUN xx-apk add --no-cache musl-dev gcc
FROM --platform=$BUILDPLATFORM golang:${GO_VERSION}-bullseye AS build-base-bullseye
COPY --from=xx / /
RUN apt-get update && apt-get install --no-install-recommends -y bash clang lld llvm file
WORKDIR /go/src/github.com/docker/cli
WORKDIR /src

FROM build-base-bullseye AS build-bullseye
ARG TARGETPLATFORM
Expand Down Expand Up @@ -119,7 +119,7 @@ COPY --from=build-plugins /out ./build/
COPY --from=buildx /buildx /usr/libexec/docker/cli-plugins/docker-buildx
COPY . .
ENV DOCKER_BUILDKIT=1
ENV PATH=/go/src/github.com/docker/cli/build:$PATH
ENV PATH=/src/build:$PATH
CMD ./scripts/test/e2e/entry

FROM build-base-${BASE_VARIANT} AS dev
Expand Down
2 changes: 1 addition & 1 deletion docker.Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#

# Overridable env vars
DOCKER_CLI_MOUNTS ?= -v "$(CURDIR)":/go/src/github.com/docker/cli
DOCKER_CLI_MOUNTS ?= -v "$(CURDIR)":/src
DOCKER_CLI_CONTAINER_NAME ?=
DOCKER_CLI_GO_BUILD_CACHE ?= y

Expand Down
4 changes: 2 additions & 2 deletions dockerfiles/Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ RUN echo -e "\nYou are now in a development container. Run '\e\033[1mmake help\e
&& echo -e "cat /etc/motd\nPS1=\"\e[0;32m\u@docker-cli-dev\\$ \e[0m\"" >> /root/.bashrc
CMD bash
ENV DISABLE_WARN_OUTSIDE_CONTAINER=1
ENV PATH=$PATH:/go/src/github.com/docker/cli/build
ENV PATH=$PATH:/src/build

COPY --from=buildx /buildx /usr/libexec/docker/cli-plugins/docker-buildx
COPY --from=gofumpt /go/bin/* /go/bin/
COPY --from=gotestsum /go/bin/* /go/bin/
COPY --from=goversioninfo /go/bin/* /go/bin/

WORKDIR /go/src/github.com/docker/cli
WORKDIR /src
ENV GO111MODULE=auto
COPY . .
4 changes: 2 additions & 2 deletions dockerfiles/Dockerfile.lint
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ FROM golang:${GO_VERSION}-alpine${ALPINE_VERSION} AS lint
ENV GO111MODULE=off
ENV CGO_ENABLED=0
ENV GOGC=75
WORKDIR /go/src/github.com/docker/cli
COPY --from=golangci-lint /usr/bin/golangci-lint /usr/bin/golangci-lint
WORKDIR /src
RUN --mount=type=bind,target=. \
--mount=type=cache,target=/root/.cache \
--mount=from=golangci-lint,source=/usr/bin/golangci-lint,target=/usr/bin/golangci-lint \
golangci-lint run
2 changes: 1 addition & 1 deletion dockerfiles/Dockerfile.shellcheck
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# syntax=docker/dockerfile:1

FROM koalaman/shellcheck-alpine:v0.7.1 AS shellcheck
WORKDIR /go/src/github.com/docker/cli
WORKDIR /src
RUN --mount=type=bind,target=. \
set -eo pipefail; \
find scripts/ contrib/completion/bash -type f | grep -v scripts/winresources | grep -v '.*.ps1' | xargs shellcheck
1 change: 0 additions & 1 deletion scripts/test/e2e/run
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ runtests() {
TEST_DOCKER_CERT_PATH="${DOCKER_CERT_PATH-}" \
TEST_REMOTE_DAEMON="${REMOTE_DAEMON-}" \
TEST_SKIP_PLUGIN_TESTS="${SKIP_PLUGIN_TESTS-}" \
GOPATH="$GOPATH" \
PATH="$PWD/build/:/usr/bin:/usr/local/bin:/usr/local/go/bin" \
HOME="$HOME" \
DOCKER_CLI_E2E_PLUGINS_EXTRA_DIRS="$PWD/build/plugins-linux-amd64" \
Expand Down

0 comments on commit 804c0f2

Please sign in to comment.