Skip to content

Add Go modules to vendor directory #17

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
13 changes: 6 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.

.DEFAULT_GOAL := help

PACKAGE=github.com/compose-spec/conformance-tests
IMAGE_PREFIX=composespec/conformance-tests-

.DEFAULT_GOAL := help
GOFLAGS=-mod=vendor

.PHONY: check
check: ## Checks the environment before running any command
Expand All @@ -24,12 +26,12 @@ check: ## Checks the environment before running any command

.PHONY: images
images: ## Build the test images
docker build server -t $(IMAGE_PREFIX)server
docker build client -t $(IMAGE_PREFIX)client
docker build . -f server/Dockerfile -t $(IMAGE_PREFIX)server
docker build . -f client/Dockerfile -t $(IMAGE_PREFIX)client

.PHONY: test
test: check images ## Run tests
GOPRIVATE=$(PACKAGE) go test ./... -v
GOPRIVATE=$(PACKAGE) GOFLAGS=$(GOFLAGS) go test ./... -v

.PHONY: fmt
fmt: ## Format go files
Expand All @@ -47,9 +49,6 @@ lint: build-validate-image
check-license: build-validate-image
docker run --rm $(IMAGE_PREFIX)validate bash -c "./scripts/validate/fileheader"

.PHONY: validate
validate: lint check-license

.PHONY: help
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
8 changes: 4 additions & 4 deletions ci/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
FROM golang:1.14

WORKDIR /go/src
RUN go mod init github.com/compose-spec/conformance-tests

ARG GOLANGCILINT_VERSION=v1.23.8
ARG GOLANGCILINT_VERSION=v1.24.0
RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin ${GOLANGCILINT_VERSION}
RUN go get -u github.com/kunalkushwaha/ltag
RUN go get -v -u github.com/kunalkushwaha/ltag && rm -rf /go/src/github.com/kunalkushwaha

COPY . /go/src
ENV GOFLAGS=-mod=vendor
COPY . .
3 changes: 1 addition & 2 deletions client/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
FROM golang:1.14 AS dev
WORKDIR /go/src
COPY . .
RUN go mod init github.com/compose-spec/conformance-tests/client
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o /client .
RUN CGO_ENABLED=0 GOFLAGS=-mod=vendor go build -o /client client/main.go

FROM scratch AS run
COPY --from=dev client /
Expand Down
2 changes: 1 addition & 1 deletion scripts/validate/fileheader
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ fi

BASEPATH="${1-}"

ltag -t "${BASEPATH}scripts/validate/template" --excludes "validate" --check -v
ltag -t "${BASEPATH}scripts/validate/template" --excludes "validate vendor" --check -v
3 changes: 1 addition & 2 deletions server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
FROM golang:1.14 AS dev
WORKDIR /go/src
COPY . .
RUN go mod init github.com/compose-spec/conformance-tests/server
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o /server .
RUN CGO_ENABLED=0 GOFLAGS=-mod=vendor go build -o /server server/main.go

FROM scratch AS run
COPY --from=dev server /
Expand Down
27 changes: 27 additions & 0 deletions vendor/github.com/google/go-cmp/LICENSE

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading