-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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 #3211 from crazy-max/gha
GitHub Actions for lint
- Loading branch information
Showing
8 changed files
with
62 additions
and
88 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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: validate | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- 'master' | ||
- '[0-9]+.[0-9]{2}' | ||
tags: | ||
- 'v*' | ||
pull_request: | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
target: | ||
- lint | ||
- shellcheck | ||
steps: | ||
- | ||
name: Checkout | ||
uses: actions/checkout@v2 | ||
- | ||
name: Run | ||
uses: docker/bake-action@v1 | ||
with: | ||
targets: ${{ matrix.target }} |
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
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,24 +1,16 @@ | ||
# syntax=docker/dockerfile:1.3 | ||
|
||
ARG GO_VERSION=1.16.6 | ||
ARG GOLANGCI_LINTER_SHA="v1.21.0" | ||
ARG GOLANGCI_LINT_VERSION=v1.23.8 | ||
|
||
FROM golang:${GO_VERSION}-alpine AS build | ||
ENV CGO_ENABLED=0 | ||
RUN apk add --no-cache git | ||
ARG GOLANGCI_LINTER_SHA | ||
ARG GO111MODULE=on | ||
RUN --mount=type=cache,target=/root/.cache/go-build \ | ||
--mount=type=cache,target=/go/pkg/mod \ | ||
go get github.com/golangci/golangci-lint/cmd/golangci-lint@${GOLANGCI_LINTER_SHA} | ||
FROM golangci/golangci-lint:${GOLANGCI_LINT_VERSION}-alpine AS golangci-lint | ||
|
||
FROM golang:${GO_VERSION}-alpine AS lint | ||
ENV GO111MODULE=off | ||
ENV CGO_ENABLED=0 | ||
ENV DISABLE_WARN_OUTSIDE_CONTAINER=1 | ||
COPY --from=build /go/bin/golangci-lint /usr/local/bin | ||
FROM golang:${GO_VERSION}-alpine AS lint | ||
ENV GO111MODULE=off | ||
ENV CGO_ENABLED=0 | ||
ENV GOGC=75 | ||
WORKDIR /go/src/github.com/docker/cli | ||
ENV GOGC=75 | ||
ENTRYPOINT ["/usr/local/bin/golangci-lint"] | ||
CMD ["run", "--config=.golangci.yml"] | ||
COPY . . | ||
COPY --from=golangci-lint /usr/bin/golangci-lint /usr/bin/golangci-lint | ||
RUN --mount=type=bind,target=. \ | ||
--mount=type=cache,target=/root/.cache \ | ||
golangci-lint run |
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,7 @@ | ||
FROM koalaman/shellcheck-alpine:v0.7.1 | ||
RUN apk add --no-cache bash make | ||
# syntax=docker/dockerfile:1.3 | ||
|
||
FROM koalaman/shellcheck-alpine:v0.7.1 AS shellcheck | ||
WORKDIR /go/src/github.com/docker/cli | ||
ENV DISABLE_WARN_OUTSIDE_CONTAINER=1 | ||
COPY . . | ||
RUN --mount=type=bind,target=. \ | ||
set -eo pipefail; \ | ||
find scripts/ contrib/completion/bash -type f | grep -v scripts/winresources | grep -v '.*.ps1' | xargs shellcheck |
This file was deleted.
Oops, something went wrong.