Skip to content

Commit

Permalink
Add static check to GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
kenzo0107 committed Dec 8, 2019
1 parent 87f21d8 commit 0faf0a9
Show file tree
Hide file tree
Showing 2 changed files with 89 additions and 7 deletions.
88 changes: 88 additions & 0 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: static check
on: pull_request

jobs:
imports:
name: Imports
strategy:
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@master
- name: check
uses: grandcolline/golang-github-actions@v1.1.0
with:
run: imports
token: ${{ secrets.GITHUB_TOKEN }}

errcheck:
name: Errcheck
strategy:
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@master
- name: check
uses: grandcolline/golang-github-actions@v1.1.0
with:
run: errcheck
token: ${{ secrets.GITHUB_TOKEN }}

lint:
name: Lint
strategy:
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@master
- name: check
uses: grandcolline/golang-github-actions@v1.1.0
with:
run: lint
token: ${{ secrets.GITHUB_TOKEN }}

shadow:
name: Shadow
strategy:
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@master
- name: check
uses: grandcolline/golang-github-actions@v1.1.0
with:
run: shadow
token: ${{ secrets.GITHUB_TOKEN }}

staticcheck:
name: StaticCheck
strategy:
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@master
- name: check
uses: grandcolline/golang-github-actions@v1.1.0
with:
run: staticcheck
token: ${{ secrets.GITHUB_TOKEN }}

sec:
name: Sec
strategy:
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@master
- name: check
uses: grandcolline/golang-github-actions@v1.1.0
with:
run: sec
token: ${{ secrets.GITHUB_TOKEN }}
flags: "-exclude=G104"
8 changes: 1 addition & 7 deletions .github/workflows/go.yml → .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,7 @@ jobs:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v1
- name: install golint
run: GO111MODULE=off go get golang.org/x/lint/golint
- name: Install dependencies
run: go get -v -d
- name: Vet
run: go vet ./...
- name: Lint
run: golint -set_exit_status ./...
- name: Test
run: go test -v -count=1 -cover ./...
run: go test -v -count=1 -cover ./...

0 comments on commit 0faf0a9

Please sign in to comment.