Skip to content

Commit

Permalink
separate jobs for all static checks (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
Shivam010 committed Sep 10, 2020
1 parent 8bbe4ce commit c368fdc
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 19 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ env:

jobs:
build:
name: Test on ${{ matrix.os }} with Go ${{ matrix.go_version }}
name: On ${{ matrix.os }} with Go ${{ matrix.go_version }}
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -17,15 +17,11 @@ jobs:
with:
go-version: ${{ matrix.go_version }}
id: go

- name: Check out code
uses: actions/checkout@v1

- name: Go mod verify
run: go mod verify

- name: Go vet normally
run: go vet ./...

- name: Go build
run: go build ./...
36 changes: 22 additions & 14 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,40 +5,48 @@ env:

jobs:
test:
name: Test on ${{ matrix.os }} with Go ${{ matrix.go_version }}
name: With ${{ matrix.go_version }}
runs-on: ubuntu-latest
strategy:
matrix:
go_version: [1.15]
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- name: Set up Go ${{ matrix.go_version }}
uses: actions/setup-go@v1
with:
go-version: ${{ matrix.go_version }}
id: go

- name: Check out code
uses: actions/checkout@v1
- name: Go Test
run: |
go test -timeout 5m -race -v -covermode=atomic -coverprofile=coverage.out ./...
- name: Send coverage to Coveralls
env:
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
GO111MODULE=off go get -u github.com/mattn/goveralls
$(go env GOPATH)/bin/goveralls -coverprofile=coverage.out -service=github
- name: Staticcheck
staticcheck:
name: StaticCheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: check
uses: grandcolline/golang-github-actions@v1.1.0
with:
run: staticcheck
token: ${{ secrets.GITHUB_TOKEN }}

- name: Go vet with shadow
vet-shadow:
name: Go Vet with Shadow
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: check
uses: grandcolline/golang-github-actions@v1.1.0
with:
run: shadow
token: ${{ secrets.GITHUB_TOKEN }}

- name: Go Test
run: |
go test -timeout 5m -race -v -covermode=atomic -coverprofile=coverage.out ./...
- name: Send coverage to Coveralls
env:
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
GO111MODULE=off go get -u github.com/mattn/goveralls
$(go env GOPATH)/bin/goveralls -coverprofile=coverage.out -service=github

0 comments on commit c368fdc

Please sign in to comment.