diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5ccbd1d2..8f65aea0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 diff --git a/Makefile b/Makefile index 7c94b282..af143ff9 100644 --- a/Makefile +++ b/Makefile @@ -31,9 +31,8 @@ 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: @@ -41,11 +40,11 @@ build-validate-image: .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 diff --git a/ci/Dockerfile b/ci/Dockerfile index dedd69b6..07db4717 100644 --- a/ci/Dockerfile +++ b/ci/Dockerfile @@ -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/goderive@v0.5.1 +RUN go install github.com/kunalkushwaha/ltag@v0.2.5 diff --git a/scripts/validate/fileheader b/scripts/validate/fileheader deleted file mode 100755 index ce32e871..00000000 --- a/scripts/validate/fileheader +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env bash - -# Copyright The Compose Specification Authors. - -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at - -# http://www.apache.org/licenses/LICENSE-2.0 - -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -set -eu -o pipefail - -if ! command -v ltag; then - >&2 echo "ERROR: ltag not found. Install with:" - >&2 echo " go get -u github.com/kunalkushwaha/ltag" - exit 1 -fi - -BASEPATH="${1-}" - -ltag -t "${BASEPATH}scripts/validate/template" --excludes "validate dotenv" --check -v