-
Notifications
You must be signed in to change notification settings - Fork 503
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2166 from crazy-max/multi-golangci-lint
enable golangci-lint for supported platforms
- Loading branch information
Showing
4 changed files
with
24 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
run: | ||
timeout: 10m | ||
timeout: 30m | ||
skip-files: | ||
- ".*\\.pb\\.go$" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,19 @@ | ||
# syntax=docker/dockerfile:1 | ||
|
||
ARG GO_VERSION=1.21.3 | ||
ARG XX_VERSION=1.3.0 | ||
ARG GOLANGCI_LINT_VERSION=1.54.2 | ||
|
||
FROM golang:${GO_VERSION}-alpine | ||
FROM --platform=$BUILDPLATFORM tonistiigi/xx:${XX_VERSION} AS xx | ||
FROM --platform=$BUILDPLATFORM golang:${GO_VERSION}-alpine | ||
RUN apk add --no-cache git gcc musl-dev | ||
ENV GOFLAGS="-buildvcs=false" | ||
ARG GOLANGCI_LINT_VERSION | ||
RUN wget -O- -nv https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v${GOLANGCI_LINT_VERSION} | ||
COPY --link --from=xx / / | ||
WORKDIR /go/src/github.com/docker/buildx | ||
ARG TARGETPLATFORM | ||
RUN --mount=target=/go/src/github.com/docker/buildx \ | ||
--mount=target=/root/.cache,type=cache \ | ||
--mount=target=/root/.cache,type=cache,id=lint-cache-$TARGETPLATFORM \ | ||
xx-go --wrap && \ | ||
golangci-lint run |