From 034f485539c7756ce40bddd109a6ea033e19d29f Mon Sep 17 00:00:00 2001 From: surtur Date: Wed, 10 Aug 2022 16:27:14 +0200 Subject: [PATCH] ci: install golangci-lint from source using pre-built binaries absolutely *can* bite, e.g. in case of env/compile-time Go version mismatch (think golangci-lint built with go1.18 vs ran with go1.19 that is present in the env), which is why from now on it is going to be built right in the environment where it's going to be used with whatever version of Go is present there, that *will* guarantee it's able to run there. why the golangci-lint project (used to) discourage installation from sources (or using `go install`) is still beyond me (yeah, Reasons). refs: https://github.com/golangci/golangci-lint-action/issues/442#issuecomment-1203786890 https://github.com/golangci/golangci-lint-action/issues/530 https://github.com/golangci/golangci-lint-action/issues/540 # similar issue (the exact same, really) exhibited way earlier than go1.19... https://github.com/golangci/golangci-lint/issues/2673 --- .drone.star | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.drone.star b/.drone.star index f7deaec..b570abc 100644 --- a/.drone.star +++ b/.drone.star @@ -246,13 +246,15 @@ def main(ctx): "steps": [ { "name": "golangci-lint", - "image": "docker.io/immawanderer/archlinux-go-fyne:linux-amd64", + "image": "docker.io/library/golang:1.18.5-alpine3.16", "pull": "always", + "environment": { + "CGO_ENABLED": "0", + }, "commands": [ - "curl -sSfL " + - "https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh"+ - " | sh -s -- -b $(go env GOPATH)/bin v1.46.2", - "export PATH=\"$(go env GOPATH)/bin:$PATH\"", + "go install -v "+ + "github.com/golangci/golangci-lint/cmd/golangci-lint@"+ + "v1.47.2", "golangci-lint --version", "golangci-lint run -v --timeout 5m" ],