Skip to content

Commit

Permalink
run dockerized
Browse files Browse the repository at this point in the history
Signed-off-by: Nicolas De Loof <[email protected]>
  • Loading branch information
ndeloof committed Feb 24, 2025
1 parent 467c3a2 commit 51f5a25
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 37 deletions.
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ jobs:
uses: actions/checkout@v4
- name: Check license
run: DOCKER_BUILDKIT=1 make check-license
- uses: actions/setup-go@v5
- name: Check deepcopy
run: |
make deepcopy
Expand Down
9 changes: 4 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,20 @@ fmt: ## Format go files
go fmt ./...

.PHONY: deepcopy
deepcopy:
goderive -h >/dev/null 2>&1 || go install github.com/awalterschulze/goderive@0a721d5b1d722ae6ba0dddefa1200607ca3ece97
goderive ./types/...
deepcopy: build-validate-image
docker run --rm -v .:/go/src $(IMAGE_PREFIX)validate goderive ./types/...

.PHONY: build-validate-image
build-validate-image:
docker build . -f ci/Dockerfile -t $(IMAGE_PREFIX)validate

.PHONY: lint
lint: build-validate-image
docker run --rm $(IMAGE_PREFIX)validate bash -c "golangci-lint run --config ./.golangci.yml ./..."
docker run --rm -v .:/go/src $(IMAGE_PREFIX)validate golangci-lint run --config ./.golangci.yml ./...

.PHONY: check-license
check-license: build-validate-image
docker run --rm $(IMAGE_PREFIX)validate bash -c "./scripts/validate/fileheader"
docker run --rm -v .:/go/src $(IMAGE_PREFIX)validate ltag -t scripts/validate/template --excludes "validate dotenv" --check -v

.PHONY: setup
setup: ## Setup the precommit hook
Expand Down
6 changes: 3 additions & 3 deletions ci/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM golang:1.23
FROM golang:1.24

WORKDIR /go/src

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

COPY . .
RUN go install github.com/awalterschulze/[email protected]
RUN go install github.com/kunalkushwaha/[email protected]
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ require (

require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/kunalkushwaha/ltag v0.2.5 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f // indirect
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ github.com/go-viper/mapstructure/v2 v2.0.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlnd
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/kunalkushwaha/ltag v0.2.5 h1:kW2/mVXqIUG5NvkZQCTeGKMDjBJ/BGVEgrdfHyA3fnI=
github.com/kunalkushwaha/ltag v0.2.5/go.mod h1:w1hVMWOh870f+WAv/UIoZAy0bHCbPP4+W6JxNcPUiQA=
github.com/mattn/go-shellwords v1.0.12 h1:M2zGm7EW6UQJvDeQxo4T51eKPurbeFbe8WtebGE2xrk=
github.com/mattn/go-shellwords v1.0.12/go.mod h1:EZzvwXDESEeg03EKmM+RmDnNOPKG4lLtQsUlTZDWQ8Y=
github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U=
Expand Down
28 changes: 0 additions & 28 deletions scripts/validate/fileheader

This file was deleted.

0 comments on commit 51f5a25

Please sign in to comment.