diff --git a/.github/workflows/build-pr.yml b/.github/workflows/build-pr.yml index 73666d5..e27ed59 100644 --- a/.github/workflows/build-pr.yml +++ b/.github/workflows/build-pr.yml @@ -11,22 +11,32 @@ jobs: steps: - name: checkout source code uses: actions/checkout@master + - name: setup go environment uses: actions/setup-go@v1 with: go-version: '1.17.2' + + - name: create go.mod + run: | + # Fix for "cannot find main module" issue + go mod init github.com/opencontainers/runtime-spec + + go get -d ./schema/... + + - name: run golangci-lint + uses: golangci/golangci-lint-action@v3 + with: + version: v1.51.2 + args: --verbose + - name: run tests run: | export PATH="$(go env GOPATH)/bin:${PATH}" set -x make install.tools - # Fix for "cannot find main module" issue - go mod init github.com/opencontainers/runtime-spec - - go get -d ./schema/... make .govet - make .golint make .gitvalidation make docs diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9045dd4..eb29bd8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,22 +11,32 @@ jobs: steps: - name: checkout source code uses: actions/checkout@master + - name: setup go environment uses: actions/setup-go@v1 with: go-version: '1.17.2' + + - name: create go.mod + run: | + # Fix for "cannot find main module" issue + go mod init github.com/opencontainers/runtime-spec + + go get -d ./schema/... + + - name: run golangci-lint + uses: golangci/golangci-lint-action@v3 + with: + version: v1.51.2 + args: --verbose + - name: run tests run: | export PATH="$(go env GOPATH)/bin:${PATH}" set -x make install.tools - # Fix for "cannot find main module" issue - go mod init github.com/opencontainers/runtime-spec - - go get -d ./schema/... make .govet - make .golint make .gitvalidation make docs diff --git a/.tool/version-doc.go b/.tool/version-doc.go index f36bfe4..fdc6e28 100644 --- a/.tool/version-doc.go +++ b/.tool/version-doc.go @@ -1,3 +1,4 @@ +//go:build ignore // +build ignore package main diff --git a/Makefile b/Makefile index 7a61610..9fb877d 100644 --- a/Makefile +++ b/Makefile @@ -61,14 +61,6 @@ test: .govet .golint .gitvalidation .govet: go vet -x ./... -# `go get github.com/golang/lint/golint` -.golint: -ifeq ($(call ALLOWED_GO_VERSION,1.7,$(HOST_GOLANG_VERSION)),true) - @which golint > /dev/null 2>/dev/null || (echo "ERROR: golint not found. Consider 'make install.tools' target" && false) - golint ./... -endif - - # When this is running in GitHub, it will only check the GitHub commit range .gitvalidation: @which git-validation > /dev/null 2>/dev/null || (echo "ERROR: git-validation not found. Consider 'make install.tools' target" && false) @@ -78,13 +70,7 @@ else git-validation -v -run DCO,short-subject,dangling-whitespace -range $(EPOCH_TEST_COMMIT)..HEAD endif -install.tools: .install.golint .install.gitvalidation - -# golint does not even build for