mirror of
https://code.forgejo.org/forgejo/runner.git
synced 2025-09-25 19:17:01 +00:00
This PR contains the following updates: | Package | Change | Age | Confidence | |---|---|---|---| | [github.com/golangci/golangci-lint/cmd/golangci-lint](https://github.com/golangci/golangci-lint) | `v1.62.2` -> `v1.64.8` | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>golangci/golangci-lint (github.com/golangci/golangci-lint/cmd/golangci-lint)</summary> ### [`v1.64.8`](https://github.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v1648) [Compare Source](https://github.com/golangci/golangci-lint/compare/v1.64.7...v1.64.8) - Detects use of configuration files from golangci-lint v2 ### [`v1.64.7`](https://github.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v1647) [Compare Source](https://github.com/golangci/golangci-lint/compare/v1.64.6...v1.64.7) 1. Linters bug fixes - `depguard`: from 2.2.0 to 2.2.1 - `dupl`: from [`3e9179a`](3e9179ac44
) to [`f665c8d`](f665c8d69b
) - `gosec`: from 2.22.1 to 2.22.2 - `staticcheck`: from 0.6.0 to 0.6.1 2. Documentation - Add GitLab documentation ### [`v1.64.6`](https://github.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v1646) [Compare Source](https://github.com/golangci/golangci-lint/compare/v1.64.5...v1.64.6) 1. Linters bug fixes - `asciicheck`: from 0.4.0 to 0.4.1 - `contextcheck`: from 1.1.5 to 1.1.6 - `errcheck`: from 1.8.0 to 1.9.0 - `exptostd`: from 0.4.1 to 0.4.2 - `ginkgolinter`: from 0.19.0 to 0.19.1 - `go-exhaustruct`: from 3.3.0 to 3.3.1 - `gocheckcompilerdirectives`: from 1.2.1 to 1.3.0 - `godot`: from 1.4.20 to 1.5.0 - `perfsprint`: from 0.8.1 to 0.8.2 - `revive`: from 1.6.1 to 1.7.0 - `tagalign`: from 1.4.1 to 1.4.2 ### [`v1.64.5`](https://github.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v1645) [Compare Source](https://github.com/golangci/golangci-lint/compare/v1.64.4...v1.64.5) 1. Bug fixes - Add missing flag `new-from-merge-base-flag` 2. Linters bug fixes - `asciicheck`: from 0.3.0 to 0.4.0 - `forcetypeassert`: from 0.1.0 to 0.2.0 - `gosec`: from 2.22.0 to 2.22.1 ### [`v1.64.4`](https://github.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v1644) [Compare Source](https://github.com/golangci/golangci-lint/compare/v1.64.3...v1.64.4) 1. Linters bug fixes - `gci`: fix standard packages list for go1.24 ### [`v1.64.3`](https://github.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v1643) [Compare Source](https://github.com/golangci/golangci-lint/compare/v1.64.2...v1.64.3) 1. Linters bug fixes - `ginkgolinter`: from 0.18.4 to 0.19.0 - `go-critic`: from 0.11.5 to 0.12.0 - `revive`: from 1.6.0 to 1.6.1 - `gci`: fix standard packages list for go1.24 2. Misc. - Build Docker images with go1.24 ### [`v1.64.2`](https://github.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v1642) [Compare Source](https://github.com/golangci/golangci-lint/compare/v1.64.1...v1.64.2) This is the last minor release of golangci-lint v1. The next release will be golangci-lint [v2](https://github.com/golangci/golangci-lint/issues/5300). 1. Enhancements - 🎉 go1.24 support - New `issues.new-from-merge-base` option - New `run.relative-path-mode` option 2. Linters new features - `copyloopvar`: from 1.1.0 to 1.2.1 (support suggested fixes) - `exptostd`: from 0.3.1 to 0.4.1 (handles `golang.org/x/exp/constraints.Ordered`) - `fatcontext`: from 0.5.3 to 0.7.1 (new option: `check-struct-pointers`) - `perfsprint`: from 0.7.1 to 0.8.1 (new options: `integer-format`, `error-format`, `string-format`, `bool-format`, and `hex-format`) - `revive`: from 1.5.1 to 1.6.0 (new rules: `redundant-build-tag`, `use-errors-new`. New option `early-return.early-return`) 3. Linters bug fixes - `go-errorlint`: from 1.7.0 to 1.7.1 - `gochecknoglobals`: from 0.2.1 to 0.2.2 - `godox`: from [`006bad1`](006bad1f9d
) to 1.1.0 - `gosec`: from 2.21.4 to 2.22.0 - `iface`: from 1.3.0 to 1.3.1 - `nilnesserr`: from 0.1.1 to 0.1.2 - `protogetter`: from 0.3.8 to 0.3.9 - `sloglint`: from 0.7.2 to 0.9.0 - `spancheck`: fix default `StartSpanMatchersSlice` values - `staticcheck`: from 0.5.1 to 0.6.0 4. Deprecations - ⚠️ `tenv` is deprecated and replaced by `usetesting.os-setenv: true`. - ⚠️ `exportloopref` deprecation step 2 5. Misc. - Sanitize severities by output format - Avoid panic with plugin without description 6. Documentation - Clarify `depguard` configuration ### [`v1.64.1`](https://github.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v1641) [Compare Source](https://github.com/golangci/golangci-lint/compare/v1.64.0...v1.64.1) Cancelled due to CI failure. ### [`v1.64.0`](https://github.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v1640) [Compare Source](https://github.com/golangci/golangci-lint/compare/v1.63.4...v1.64.0) Cancelled due to CI failure. ### [`v1.63.4`](https://github.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v1634) [Compare Source](https://github.com/golangci/golangci-lint/compare/v1.63.3...v1.63.4) 1. Linters bug fixes - `dupl`, `gomodguard`, `revive`: keep only Go-files. ### [`v1.63.3`](https://github.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v1633) [Compare Source](https://github.com/golangci/golangci-lint/compare/v1.63.2...v1.63.3) 1. Linters bug fixes - `gofmt`, `gofumpt`, `goimports`, `gci`: panic with several trailing EOL - `goheader`: skip issues with invalid positions ### [`v1.63.2`](https://github.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v1632) [Compare Source](https://github.com/golangci/golangci-lint/compare/v1.63.1...v1.63.2) 1. Linters bug fixes - `gofmt`, `gofumpt`, `goimports`, `gci`: panic with missing trailing EOL ### [`v1.63.1`](https://github.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v1631) [Compare Source](https://github.com/golangci/golangci-lint/compare/v1.63.0...v1.63.1) 1. Linters bug fixes - `cgi`: invalid reports with cgo - `gofumpt`: panic with autofix and cgo ### [`v1.63.0`](https://github.com/golangci/golangci-lint/blob/HEAD/CHANGELOG.md#v1630) [Compare Source](https://github.com/golangci/golangci-lint/compare/v1.62.2...v1.63.0) 1. Enhancements - Add support for SuggestedFixes 🎉 (35 linters can "autofix" reports). - Formatters (`gofmt`, `goimports`, `gofumpt`, `gci`) are applied after the suggested fixes. 2. New linters - Add `exptostd` linter https://github.com/ldez/exptostd - Add `nilnesserr` linter https://github.com/alingse/nilnesserr - Add `usetesting` linter https://github.com/ldez/usetesting 3. Linters new features - `gci`: new options: `no-inline-comments`, `no-prefix-comments` - `gomoddirectives`: from 0.2.4 to 0.6.0 (new options: `go-version-pattern`, `toolchain-pattern`,`toolchain-forbidden`, `tool-forbidden`, `go-debug-forbidden`) - `govet`: new `stdversion`, `waitgroup` analyzers - `importas`: allow multiple empty aliases - `loggercheck`: new `slog` option - `recvcheck`: from 0.1.2 to 0.2.0 (new options: `disable-builtin`, `exclusions`) - `tagliatelle`: from 0.5.0 to 0.7.1 (new options: `ignored-fields`, `extended-rules`,`overrides`, `pkg`, `ignore`) - `usestdlibvars`: from 1.27.0 to 1.28.0 (autofix) - `wrapcheck`: from 2.9.0 to 2.10.0 (new option: `extra-ignore-sigs`) 4. Linters bug fixes - `asciicheck`: from 0.2.0 to 0.3.0 - `bodyclose`: from [`5742072`](5742072509
) to [`ed6a65f`](ed6a65f985
) - `funlen`: from 0.1.0 to 0.2.0 - `ginkgolinter`: from 0.18.3 to 0.18.4 - `gochecksumtype`: from 0.2.0 to 0.3.1 - `gocognit`: from 1.1.3 to 1.2.0 - `godot`: from 1.4.18 to 1.4.20 - `goheader`: report position improvement - `gosec`: handling of global nosec option when it is false - `iface`: from 1.2.1 to 1.3.0 - `importas`: from 0.1.0 to 0.2.0 - `intrange`: from 0.2.1 to 0.3.0 - `makezero`: from 1.1.1 to 1.2.0 - `mirror`: from 1.2.0 to 1.3.0 - `nilnil`: from 1.0.0 to 1.0.1 - `nosprintfhostport`: from 0.1.1 to 0.2.0 - `reassign`: from 0.2.0 to 0.3.0 - `spancheck`: from 0.6.2 to 0.6.4 - `tagalign`: from 1.3.4 to 1.4.1 - `wastedassign`: from 2.0.7 to 2.1.0 - `whitespace`: from 0.1.1 to 0.2.0 - `wsl`: from 4.4.1 to 4.5.0 5. Deprecations - ⚠️ `output.uniq-by-line` is deprecated and replaced by `issues.uniq-by-line`. 6. Misc. - Improvements of the help command (color and JSON support). - Removes `decoder`, `sloglint`, `tagalign` from `format` preset. - Enables paths with junction inside Windows. - The timeout is disabled if `run.timeout` <= 0. </details> --- ### Configuration 📅 **Schedule**: Branch creation - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC), Automerge - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS4yMy4yIiwidXBkYXRlZEluVmVyIjoiNDEuMjMuMiIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==--> Reviewed-on: https://code.forgejo.org/forgejo/runner/pulls/690 Reviewed-by: earl-warren <earl-warren@noreply.code.forgejo.org> Co-authored-by: Renovate Bot <bot@kriese.eu> Co-committed-by: Renovate Bot <bot@kriese.eu>
148 lines
4.2 KiB
Makefile
148 lines
4.2 KiB
Makefile
DIST := dist
|
|
EXECUTABLE := forgejo-runner
|
|
GOFMT ?= gofumpt -l
|
|
DIST := dist
|
|
DIST_DIRS := $(DIST)/binaries $(DIST)/release
|
|
GO ?= $(shell go env GOROOT)/bin/go
|
|
SHASUM ?= shasum -a 256
|
|
HAS_GO = $(shell hash $(GO) > /dev/null 2>&1 && echo "GO" || echo "NOGO" )
|
|
|
|
LINUX_ARCHS ?= linux/amd64,linux/arm64
|
|
DARWIN_ARCHS ?= darwin-12/amd64,darwin-12/arm64
|
|
WINDOWS_ARCHS ?= windows/amd64
|
|
GO_FMT_FILES := $(shell find . -type f -name "*.go" ! -name "generated.*")
|
|
GOFILES := $(shell find . -type f -name "*.go" -o -name "go.mod" ! -name "generated.*")
|
|
|
|
MOCKERY_PACKAGE ?= github.com/vektra/mockery/v2@v2.53.4 # renovate: datasource=go
|
|
GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/cmd/golangci-lint@v1.64.8 # renovate: datasource=go
|
|
|
|
DOCKER_IMAGE ?= gitea/act_runner
|
|
DOCKER_TAG ?= nightly
|
|
DOCKER_REF := $(DOCKER_IMAGE):$(DOCKER_TAG)
|
|
DOCKER_ROOTLESS_REF := $(DOCKER_IMAGE):$(DOCKER_TAG)-dind-rootless
|
|
|
|
EXTLDFLAGS = -extldflags "-static" $(null)
|
|
|
|
ifeq ($(HAS_GO), GO)
|
|
GOPATH ?= $(shell $(GO) env GOPATH)
|
|
export PATH := $(GOPATH)/bin:$(PATH)
|
|
|
|
CGO_EXTRA_CFLAGS := -DSQLITE_MAX_VARIABLE_NUMBER=32766
|
|
CGO_CFLAGS ?= $(shell $(GO) env CGO_CFLAGS) $(CGO_EXTRA_CFLAGS)
|
|
endif
|
|
|
|
ifeq ($(OS), Windows_NT)
|
|
GOFLAGS := -v -buildmode=exe
|
|
EXECUTABLE ?= $(EXECUTABLE).exe
|
|
else ifeq ($(OS), Windows)
|
|
GOFLAGS := -v -buildmode=exe
|
|
EXECUTABLE ?= $(EXECUTABLE).exe
|
|
else
|
|
GOFLAGS := -v
|
|
EXECUTABLE ?= $(EXECUTABLE)
|
|
endif
|
|
|
|
STORED_VERSION_FILE := VERSION
|
|
|
|
ifneq ($(DRONE_TAG),)
|
|
VERSION ?= $(subst v,,$(DRONE_TAG))
|
|
RELEASE_VERSION ?= $(VERSION)
|
|
else
|
|
ifneq ($(DRONE_BRANCH),)
|
|
VERSION ?= $(subst release/v,,$(DRONE_BRANCH))
|
|
else
|
|
VERSION ?= main
|
|
endif
|
|
|
|
STORED_VERSION=$(shell cat $(STORED_VERSION_FILE) 2>/dev/null)
|
|
ifneq ($(STORED_VERSION),)
|
|
RELEASE_VERSION ?= $(STORED_VERSION)
|
|
else
|
|
RELEASE_VERSION ?= $(shell git describe --tags --always | sed 's/-/+/' | sed 's/^v//')
|
|
endif
|
|
endif
|
|
|
|
GO_PACKAGES_TO_VET ?= $(filter-out runner.forgejo.org/internal/pkg/client/mocks,$(shell $(GO) list ./...))
|
|
|
|
TAGS ?=
|
|
LDFLAGS ?= -X "runner.forgejo.org/internal/pkg/ver.version=v$(RELEASE_VERSION)"
|
|
|
|
all: build
|
|
|
|
.PHONY: lint
|
|
lint-check:
|
|
$(GO) run $(GOLANGCI_LINT_PACKAGE) run $(GOLANGCI_LINT_ARGS)
|
|
|
|
.PHONY: lint-fix
|
|
lint:
|
|
$(GO) run $(GOLANGCI_LINT_PACKAGE) run $(GOLANGCI_LINT_ARGS) --fix
|
|
|
|
fmt:
|
|
@hash gofumpt > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
|
|
$(GO) install mvdan.cc/gofumpt@latest; \
|
|
fi
|
|
$(GOFMT) -w $(GO_FMT_FILES)
|
|
|
|
.PHONY: go-check
|
|
go-check:
|
|
$(eval MIN_GO_VERSION_STR := $(shell grep -Eo '^go\s+[0-9]+\.[0-9]+' go.mod | cut -d' ' -f2))
|
|
$(eval MIN_GO_VERSION := $(shell printf "%03d%03d" $(shell echo '$(MIN_GO_VERSION_STR)' | tr '.' ' ')))
|
|
$(eval GO_VERSION := $(shell printf "%03d%03d" $(shell $(GO) version | grep -Eo '[0-9]+\.[0-9]+' | tr '.' ' ');))
|
|
@if [ "$(GO_VERSION)" -lt "$(MIN_GO_VERSION)" ]; then \
|
|
echo "Act Runner requires Go $(MIN_GO_VERSION_STR) or greater to build. You can get it at https://go.dev/dl/"; \
|
|
exit 1; \
|
|
fi
|
|
|
|
.PHONY: fmt-check
|
|
fmt-check:
|
|
@hash gofumpt > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
|
|
$(GO) install mvdan.cc/gofumpt@latest; \
|
|
fi
|
|
@diff=$$($(GOFMT) -d $(GO_FMT_FILES)); \
|
|
if [ -n "$$diff" ]; then \
|
|
echo "Please run 'make fmt' and commit the result:"; \
|
|
echo "$${diff}"; \
|
|
exit 1; \
|
|
fi;
|
|
|
|
test: lint-check fmt-check
|
|
@$(GO) test -v -cover -coverprofile coverage.txt ./... && echo "\n==>\033[32m Ok\033[m\n" || exit 1
|
|
|
|
.PHONY: vet
|
|
vet:
|
|
@echo "Running go vet..."
|
|
@$(GO) vet $(GO_PACKAGES_TO_VET)
|
|
|
|
.PHONY: generate
|
|
generate:
|
|
$(GO) generate ./...
|
|
|
|
install: $(GOFILES)
|
|
$(GO) install -v -tags '$(TAGS)' -ldflags '$(EXTLDFLAGS)-s -w $(LDFLAGS)'
|
|
|
|
build: go-check $(EXECUTABLE)
|
|
|
|
$(EXECUTABLE): $(GOFILES)
|
|
$(GO) build -v -tags 'netgo osusergo $(TAGS)' -ldflags '$(EXTLDFLAGS)-s -w $(LDFLAGS)' -o $@
|
|
|
|
.PHONY: deps-tools
|
|
deps-tools:
|
|
$(GO) install $(MOCKERY_PACKAGE)
|
|
|
|
$(DIST_DIRS):
|
|
mkdir -p $(DIST_DIRS)
|
|
|
|
.PHONY: docker
|
|
docker:
|
|
if ! docker buildx version >/dev/null 2>&1; then \
|
|
ARG_DISABLE_CONTENT_TRUST=--disable-content-trust=false; \
|
|
fi; \
|
|
docker build $${ARG_DISABLE_CONTENT_TRUST} -t $(DOCKER_REF) .
|
|
docker build $${ARG_DISABLE_CONTENT_TRUST} -t $(DOCKER_ROOTLESS_REF) -f Dockerfile.rootless .
|
|
|
|
clean:
|
|
$(GO) clean -x -i ./...
|
|
rm -rf coverage.txt $(EXECUTABLE) $(DIST)
|
|
|
|
version:
|
|
@echo $(VERSION)
|