diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 19db1e0..8390e21 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -21,6 +21,13 @@ jobs: # the cache key, and specifying multiple go.sums is not trivial # (see https://github.com/moby/sys/pull/160 for details). cache: false + - name: Install golangci-lint + uses: golangci/golangci-lint-action@v8 + with: + version: v2.4 + # We don't need to run golangci-lint here yet, but + # there's no way to avoid it, so run it on one module. + working-directory: ./mountinfo - name: Set PACKAGES env if: ${{ matrix.go-version == '1.18.x' }} run: | diff --git a/.gitignore b/.gitignore index 573b0a9..7f85602 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,2 @@ -/_build/ /mount/go-local.* coverage.txt diff --git a/Makefile b/Makefile index 1985426..9f15ee9 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,4 @@ PACKAGES ?= atomicwriter capability mountinfo mount reexec sequential signal symlink user userns -BINDIR ?= _build/bin CROSS ?= linux/arm linux/arm64 linux/ppc64le linux/s390x \ freebsd/amd64 openbsd/amd64 darwin/amd64 darwin/arm64 windows/amd64 SUDO ?= sudo -n @@ -47,18 +46,14 @@ test-local: cd atomicwriter && go mod tidy $(MOD) && go test $(MOD) $(RUN_VIA_SUDO) -v . $(RM) atomicwriter/go-local.* +.PHONY: golangci-lint-version +golangci-lint-version: + golangci-lint version + .PHONY: lint -lint: $(BINDIR)/golangci-lint -lint: CMD=go mod download; ../$(BINDIR)/golangci-lint run +lint: golangci-lint-version +lint: CMD=go mod download; golangci-lint run lint: foreach -lint: - $(BINDIR)/golangci-lint version - -$(BINDIR)/golangci-lint: $(BINDIR) - curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(BINDIR) v2.0.2 - -$(BINDIR): - mkdir -p $(BINDIR) .PHONY: cross cross: