From 7728c9b9901a4e9ead29a996dd03b0581975dea7 Mon Sep 17 00:00:00 2001 From: c-bata Date: Sat, 19 Sep 2020 00:04:52 +0900 Subject: [PATCH] Remove travis-ci config --- .github/workflows/test.yml | 21 ++++++++++++++++ .travis.yml | 50 -------------------------------------- Makefile | 13 +++++----- 3 files changed, 28 insertions(+), 56 deletions(-) delete mode 100644 .travis.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5831c40..0688fd4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -39,3 +39,24 @@ jobs: env: GO111MODULE: on run: ./_example/build.sh + + lint: + name: Run lint checks + runs-on: ubuntu-latest + steps: + - name: Set up Go 1.14 + uses: actions/setup-go@v2 + with: + go-version: 1.14 + id: go + - name: Check out code into the Go module directory + uses: actions/checkout@master + - name: Download golangci-lint + run: | + wget https://github.com/golangci/golangci-lint/releases/download/v1.20.1/golangci-lint-1.20.1-linux-amd64.tar.gz + tar -xvf ./golangci-lint-1.20.1-linux-amd64.tar.gz + - name: Running golangci-lint + env: + GO111MODULE: on + GOPATH: /home/runner/work/ + run: GOCILINT=${GOPATH}/bin/golangci-lint make lint diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 1c5decd..0000000 --- a/.travis.yml +++ /dev/null @@ -1,50 +0,0 @@ -sudo: false -language: go - -go: - - "1.11.x" - - tip - -os: - - linux - - osx - - windows - -env: - - GO111MODULE=on - -cache: - directories: - - $GOPATH/pkg/mod/cache - -install: - - GO111MODULE=off go get -u golang.org/x/lint/golint - - GO111MODULE=off go get -u golang.org/x/tools/cmd/goimports - -stages: - - lint - - examples - - test - -jobs: - include: - - stage: lint - script: - - diff <(goimports -d $(find . -type f -name '*.go')) <(echo -n "") - - make lint - go: "1.11.x" - os: osx - - stage: examples - script: - - ./_example/build.sh - go: "1.11.x" - os: osx - -script: - - go test -race ./... - -matrix: - fast_finish: true - allow_failures: - - go: tip - - os: windows diff --git a/Makefile b/Makefile index 952b463..505817c 100644 --- a/Makefile +++ b/Makefile @@ -1,22 +1,23 @@ .DEFAULT_GOAL := help -PKGS := $(shell go list ./...) SOURCES := $(shell find . -prune -o -name "*.go" -not -name '*_test.go' -print) +GOIMPORTS ?= goimports +GOCILINT ?= golangci-lint + .PHONY: setup setup: ## Setup for required tools. - go get -u golang.org/x/lint/golint go get -u golang.org/x/tools/cmd/goimports + go get -u github.com/golangci/golangci-lint/cmd/golangci-lint go get -u golang.org/x/tools/cmd/stringer .PHONY: fmt fmt: $(SOURCES) ## Formatting source codes. - @goimports -w $^ + @$(GOIMPORTS) -w $^ .PHONY: lint -lint: ## Run golint and go vet. - @golint -set_exit_status=1 $(PKGS) - @go vet $(PKGS) +lint: ## Run golangci-lint. + @$(GOCILINT) run --no-config --disable-all --enable=goimports --enable=misspell ./... .PHONY: test test: ## Run tests with race condition checking.