Skip to content

Commit

Permalink
feat(ci): Use golangci-lint
Browse files Browse the repository at this point in the history
  • Loading branch information
SkYNewZ committed Apr 8, 2020
1 parent c9c50c4 commit 25e2e95
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 69 deletions.
46 changes: 4 additions & 42 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,33 +18,11 @@ jobs:
- name: Checkout code
uses: actions/checkout@v2

- name: Install golint
run: go get -u -v golang.org/x/lint/golint
- name: Install golangci-lint
run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.24.0

- name: Lint!
run: |
export PATH=$PATH:$(go env GOPATH)/bin
golint -set_exit_status ./...
format:
name: Go format
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.14
uses: actions/setup-go@v1
with:
go-version: 1.14
id: go

- name: Checkout code
uses: actions/checkout@v2

- name: Test gogmt
run: test $(gofmt -l -e . | wc -l) -eq 0

- name: Print gofmt errors
if: failure()
run: gofmt -d .
- name: Run golangci-lint
run: ./bin/golangci-lint run ./... --enable golint,unparam,misspell

test:
name: Tests
Expand Down Expand Up @@ -92,19 +70,3 @@ jobs:

- name: Go install
run: go install .

install:
name: Install
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.14
uses: actions/setup-go@v1
with:
go-version: 1.14
id: go

- name: Checkout code
uses: actions/checkout@v2

- name: Go install
run: go install .
31 changes: 4 additions & 27 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,33 +22,11 @@ jobs:
- name: Checkout code
uses: actions/checkout@v2

- name: Install golint
run: go get -u -v golang.org/x/lint/golint
- name: Install golangci-lint
run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.24.0

- name: Lint!
run: |
export PATH=$PATH:$(go env GOPATH)/bin
golint -set_exit_status ./...
format:
name: Go format
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.14
uses: actions/setup-go@v1
with:
go-version: 1.14
id: go

- name: Checkout code
uses: actions/checkout@v2

- name: Test gogmt
run: test $(gofmt -l -e . | wc -l) -eq 0

- name: Print gofmt errors
if: failure()
run: gofmt -d .
- name: Run golangci-lint
run: ./bin/golangci-lint run ./... --enable golint,unparam,misspell

test:
name: Tests
Expand Down Expand Up @@ -101,7 +79,6 @@ jobs:
name: Build
needs:
- lint
- format
- test
runs-on: ubuntu-latest
steps:
Expand Down

0 comments on commit 25e2e95

Please sign in to comment.