goc/.github/workflows/style_check.yml
Li Yiyang c2391c5b18
Migrate qbox/goc to qiniu/goc (#8)
* build/install

* all branches

* e2e test

* goc binary

PATH

add checkout code

add +x

test github action

test for github action

test for github actions

test for github actions

test for github actions

fix ci

fix

fix temp path error

* go1.11 1.10 not support go env command

fix

* fix build dir error for go 1.11/1.12 mod project

* e2e test

test

test

fix yaml syntax error

fix

fix

fix

* fix env error

fix

fix

* add unit test

* add unit test coverage report

update

update

* add license
2020-05-21 14:30:41 +08:00

38 lines
982 B
YAML

name: style-check
on:
# Trigger the workflow on push or pull request,
# but only for the master branch
push:
paths-ignore:
- '**.md'
pull_request:
paths-ignore:
- '**.md'
jobs:
run:
name: vet and gofmt
strategy:
matrix:
go-version: [1.13.x, 1.14.x]
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
# This step checks out a copy of your repository.
- name: Checkout code
uses: actions/checkout@v2
- name: Go vet check
run: |
go vet ./...
- name: Gofmt check
run: |
diff=`find . -name "*.go" | xargs gofmt -s -d`
if [[ -n "${diff}" ]]; then
echo "Gofmt check failed :"
echo "${diff}"
echo "Please run this command to fix: [find . -name "*.go" | xargs gofmt -s -w]"
exit 1
fi