diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b1f6df8..250ca4b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,9 +7,13 @@ jobs: name: Lint runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 + - uses: actions/setup-go@v4 + with: + go-version: 1.18 + cache: false - name: golangci-lint - uses: golangci/golangci-lint-action@v2 + uses: golangci/golangci-lint-action@v3 with: version: v1.54 env: @@ -19,16 +23,10 @@ jobs: name: Tidy runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-go@v2 + - uses: actions/checkout@v3 + - uses: actions/setup-go@v4 with: go-version: 1.18 - - uses: actions/cache@v2 - with: - path: ~/go/pkg/mod - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-go- - name: Check if mods are tidy run: make check-tidy @@ -36,18 +34,12 @@ jobs: name: Coverage runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-go@v2 + - uses: actions/checkout@v3 + - uses: actions/setup-go@v4 with: go-version: 1.18 - - uses: actions/cache@v2 - with: - path: ~/go/pkg/mod - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-go- - name: Publish coverage - uses: paambaati/codeclimate-action@v2.7.4 + uses: paambaati/codeclimate-action@v5.0.0 env: VERBOSE: "true" GOMAXPROCS: 4 @@ -70,16 +62,10 @@ jobs: - "1.21" runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-go@v2 + - uses: actions/checkout@v3 + - uses: actions/setup-go@v4 with: go-version: ${{ matrix.go_version }} - - uses: actions/cache@v2 - with: - path: ~/go/pkg/mod - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-go- - name: Run tests run: go test -v -count=1 -race ./... diff --git a/Makefile b/Makefile index 946b2e3..0908153 100644 --- a/Makefile +++ b/Makefile @@ -34,23 +34,19 @@ SHELL := env \ # Tools # -TOOLS += $(TOOLDIR)/gobin -$(TOOLDIR)/gobin: - GO111MODULE=off go get -u github.com/myitcv/gobin - # external tool define tool # 1: binary-name, 2: go-import-path TOOLS += $(TOOLDIR)/$(1) -$(TOOLDIR)/$(1): $(TOOLDIR)/gobin Makefile - gobin $(V) "$(2)" +$(TOOLDIR)/$(1): Makefile + GOBIN="$(CURDIR)/$(TOOLDIR)" go install "$(2)" endef -$(eval $(call tool,godoc,golang.org/x/tools/cmd/godoc)) -$(eval $(call tool,gofumpt,mvdan.cc/gofumpt)) -$(eval $(call tool,goimports,golang.org/x/tools/cmd/goimports)) +$(eval $(call tool,godoc,golang.org/x/tools/cmd/godoc@latest)) +$(eval $(call tool,gofumpt,mvdan.cc/gofumpt@latest)) +$(eval $(call tool,goimports,golang.org/x/tools/cmd/goimports@latest)) $(eval $(call tool,golangci-lint,github.com/golangci/golangci-lint/cmd/golangci-lint@v1.54)) -$(eval $(call tool,gomod,github.com/Helcaraxan/gomod)) +$(eval $(call tool,gomod,github.com/Helcaraxan/gomod@latest)) .PHONY: tools tools: $(TOOLS)