ci: install golangci-lint from source
All checks were successful
continuous-integration/drone/push Build is passing

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
This commit is contained in:
surtur 2022-08-10 16:27:14 +02:00
parent f511e1269a
commit 034f485539
Signed by: wanderer
GPG Key ID: 19CE1EC1D9E0486D

@ -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"
],